冯诺依曼架构:把程序也放进内存Von Neumann Architecture: Store the Program Too
小禾想让计算机先算总价,再改算平均数。如果每换任务都要重接电线,会有多麻烦?He wants the computer to calculate a total, then an average. What if every new task required rewiring it?
第 1 步:指令与数据都能存储Step 1: Store instructions and data
能不能只换一份步骤表?Could we change a list of instructions instead?
存储程序思想把指令编码后放入存储器。处理器取出指令,再按它操作数据。在经典冯诺依曼模型中,指令和数据共享存储体系。这样改任务可以改程序。这个发展涉及多位研究者,不能把所有现代计算机都归功于一个人。The stored-program idea encodes instructions in memory. A processor fetches them and operates on data. In the classical von Neumann model, instructions and data share the memory organization. Changing a task can mean changing a program. The historical development involved many people rather than one sole inventor of modern computing.
第 2 步:取指、译码、执行Step 2: Fetch, decode and execute
处理器怎样知道下一步做什么?How does the processor know what to do next?
程序计数器记录下一条指令位置。处理器取指令,解释操作,再执行。比如读入三、加四、输出七。跳转指令可以改变下一位置,实现循环和条件判断。真实处理器会并行安排很多工作,图中的三步是方便理解的简化。The program counter identifies the next instruction. The processor fetches it, decodes the operation and executes it: load three, add four, output seven. A branch can change the next address, enabling loops and decisions. Real processors overlap and organize work in complex ways; the three-stage illustration is a simplification.
第 3 步:数据搬运也花时间Step 3: Moving data takes time
处理器很快,为什么还会等?Why might a fast processor still wait?
处理器需要从存储层取得指令和数据。传输速度有限,等待可能成为瓶颈。缓存把常用数据放近一些,减轻等待。现代机器常混合多种结构,并不完全照着一张经典图。小禾学习架构,是为了理解职责和限制,不是记住唯一标准外形。Instructions and data must move through the memory system. Limited transfer rates can create a bottleneck. Caches keep useful data nearby to reduce waiting. Modern machines combine many designs rather than perfectly matching one classical diagram. Architecture helps explain responsibilities and limits, not a single mandatory physical layout.
🎮 三步小处理器🎮 A three-step tiny processor
点击取指、译码、执行,跟踪四段短程序的内存地址和累加器。Click fetch, decode and execute to trace addresses and the accumulator through four short programs.
一句话记住它:Remember: 存储程序让机器通过更换指令完成不同任务。Stored programs let a machine change tasks by changing instructions.
指令也能编码为数据。Instructions can be encoded as data.程序计数器跟踪下一位置。The program counter tracks the next location.存储访问可能限制速度。Memory access can limit speed.
把握度:基本结构较高;历史归功不宜单一化。互动忽略流水线、缓存与并行执行。Confidence: high for the basic structure; historical credit is shared. The activity omits pipelines, caches and parallel execution.
AI 辅助制作与资料核对。插图和互动为教学示意。AI-assisted production and source checking. Illustrations and interactions are teaching models.