The CPU and the fetch-execute cycle
Введено
11:47
Центральный процессор (CPU)
Процессор вашего телефона выполняет действие, почти до смешного простое. Взять одну инструкцию. Понять её смысл. Выполнить её. Затем взять следующую. Это…
Озвучивание на английском · переключаемые субтитры на английском и китайском языках
В этом уроке
| English | Значение |
|---|---|
| CPU/ˌsiː piː ˈjuː/ | центральный процессор |
| data/ˈdeɪtə/ | Recorded facts, observations or values used for analysis or processing. |
| instructions/ɪnˈstrʌkʃnz/ | инструкции |
| ALU/ˌeɪ el ˈjuː/ | арифметико-логическое устройство |
| control unit/kənˈtrəʊl ˈjuːnɪt/ | блок управления |
| registers/ˈredʒɪstəz/ | регистры |
| buses/ˈbʌsɪz/ | шины |
| program/ˈprəʊɡræm/ | A set of instructions specifying operations for a computer to carry out. |
| fetch–execute cycle/fetʃ ˈeksɪkjuːt ˈsaɪkl/ | The repeating process of obtaining an instruction, decoding it and carrying out the required operation. |
| logical comparisons | |
| control signals | |
| memory/ˈmeməri/ | Circuits that store data, such as registers, RAM and ROM. |
| address/əˈdres/ | An identifier specifying a location in memory or on a network. |
| chip | |
| Fetch | |
| Execute/ˈeksɪkjuːt/ | |
| PC | |
| MAR | |
| MDR | |
| CIR | |
| ACC | |
| Decode | |
| cache/kæʃ/ | кэш-память |
| embedded system/emˈbedɪd ˈsɪstəm/ | встроенная система |
| cores/kɔːz/ | Processing units within a processor that can execute instruction streams. |
| cache size | |
| clock speed/klɒk spiːd/ | The number of cycles of a processor's clock per second; it alone does not determine how quickly every program runs. |
| Storage/ˈstɔːrɪdʒ/ | |
| secondary storage/ˈsekəndəri ˈstɔːrɪdʒ/ | Non-volatile storage used to retain data and programs beyond immediate processing. |
| program counter/ˈprəʊɡræm ˈkaʊntə/ | A processor register holding the address of the next instruction to fetch in the simplified CPU model. |
| address bus/əˈdres bʌs/ | The signal lines used to identify a memory location or device involved in a transfer. |
| data bus/ˈdeɪtə bʌs/ | The signal lines carrying data between processor, memory and other connected components. |
| accumulator/əˈkjuːmjʊleɪtə/ | A register used to hold intermediate arithmetic or logical results during processing. |
Центральный процессор
- ЦП обрабатывает данные и выполняет инструкции, повторяя цикл миллионы раз в секунду.
- Внутри находятся АЛУ, устройство управления и регистры, соединенные шинами.
- Он запускает каждую программу через цикл выборки-исполнения.
Части ЦП
- АЛУ — выполняет вычисления и логические сравнения.
- Устройство управления (CU) — отправляет управляющие сигналы для управления всеми частями.
- Регистры — крошечные, очень быстрые хранилища, удерживающие по одному значению каждое.
- Три шины связывают их с памятью: адресная (в одну сторону), данные (в обе стороны), управления.


Современный ЦП представляет собой единый чип, содержащий устройство управления, АЛУ и регистры


The ALU in a CPU:
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
The arithmetic logic unit does the maths and logic; the control unit manages the parts.
Регистры и цикл выборки-исполнения
- Специальные регистры: PC (адрес следующей инструкции), MAR (адрес доступа), MDR (выборочные данные/инструкция), CIR (выполняемая инструкция), ACC (результат АЛУ).
- Цикл повторяет три этапа: Выборка (копирование инструкции в ЦП, затем PC + 1) → Декодирование (CU определяет её смысл) → Исполнение (выполнение действия).

Цикл выборки-декодирования-исполнения, который ЦП повторяет для каждой инструкции

Цикл выборки-исполнения
Tap round the loop the CPU repeats billions of times a second — fetch the instruction, decode what it means, execute it, then do it all again.
Match each CPU part to what it does.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
The ALU computes, the control unit directs, the PC tracks the next instruction, and cache keeps hot data close.
Put the stages of the cycle in order.
Сложность 3/5 · 200 монет + небольшой бонус за первое завершение сегодня
Fetch the instruction, decode what it means, then execute it — repeated continuously.
Кэш, производительность, встраиваемые системы
- Кэш — небольшой объем очень быстрой памяти рядом с ЦП, хранящий часто используемые данные — чтобы ЦП меньше ждал.
- Производительность зависит от количества ядер, объема кэша и частоты тактирования (циклов в секунду).
- Встраиваемая система — маленький компьютер, встроенный в устройство для выполнения одной конкретной задачи (стиральная машина, микроволновая печь).

Кэш и основная память (RAM) расположены близко к ЦП для быстрой подачи ему данных


Which change would improve CPU performance?
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
More cores, a larger cache and a higher clock speed all improve performance.
Cache is small, very fast memory near the CPU that holds often-used data, so the CPU waits less than it would reading from main memory.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
A bigger cache, more cores and a higher clock speed all raise performance — cache helps by cutting the wait for data.
Это новая карточка, поэтому она отображается на английском, пока её перевод не будет готов.
Worked example: one trip round the cycle
The program counter 程序计数器 (PC) holds 20. Describe how the next instruction is fetched.
- The address 20 is copied from the PC to the MAR and sent along the address bus 地址总线 to memory. The instruction stored at address 20 comes back along the data bus 数据总线 into the MDR, then is copied to the CIR.
- The PC goes up by 1, to 21, ready for the next fetch. The control unit then decodes the instruction in the CIR, and it is executed (the ALU does any calculation, with the result in the accumulator 累加器).
Which register holds the address of the next instruction to be fetched?
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
The PC holds the next address and is incremented after each fetch.
Doubling the number of cores always makes every program run twice as fast.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Only tasks that can be split between cores speed up, and the cores must share work and memory.
Вы поняли
- ЦП = АЛУ (математика/логика) + CU (управляющие сигналы) + регистры, связанные адресными/данными/управляющими шинами
- ключевые регистры: PC (следующая инструкция), MAR/MDR (память), CIR (текущая), ACC (результат)
- цикл: fetch → decode → execute
- производительность: cores, cache size, clock speed; cache = быстрая память рядом с CPU
Что пошло не так? Это увидит только команда сайта.