Von Neumann architecture and the CPU · 冯·诺依曼体系结构与 CPU
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| processor/ˈprəʊsesə/ | 处理器 | chǔ lǐ qì |
| registers/ˈredʒɪstəz/ | 寄存器 | jì cún qì |
| buses/ˈbʌsɪz/ | 总线 | zǒng xiàn |
| Von Neumann architecture/vɒn ˈnɔɪmən ˈɑːkɪtektʃə/ | 冯·诺依曼体系结构 | féng · nuò yī màn tǐ xì jié gòu |
| Immediate Access Store/ɪˈmiːdɪət ˈækses stɔː/ | 立即存取存储器 | lì jí cún qǔ cún chǔ qì |
| stored program/stɔːd ˈprəʊɡræm/ | 存储程序 | cún chǔ chéng xù |
| ALU/ˌeɪ el ˈjuː/ | 算术逻辑单元 | suàn shù luó jí dān yuán |
| control unit/kənˈtrəʊl ˈjuːnɪt/ | 控制单元 | kòng zhì dān yuán |
| system clock/ˈsɪstəm klɒk/ | 系统时钟 | xì tǒng shí zhōng |
| clock speed/klɒk spiːd/ | 时钟频率 | shí zhōng pín lǜ |
| general-purpose registers/ˈdʒenərəl ˈpɜːpəs ˈredʒɪstəz/ | 通用寄存器 | tōng yòng jì cún qì |
| special purpose registers/ˈspeʃl ˈpɜːpəs ˈredʒɪstəz/ | 专用寄存器 | zhuān yòng jì cún qì |
| Program Counter/ˈprəʊɡræm ˈkaʊntə/ | 程序计数器 | chéng xù jì shù qì |
| Memory Address Register/ˈmeməri əˈdres ˈredʒɪstə/ | 内存地址寄存器 | nèi cún dì zhǐ jì cún qì |
| Memory Data Register/ˈmeməri ˈdeɪtə ˈredʒɪstə/ | 内存数据寄存器 | nèi cún shù jù jì cún qì |
| Current Instruction Register/ˈkʌrənt ɪnˈstrʌkʃn ˈredʒɪstə/ | 当前指令寄存器 | dāng qián zhǐ lìng jì cún qì |
| accumulator/əˈkjuːmjʊleɪtə/ | 累加器 | lěi jiā qì |
| Index Register/ˈɪndeks ˈredʒɪstə/ | 变址寄存器 | biàn zhǐ jì cún qì |
| Status Register/ˈsteɪtəs ˈredʒɪstə/ | 状态寄存器 | zhuàng tài jì cún qì |
| flag/flæɡ/ | 标志 | biāo zhì |
| address bus/əˈdres bʌs/ | 地址总线 | dì zhǐ zǒng xiàn |
| data bus/ˈdeɪtə bʌs/ | 数据总线 | shù jù zǒng xiàn |
| control bus/kənˈtrəʊl bʌs/ | 控制总线 | kòng zhì zǒng xiàn |
| register transfer/ˈredʒɪstə ˈtrænsfɜː/ | 寄存器传送 | jì cún qì chuán sòng |
The report every computer still follows
- In June 1945 John von Neumann circulated a typed draft describing a machine that had not yet been built: the EDVAC.
- Its idea was simple and new. Keep the program in the same memory as the data, and have one processor fetch and carry out the instructions one at a time.
- The draft was never finished, but the design was copied everywhere. Your phone, your laptop and the school server are all built on it.
- This lesson takes the model apart: the memory, the processor's parts, its registers and the buses between them.
每台计算机仍在遵循的那份报告
- 1945 年 6 月,John von Neumann 传阅了一份打字稿,描述一台尚未造出来的机器:EDVAC。
- 它的想法简单而新颖。把程序和数据放在同一个存储器里,由一个处理器逐条取出并执行指令。
- 这份草稿从未完成,但这个设计被到处复制。你的手机、你的笔记本电脑和学校的服务器都建立在它之上。
- 这一课把这个模型拆开:存储器、处理器的各部分、它的寄存器,以及它们之间的总线。
The Von Neumann model
- The Von Neumann architecture 冯·诺依曼体系结构 has a single memory, the Immediate Access Store 立即存取存储器 (IAS), holding both program instructions and data. That is the stored program 存储程序 concept.
- The processor 处理器 fetches each instruction from memory and executes it, one at a time, in address order unless a branch instruction changes the flow.
- Instructions, data and addresses all travel between processor and memory along shared buses 总线.
One memory, one processor, three buses
冯·诺依曼模型
- 冯·诺依曼体系结构(Von Neumann architecture)有一个单一的存储器——立即存取存储器(Immediate Access Store,IAS)——同时保存程序指令和数据。这就是存储程序(stored program)的概念。
- 处理器(processor)从存储器中取出每条指令并执行,一次一条,按地址顺序进行,除非跳转指令改变流程。
- 指令、数据和地址都沿着共享的总线(buses)在处理器和存储器之间传输。

