Fetch拿指令
Watch the first small step in slow motion. Which cell does the instruction come from, and why that one?
用慢動作看第一個小步驟。指令是從哪一格來的?為什麼是那一格?
How Computers Work · Unit 2 · Lesson 6 · 電腦概論 單元二 第六課
Step through a tiny processor in 3D as it fetches an instruction, decodes it, and executes it, again and again. Arrange four instructions to make it add 3 and 4, then predict what each instruction will do.
在 3D 裡一步一步看一顆小處理器怎麼拿指令、看懂、照做,然後一再重複。自己排四條指令讓它算出 3+4,再猜猜每一條指令會做什麼。
A processor does the same three small steps over and over: fetch an instruction from memory, decode it, and execute it. Each step is tiny. A processor is powerful only because it repeats this loop billions of times a second.
處理器一直重複同樣三個小步驟:從記憶體拿一條指令、看懂它、照著做。每一步都很小。處理器厲害的地方,只在於它每秒能把這個迴圈重複幾十億次。
3D Model · 3D 模型
On the left is memory: eight numbered cells holding a program and some numbers. On the right is the inside of a processor: a counter that keeps its place, a box for the instruction it is looking at, a box called A for the number it is holding, and an adder. Press Step to do one small step, and read what happened. Press Run to let it go by itself.
左邊是記憶體:八個有編號的格子,放著一個程式和幾個數。右邊是處理器的裡面:一個記住「做到哪裡」的計數器、一個放「正在看的指令」的格子、一個叫 A 的格子(放它手上的那個數),還有一個加法器。按「下一步」走一個小步驟,讀讀右邊寫了什麼;按「執行」讓它自己一直跑。
Press Step below · 按下面的「下一步」 Drag to turn · 拖曳旋轉 Scroll or pinch to zoom · 滾輪/雙指縮放
This 3D model needs WebGL, which this browser does not support. The registers, the memory list, and the Step button below still work, and so do the reading and the games.
這個瀏覽器不支援 WebGL,無法顯示 3D 模型;下面的暫存器、記憶體清單和「下一步」按鈕照樣能用,課文和小遊戲也都能用。
A teaching model. This processor and its five instructions are our own invention; no real processor uses this exact set. A real processor has many more instructions and much more memory, and every instruction is stored as a pattern of bits, not as a word like LOAD. The model is slowed down enormously so that you can read each step. What is real is the loop itself: fetch, decode, execute, and move on to the next instruction.
這是教學用的示意模型。這顆處理器和它的五種指令是我們自己設計的,沒有哪一顆真的處理器用的是這一套。真的處理器指令多得多、記憶體也大得多,而且每條指令是存成一串位元,不是像 LOAD 這樣的字。模型被放慢了非常非常多倍,好讓你讀得到每一步。真實的是這個迴圈本身:拿、看懂、照做,再換下一條。
Model and code are drawn and programmed by My Culture Connect. The simulator is tested in tools/computers/test/cpu.test.mjs, and its ADD uses the adder from Lesson 4.
模型與程式由人師教育協會自行繪製、撰寫。模擬器有自動測試(tools/computers/test/cpu.test.mjs),其中的 ADD 用的就是第四課的加法器。
Reading · 英文閱讀
In Lesson 5 you found the processor, a small square hiding under a big cooler, and you learned that it carries out the instructions of programs. But what does that actually look like? The answer is surprisingly plain. A processor does the same three small steps, over and over, for as long as the power is on. It fetches an instruction, decodes it, and executes it.
A program is a list of instructions kept in memory. The processor has a small counter that holds the place of the next instruction. To fetch, the processor looks at the counter and copies the instruction at that place out of memory. In the model, the counter starts at 0, so the first instruction comes from cell 0.
Next the processor decodes the instruction, which means working out what it is asking for. Our model understands only five instructions. LOAD copies a number from memory into the processor. ADD adds a number from memory to it, using an adder like the one in Lesson 4. STORE copies the result back into memory. Then the processor executes the instruction: it does that one small thing and nothing more.
After that, the counter goes up by one, and the three steps begin again with the next instruction. Adding 3 and 4 takes four instructions. The fourth kind of instruction, JUMP, is different. It changes the counter itself, so the processor goes back and repeats instructions it has already done. That is how a program only a few lines long can keep a processor busy all day. The fifth, STOP, ends the program.
Each step is tiny, so the power of a processor comes from speed. A clock inside it sets the pace. Clock speed is measured in gigahertz, which means billions of cycles per second: a 3.2-gigahertz processor goes through 3.2 billion cycles every second. A cycle is not exactly one instruction. Some instructions take several cycles, and sometimes several instructions finish in one. Many processors also contain more than one core, so the work can be shared among them.
Keeping the program in the same memory as the numbers was one of the great ideas in computing. In 1945 the mathematician John von Neumann described a stored-program computer in a widely read report. On June 21, 1948, at the University of Manchester in England, a machine nicknamed the Baby ran the first program ever stored in the memory of an electronic computer. It was seventeen instructions long. With a stored program, the same processor, doing the same three steps, can become a calculator, a game, or a music player. You only have to load a different program.
Questions · 閱讀理解
What three steps does a processor repeat?
What does the counter do, and how does a JUMP instruction change it?
A 3.2-gigahertz processor goes through 3.2 billion cycles every second. Does that mean it carries out exactly 3.2 billion instructions every second? Why or why not?
Words & Phrases · 生字及片語
Quick Check · 小測驗
1. In what order does a processor work on an instruction?
2. What does the counter hold?
3. In the model, which instruction copies the number in A back into memory?
4. What does one gigahertz mean?
5. According to the reading, what happened at the University of Manchester on June 21, 1948?
Try It in the Model · 在模型裡試試
Then step through by hand and say each step out loud before you press: fetch, decode, or execute?
接著自己一步一步按,每按之前先說出這一步是什麼:拿、看懂,還是照做?
Watch the first small step in slow motion. Which cell does the instruction come from, and why that one?
用慢動作看第一個小步驟。指令是從哪一格來的?為什麼是那一格?
A already holds 3. Watch the number 4 travel from memory to the adder, and the answer come back to A.
A 已經是 3 了。看 4 這個數從記憶體跑到加法器,答案再回到 A。
This program has no STOP. Watch cell 6 while the counter keeps jumping back to 0.
這個程式沒有 STOP。看著第 6 格,同時注意計數器一直跳回 0。
Run 3 + 4 from start to finish at full speed. Where does the answer end up?
用最快的速度把 3+4 從頭跑到尾。答案最後放在哪裡?
Try It · 動手試試
Cells 5 and 6 hold 3 and 4. Choose four instructions, in order, so that cell 7 ends up holding their sum. Press Run, and the list shows what each instruction did to A. If something goes wrong, the message tells you what.
第 5 格和第 6 格放著 3 和 4。照順序選四條指令,讓第 7 格最後放的是它們的和。按「執行」,右邊會列出每一條指令讓 A 變成什麼;出了問題,訊息會告訴你是哪裡不對。
Your program, cells 0 to 3 · 你的程式(第 0 到 3 格)
Numbers, cells 5 to 7 · 數(第 5 到 7 格)
Game · 小遊戲
Eight questions. You are told what is in A, in the counter, and in one memory cell, and you are given one instruction. Choose what the answer will be after the processor executes it. The game counts how many you get right on the first try.
一共八題。題目告訴你 A、計數器和某一格記憶體現在是多少,再給你一條指令。選出處理器執行完之後的結果。遊戲會記下你第一次就答對幾題。
Right on the first try · 第一次就答對 0 / 0
Stories Behind the Loop · 這個迴圈的故事
Four short stories about programs and the processors that run them.
關於程式、以及執行程式的處理器的四個小故事。
1945 · von Neumann
The earliest electronic computers were set up for each new job by hand, with plugboards, punched cards, and paper tape. In 1945 the mathematician John von Neumann wrote the First Draft of a Report on the EDVAC. This widely circulated paper outlined a stored-program computer, in which programming information is kept electronically, just like the data. The model on this page works that way: instructions and numbers sit side by side in the same eight cells.
最早的電子電腦,每換一件工作就要動手重新設定:插接線板、打孔卡、紙帶。1945 年,數學家馮紐曼寫了〈EDVAC 報告初稿〉。這份流傳很廣的文件,勾勒出「儲存程式電腦」的架構:程式和資料一樣,用電子的方式存起來。這一頁的模型就是這樣運作的:指令和數並排放在同樣那八個格子裡。
June 21, 1948 · Manchester
At the University of Manchester, Frederic Williams, Tom Kilburn, and Geoff Toothill built a small machine to test a new kind of memory. Its official name was the Small-Scale Experimental Machine, but it is better known as the Manchester Baby. Its first program was written by Kilburn and was seventeen instructions long. It ran on June 21, 1948. The Computer History Museum calls it the first program in history to run on a digital, electronic, stored-program computer.
在曼徹斯特大學,威廉斯(Frederic Williams)、基爾本(Tom Kilburn)和圖希爾(Geoff Toothill)做了一台小機器,用來測試一種新的記憶體。它的正式名稱是「小型實驗機」,但大家比較常叫它「曼徹斯特 Baby」。它的第一個程式是基爾本寫的,一共十七條指令,在 1948 年 6 月 21 日執行。電腦歷史博物館說,這是史上第一個在數位、電子、儲存程式的電腦上執行的程式。
GHz · 時脈
The speed printed on a processor’s box is its clock speed. One gigahertz is one billion cycles per second, so 3.2 GHz is 3.2 billion cycles every second. During each cycle, billions of transistors inside the processor open and close. Older processors were measured in megahertz, or millions of cycles per second. Intel points out that clock speed is only one thing to look at: the number of cores matters, too.
處理器包裝盒上印的那個速度,是它的時脈頻率。1 GHz 是每秒十億個週期,所以 3.2 GHz 就是每秒 32 億個週期。每一個週期裡,處理器裡面有幾十億個電晶體在開和關。比較早的處理器是用 MHz 來算的,也就是每秒幾百萬個週期。英特爾提醒,時脈只是該看的其中一項,核心的數目也很重要。
0 … 7
In Lesson 2 you learned that bits do not say what they are. The same is true here. The processor never checks whether a cell is “meant” to be an instruction. Whatever the counter points to, it tries to obey. In the model, if the counter reaches a cell with a number or nothing in it, the processor has to stop. Try it in the activity above by leaving out STOP. Keeping the counter away from the data is the programmer’s job.
第二課說過,位元自己不會說它是什麼。這裡也是一樣。處理器從來不會檢查某一格「本來是不是」指令:計數器指到哪一格,它就想照那一格做。在模型裡,如果計數器走到一格放的是數、或什麼都沒有,處理器就只好停下來。在上面的活動裡故意不放 STOP,就能看到這件事。不讓計數器闖進資料裡,是寫程式的人的責任。
Myth vs. Fact · 常見迷思
✗ Myth · 迷思A processor does big, complicated things in one go.處理器一次就能做很大、很複雜的事。
✓ Fact · 事實Each instruction is tiny: copy one number, add two numbers, change the counter. Big jobs are long lists of tiny steps, done very fast.每條指令都很小:抄一個數、把兩個數加起來、改一下計數器。大事情是一長串的小步驟,只是做得非常快。
✗ Myth · 迷思A 3 GHz processor carries out exactly 3 billion instructions a second.3 GHz 的處理器每秒剛好執行 30 億條指令。
✓ Fact · 事實Gigahertz counts clock cycles, not instructions. Some instructions take several cycles, and sometimes several instructions finish in one cycle.GHz 數的是時脈的週期,不是指令。有的指令要好幾個週期,有時候一個週期可以做完好幾條。
✗ Myth · 迷思The processor understands the program it is running.處理器懂它正在跑的程式是在做什麼。
✓ Fact · 事實It has no idea whether it is running a game or doing your homework. It only fetches the next instruction and does what that one instruction says.它完全不知道自己是在跑遊戲還是在算你的作業。它只是拿下一條指令,照那一條說的做。
✗ Myth · 迷思A program always runs from the first line to the last, once.程式一定是從第一行跑到最後一行,跑一次就結束。
✓ Fact · 事實A jump can send the processor back to repeat instructions, thousands or millions of times. Most of what a processor does all day is repeating.跳躍指令可以把處理器送回去,把同樣幾條指令重複幾千次、幾百萬次。處理器整天在做的,大部分就是重複。
Remember It · 記憶口訣
Three small steps, over and over.
三個小步驟,一再重複。
It goes up by one after each instruction.
每做完一條指令,它就加一。
Change the counter, and the processor repeats.
把計數器改掉,處理器就重來一遍。
1 GHz is one billion clock cycles a second.
1 GHz 是每秒十億個時脈週期。
Before You Start · 動手之前
Classroom Activity 1 · 課堂活動一
You need · 準備材料
Steps · 步驟
With the two cards swapped, sheet 7 ends up with 3, not 7. The processor student did nothing wrong. The order of the instructions was wrong, and the processor obeyed it anyway. In Taiwan’s junior high Information Technology curriculum, this lesson matches the topic “System platforms”: 資 S-IV-2, whose notes list the CPU and memory.
兩張卡片對調之後,第 7 張紙上會是 3,不是 7。當處理器的同學並沒有做錯:錯的是指令的順序,而處理器照樣照著做了。對照十二年國教國中「資訊科技」的學習內容,這一課對應「系統平台」主題:資 S-IV-2 系統平台之組成架構與基本運作原理(附錄的說明列有 CPU、記憶體)。
Classroom Activity 2 · 課堂活動二
You need · 準備材料
Steps · 步驟
Apple’s guide says that most of the time, the processor uses only a small percentage of its processing power. So what does a processor do all day? Much of the time it is waiting for something to do. When you ask for something that needs heavy calculation, it gets busy. The names of menus differ a little between versions of Windows and macOS.
Apple 的說明寫道,大部分的時候,處理器只用到它運算能力的一小部分。所以處理器整天在忙什麼?很多時候,它其實在等事情做;等你要它做需要大量計算的事,它才忙起來。不同版本的 Windows 和 macOS,選單的名稱會略有不同。
Go Further · 延伸閱讀
Sources · 資料出處
Names, dates, and facts on this page were checked against these sources (October 2026); the model’s processor is our own design, and its simulator is tested · 本頁的人名、年代與事實依下列資料查證(2026 年 10 月);模型裡的處理器是我們自己設計的,模擬器有測試