The CPU and the fetch-execute cycle
Introduzido
11:47
A CPU
O processador do seu celular está fazendo algo quase estupidamente simples. Busca uma instrução. Descobre o que ela significa. Executa-a. Depois busca a próxima. Isso é…
Narração em inglês · legendas em inglês e 中文 que você pode alternar
Nesta aula
| English | Significado |
|---|---|
| CPU/ˌsiː piː ˈjuː/ | |
| data/ˈdeɪtə/ | Recorded facts, observations or values used for analysis or processing. |
| instructions/ɪnˈstrʌkʃnz/ | instruções |
| ALU/ˌeɪ el ˈjuː/ | |
| control unit/kənˈtrəʊl ˈjuːnɪt/ | unidade de controle |
| registers/ˈredʒɪstəz/ | registradores |
| buses/ˈbʌsɪz/ | barramentos |
| 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/ | sistema embarcado |
| 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. |
A unidade central de processamento
- A CPU 中央处理器 processa dados e executa instruções 指令, repetindo um ciclo milhões de vezes por segundo.
- Internamente contém a ALU 算术逻辑单元, unidade de controle 控制单元 e registradores 寄存器, ligados por barramentos 总线.
- Ela executa cada programa através do ciclo busca-execução.
Partes da CPU
- ALU — realiza cálculos e comparações lógicas.
- Unidade de Controle (CU) — envia sinais de controle para gerenciar todas as partes.
- Registradores — pequenas e muito rápidas memórias que armazenam um valor cada.
- Três barramentos os ligam à memória: endereço (um sentido), dados (ambos os sentidos), controle.


Uma CPU moderna é um único chip contendo a unidade de controle, ALU e registradores
The ALU in a CPU:
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
The arithmetic logic unit does the maths and logic; the control unit manages the parts.
Registradores e o ciclo busca-execução
- Registradores especiais: PC (endereço da próxima instrução), MAR (endereço para acessar), MDR (dado/instrução buscado), CIR (instrução sendo executada), ACC (resultado da ALU).
- O ciclo repete três etapas: Busca (copiar a instrução para dentro da CPU, depois PC + 1) → Decodificação (a CU descobre o que significa) → Execução (realizá-la).

O ciclo busca-decodificação-execução que a CPU repete para cada instrução
O ciclo fetch-execute
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.
Dificuldade 2/5 · Moedas 140 + pequeno bônus na primeira conclusão hoje
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.
Dificuldade 3/5 · Moedas 200 + pequeno bônus na primeira conclusão hoje
Fetch the instruction, decode what it means, then execute it — repeated continuously.
Cache 高速缓存, desempenho, sistemas embutidos 嵌入式系统
- Cache é uma pequena quantidade de memória muito rápida próxima à CPU, mantendo dados frequentemente usados — para que a CPU espere menos.
- O desempenho depende do número de núcleos, do tamanho do cache e da velocidade do clock 时钟速度 (ciclos por segundo).
- Um sistema embutido é um pequeno computador integrado a um dispositivo para uma tarefa fixa (máquina de lavar, micro-ondas).

Cache e memória principal (RAM) ficam próximas à CPU para alimentá-la rapidamente com dados


Which change would improve CPU performance?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
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.
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
A bigger cache, more cores and a higher clock speed all raise performance — cache helps by cutting the wait for data.
Este cartão é novo, por isso aparece em inglês até que a tradução esteja pronta.
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?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
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.
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
Only tasks that can be split between cores speed up, and the cores must share work and memory.
Entendeu?
- CPU = ALU (matemática/lógica) + CU (sinais de controle) + registradores, ligados por barramentos de endereço/dados/controle
- registradores principais: PC (próxima instrução), **MAR/**MDR (memória), CIR (atual), ACC (resultado)
- o ciclo: busca → decodificação → execução
- desempenho: núcleos, tamanho do cache, velocidade do clock; cache = memória rápida próxima à CPU
O que deu errado? Somente a equipe do site vê isso.