一个存储器,一个处理器,三条总线
Why the stored program matters
- Change the program in memory and the same hardware does a different job. No rewiring, no new machine.
- A program is just data until it is fetched, so it can be loaded from a disk, sent over a network or written by another program.
- The exam wording: instructions and data are stored in the same memory, and instructions are fetched one at a time and executed by the processor.
为什么存储程序重要
- 改变存储器里的程序,同样的硬件就做不同的工作。不用重新布线,不用造新机器。
- 程序在被取出之前只是数据,所以它可以从磁盘加载、通过网络发送,或由另一个程序写出。
- 考试的措辞:指令和数据存储在同一个存储器里,指令一次一条地被取出并由处理器执行。
The stored-program (Von Neumann) idea means that: · 存储程序(冯·诺依曼)的想法意味着:
One memory holds instructions and data together; changing the stored program changes what the computer does, with no rewiring. · 一个内存把指令和数据一起保存;改变存储的程序就改变计算机做什么,不需要重新布线。
ALU, control unit and clock
- The ALU 算术逻辑单元 (Arithmetic and Logic Unit) does the arithmetic (add, subtract) and the logic (AND, OR, comparisons), taking operands from registers and putting the result back in one.
- The control unit 控制单元 (CU) decodes each instruction and sends the control signals that carry it out: opening data paths, telling the ALU what to do, ordering memory reads and writes.
- The system clock 系统时钟 sends a steady stream of pulses. The control unit moves the cycle on one step per pulse, so every part changes state together; the clock speed 时钟频率, in GHz, is the number of pulses a second.
The whole processor is one small chip
ALU、控制单元和时钟
- ALU(算术逻辑单元,Arithmetic and Logic Unit)做算术(加、减)和逻辑(AND、OR、比较),从寄存器取操作数,把结果放回一个寄存器。
- 控制单元(control unit,CU)解码每条指令,并发出执行它的控制信号:打开数据通路、告诉 ALU 做什么、指挥存储器的读写。
- 系统时钟(system clock)发出稳定的脉冲流。控制单元每个脉冲把周期推进一步,所以每个部分同时改变状态;时钟频率(clock speed),以 GHz 计,是每秒的脉冲数。

整个处理器就是一颗小芯片
The ALU is responsible for: · ALU 负责:
The Arithmetic and Logic Unit performs calculations and logic/comparisons. Decoding is the control unit's job. · 算术逻辑单元执行计算和逻辑/比较。解码是控制单元的工作。
The ____ unit decodes each instruction and sends the control signals that carry it out. · ____单元解码每条指令,并发出执行它的控制信号。
The control unit decodes and signals; the ALU does the arithmetic and logic; the clock keeps them in step. · 控制单元解码并发信号;ALU 做算术和逻辑;时钟让它们同步。
The registers
- Registers 寄存器 are tiny, very fast stores inside the processor. General-purpose registers 通用寄存器 hold the programmer's temporary values. Special purpose registers 专用寄存器 each have one fixed job in the cycle.
| Register | Job |
|---|---|
| Program Counter 程序计数器 (PC) | the address of the next instruction to be fetched |
| Memory Address Register 内存地址寄存器 (MAR) | the address of the location being read from or written to |
| Memory Data Register 内存数据寄存器 (MDR) | the data or instruction just read from, or about to be written to, that location |
| Current Instruction Register 当前指令寄存器 (CIR) | the instruction currently being decoded and executed |
| Accumulator 累加器 (ACC) | the result of the last arithmetic or logic operation |
| Index Register 变址寄存器 (IX) | an offset added to an address in indexed addressing |
| Status Register 状态寄存器 | the flags set by the last operation |
Registers, control unit and ALU, linked by the buses
寄存器
- 寄存器(registers)是处理器内部微小而极快的存储单元。通用寄存器(general-purpose registers)保存程序员的临时值。专用寄存器(special purpose registers)各在周期中有一项固定的工作。
| 寄存器 | 工作 |
|---|---|
| 程序计数器(Program Counter,PC) | 下一条要取的指令的地址 |
| 内存地址寄存器(Memory Address Register,MAR) | 正在读或写的存储单元的地址 |
| 内存数据寄存器(Memory Data Register,MDR) | 刚从该单元读出、或即将写入该单元的数据或指令 |
| 当前指令寄存器(Current Instruction Register,CIR) | 当前正在解码和执行的指令 |
| 累加器(Accumulator,ACC) | 上一次算术或逻辑运算的结果 |
| 变址寄存器(Index Register,IX) | 变址寻址中加到地址上的偏移量 |
| 状态寄存器(Status Register) | 上一次运算设置的标志 |

寄存器、控制单元和 ALU,由总线连接
Tap the parts of a Von Neumann computer · 点击一台冯·诺依曼计算机的部件
Explore each block. The CPU (control unit, ALU, registers) talks to a single main memory over the buses — and that one shared memory for instructions AND data is the Von Neumann idea. · 探索每个模块。CPU(控制单元、ALU、寄存器)通过总线与一个单一的主内存通信——而那个为指令和数据共享的内存就是冯·诺依曼的想法。
Match each special-purpose register to what it holds. · 把每个专用寄存器与它保存的东西配对。
PC points to the next instruction, CIR holds the current one, MAR/MDR are the address/data pair for memory, ACC holds the running result. · PC 指向下一条指令,CIR 保存当前的,MAR/MDR 是内存的地址/数据对,ACC 保存运行的结果。
Worked example: "describe the role of each register"
- The table question wants one precise sentence per register, and the words that earn the marks are in bold.
- PC: holds the address of the next instruction to be fetched. MAR: holds the address of the location being accessed.
- MDR: holds the data just read from, or about to be written to, memory. CIR: holds the instruction currently being decoded and executed.
- ACC: holds the result of the last ALU operation. Notice that two registers hold addresses, two hold contents, and one holds a result.
例题:"描述每个寄存器的作用"
- 表格题要求每个寄存器一句精确的话,得分的词加粗。
- PC:保存下一条要取的指令的地址。MAR:保存正在访问的存储单元的地址。
- MDR:保存刚从存储器读出、或即将写入存储器的数据。CIR:保存当前正在解码和执行的指令。
- ACC:保存上一次 ALU 运算的结果。注意两个寄存器保存地址,两个保存内容,一个保存结果。
The status register's flags
- Each flag 标志 is one bit, set or cleared by the ALU after an operation: the zero flag when a result or comparison gives zero, the carry flag when an addition overflowed the register, the negative flag when a result is negative, the overflow flag when a signed result does not fit.
- A conditional jump reads a flag to decide whether to branch. That is how
IFand loops reach the hardware. - An overflow flag can also raise an interrupt, which the next lesson handles.
状态寄存器的标志
- 每个标志(flag)是一个比特,由 ALU 在一次运算后置位或清零:结果或比较为零时置零标志,加法溢出寄存器时置进位标志,结果为负时置负标志,有符号结果放不下时置溢出标志。
- 条件跳转读取一个标志来决定是否分支。这就是
IF和循环到达硬件的方式。 - 溢出标志也可以引发一个中断,下一课处理它。
Which of these are flags in the status register? Select all · 所有 that apply. · 以下哪些是状态寄存器中的标志?选出所有适用的。
Carry, zero, negative and overflow are one-bit flags set by the ALU. The program counter is a separate register holding an address. · 进位、零、负和溢出是 ALU 置位的一位标志。程序计数器是另一个保存地址的寄存器。
The three buses
- The address bus 地址总线 carries the address the processor wants. It is one-way, processor to memory.
- The data bus 数据总线 carries the data or instruction itself. It is two-way, because reads and writes go in opposite directions.
- The control bus 控制总线 carries control signals such as read, write, clock and interrupt. It is two-way.
The three system buses connecting processor, memory and input/output
三条总线
- 地址总线(address bus)传送处理器想要的地址。它是单向的,从处理器到存储器。
- 数据总线(data bus)传送数据或指令本身。它是双向的,因为读和写方向相反。
- 控制总线(control bus)传送读、写、时钟和中断等控制信号。它是双向的。

连接处理器、存储器和输入/输出的三条系统总线
Which bus is one-way (carries information in only one direction)? · 哪条总线是单向的(只在一个方向携带信息)?
The address bus is one-way (CPU → memory). The data and control buses are two-way. · 地址总线是单向的(CPU → 内存)。数据和控制总线是双向的。
Worked example: how wide is wide enough?
- An $n$-bit address bus can address $2^{n}$ locations. A 16-bit bus reaches $2^{16} = 65\,536$ locations; a 32-bit bus reaches $2^{32}$, about four billion.
- "State one effect of increasing the width of the address bus": more memory locations can be addressed.
- "State one effect of increasing the width of the data bus": more bits move in each transfer, so fewer transfers are needed for the same data.
- Widen the address bus and you can have more memory; widen the data bus and you move it faster.
例题:多宽才够宽?
- $n$ 位地址总线能寻址 $2^{n}$ 个单元。16 位总线到达 $2^{16} = 65\,536$ 个单元;32 位总线到达 $2^{32}$,大约四十亿。
- "说出增加地址总线宽度的一个影响":能寻址更多的存储单元。
- "说出增加数据总线宽度的一个影响":每次传输移动更多比特,所以同样的数据需要更少的传输次数。
- 加宽地址总线,你能有更多存储器;加宽数据总线,你能更快地搬动它。
How many memory locations can a 16-bit address bus reach? · 一个 16 位的地址总线能到达多少个内存位置?
$2^{16} = 65\,536$ locations. · $2^{16} = 65\,536$ 个位置。
A wider address bus lets the CPU address more memory locations. · 一条更宽的地址总线让 CPU 寻址更多的内存位置。
Each extra address line doubles the reach — n lines address 2ⁿ locations. · 每条额外的地址线使可达范围翻倍——n 条线寻址 2ⁿ 个位置。
Register transfer notation
- Movements between registers and memory are written in register transfer 寄存器传送 notation:
MAR ← [PC]means "copy the contents of the PC into the MAR". - Square brackets mean "the contents of", and
[[MAR]]means "the contents of the location whose address is in the MAR". - The whole fetch-execute cycle is written this way in the next lesson; the notation is the same as the pseudocode assignment arrow.
寄存器传送记法
- 寄存器与存储器之间的搬动用寄存器传送(register transfer)记法书写:
MAR ← [PC]的意思是"把 PC 的内容复制到 MAR"。 - 方括号表示"……的内容",
[[MAR]]表示"地址在 MAR 中的那个单元的内容"。 - 下一课会用这种记法写出整个取指-执行周期;这个记法和伪代码的赋值箭头一样。
What does MAR ← [PC] mean? · MAR ← [PC] 是什么意思?
The arrow points at the destination and the square brackets mean "the contents of". This is the first step of every fetch. · 箭头指向目的地,方括号表示"……的内容"。这是每次取指的第一步。
Marks that slip away
- The PC holds the address of the next instruction, not the current one; the CIR holds the instruction, not an address.
- The MAR holds an address, the MDR holds data. Mixing them costs both marks.
- Only the address bus is one-way. Saying "all buses are one-way" or "the data bus is one-way" is a common slip.
- Registers are inside the processor, not part of RAM, and they are faster than any memory.
容易丢掉的分
- PC 保存下一条指令的地址,不是当前这条;CIR 保存指令,不是地址。
- MAR 保存地址,MDR 保存数据。弄混两者两分都丢。
- 只有地址总线是单向的。说"所有总线都是单向的"或"数据总线是单向的"是常见失误。
- 寄存器在处理器内部,不是 RAM 的一部分,而且比任何存储器都快。
The program counter holds the instruction that is currently being executed. · 程序计数器保存当前正在执行的指令。
The PC holds the address of the next · 次 instruction. The current instruction sits in the CIR. · PC 保存下一条指令的地址。当前指令在 CIR 里。
You've got it
- Von Neumann: one memory (IAS) holds instructions and data; the processor fetches and executes them one at a time
- ALU computes, CU decodes and signals, the clock keeps the steps in time
- PC next address · MAR address being accessed · MDR data · CIR current instruction · ACC result · IX offset · status register flags
- address bus one-way, $2^{n}$ locations; data and control buses two-way;
MAR ← [PC]copies the contents of PC into MAR
你掌握了
- 冯·诺依曼:一个存储器(IAS)保存指令和数据;处理器一次一条地取出并执行
- ALU 计算,CU 解码并发信号,时钟让各步骤同步
- PC 下一地址 · MAR 正在访问的地址 · MDR 数据 · CIR 当前指令 · ACC 结果 · IX 偏移 · 状态寄存器 标志
- 地址总线单向、$2^{n}$ 个单元;数据和控制总线双向;
MAR ← [PC]把 PC 的内容复制到 MAR