A picture is made of squares圖是一格一格拼成的
From far away you see an apple. Walk up to the wall and count how the picture turns into squares.
遠遠看是一顆蘋果。走近這面牆,看圖怎麼變成一格一格的方塊。
How Computers Work · Unit 1 · Lesson 2 · 電腦概論 單元一 第二課
Walk up to a wall of pixels in 3D, read the three numbers behind one colored square, and change its color with the eight switches from Lesson 1. Type a character to see its number, draw a picture with 64 bits, and turn a sound wave into a list of numbers.
在 3D 裡走近一面像素牆,讀出一個彩色方塊背後的三個數,再用第一課的八個開關改它的顏色。打一個字看它的編號、用 64 個位元畫一張圖,再把一段聲波變成一串數。
Bits can only make numbers. To turn numbers into words, pictures, and sound, people agree on codes: tables that say which number stands for which letter, which color, or how high a sound wave is. The same bits mean different things under different codes.
位元只能組成數。要把數變成文字、圖片和聲音,靠的是大家約好的「編碼」:一張對照表,規定哪個數代表哪個字、哪個顏色,或聲波有多高。同樣的位元,照不同的表來讀,意思就不一樣。
3D Model · 3D 模型
The wall is a picture made of 256 squares, called pixels. Tap any square to pick it. The three bars show the three numbers that make its color: how much red, green, and blue, each from 0 to 255. The eight switches in front are the ones from Lesson 1, and they hold one of those numbers. Flip a switch and the pixel changes color. Use Far and Close to see the wall as a picture or as squares.
這面牆是一張由 256 個方塊拼成的圖,每個方塊叫做一個像素。點任何一個方塊就選到它。三根柱子是組成它顏色的三個數:紅、綠、藍各有多少,各從 0 到 255。前面的八個開關就是第一課那八個,存著其中一個數;撥一個開關,像素的顏色就跟著變。按「遠看」和「近看」,看看這面牆什麼時候像一張圖、什麼時候是一格一格的方塊。
Tap a square, a bar, or a switch · 點方塊、柱子或開關 Drag to turn · 拖曳旋轉
This 3D model needs WebGL, which this browser does not support. The small picture, the sliders, and the switch buttons below still work, and so do the reading and the activities.
這個瀏覽器不支援 WebGL,無法顯示 3D 模型;下面的小圖、滑桿和開關按鈕照樣能用,課文和活動也都能用。
This picture: 16 × 16 = 256 pixels × 3 numbers × 8 bits = 6,144 bits (768 bytes).這張圖:16 × 16=256 個像素 × 3 個數 × 8 個位元=6,144 個位元(768 個位元組)。
A teaching model. The picture is tiny on purpose: 256 pixels, where a phone screen has millions. A real pixel is not a painted square; on a screen, each pixel is made of three small dots that give off red, green, and blue light, and the numbers set how brightly each one glows. The bars and switches are drawings that show the numbers; inside a computer they are bits in memory. The arithmetic is exact, and the colors are the ones a web browser shows for the same three numbers.
這是教學用的示意模型。圖故意做得很小:只有 256 個像素,手機螢幕則有幾百萬個。真正的像素不是塗上顏色的方塊;在螢幕上,每個像素由三個會發出紅、綠、藍光的小點組成,那三個數決定每個小點多亮。柱子和開關是把數畫出來的示意,在電腦裡它們是記憶體裡的位元。算術是精確的,顏色也就是瀏覽器遇到同樣三個數時顯示的顏色。
Model, picture, and code are drawn and programmed by My Culture Connect. The codes and counts are tested in tools/computers/test/codes.test.mjs.
模型、圖與程式由人師教育協會自行繪製、撰寫;編號與數量有自動測試(tools/computers/test/codes.test.mjs)。
Reading · 英文閱讀
In Lesson 1, a row of switches could show a number, and nothing else. But a computer shows you words and photos, and it plays music. How can numbers do all that? The answer is an agreement. People decide that a certain number will stand for a certain thing, and they write the agreement down in a table. Such a table is called a code. Once everyone uses the same code, any computer can turn numbers back into the same letters, colors, and sounds.
Start with letters. In 1963, American computer makers agreed on a code called ASCII. It uses seven bits, so it has room for 128 characters: the English letters, the digits, punctuation marks, and a few signals for machines. In ASCII, the capital letter A is number 65, B is 66, and a lowercase a is 97. When you press A on a keyboard, the computer does not store the shape of the letter. It stores 65, which in bits is 1000001.
But 128 characters are not enough for the world. For years, different places made their own codes, and the same number could mean different characters on different computers. Text opened with the wrong code turned into nonsense. Unicode fixes this with one giant table for every writing system. The 2026 version, Unicode 18.0, lists 172,808 characters. The Chinese character 永 is number 27,704, usually written U+6C38. Most web pages store these numbers with a method called UTF-8, which uses one byte for an English letter and three bytes for a common Chinese character such as 永.
Pictures work the same way. A picture on a screen is a grid of tiny squares called pixels, and each pixel has just one color. That color is stored as three numbers: how much red, how much green, and how much blue. Each number usually gets one byte, so it runs from 0 to 255. Red 255, green 0, blue 0 is pure red. Three bytes give 16,777,216 possible colors. A photo 4,000 pixels wide and 3,000 pixels tall has 12 million pixels, so before any shrinking it needs 36 million bytes.
Sound becomes numbers, too. A microphone turns sound into an electrical wave that rises and falls. A computer measures the height of that wave again and again, at equal steps of time, and writes down each measurement as a number. This is called sampling. For a music CD, the wave is measured 44,100 times every second, and each measurement is a 16-bit number. To play the music, the computer reads the numbers back in order and a speaker rebuilds the wave.
Here is the surprising part: the bits themselves do not say what they are. The eight bits 01000001 can be the number 65, the letter A, or a dim shade of red. Nothing in the bits tells you which. The meaning comes from the code that the computer uses to read them. That is why a photo opened as if it were text looks like nonsense. Everything in a computer is numbers, plus an agreement about what the numbers mean.
Questions · 閱讀理解
What is a code, and why does everyone need to use the same one?
How is the color of one pixel stored?
The bits 01000001 can mean 65, the letter A, or a shade of red. How does a computer know which one is meant?
Words & Phrases · 生字及片語
Quick Check · 小測驗
1. In ASCII, which number stands for the capital letter A?
2. Why was Unicode needed?
3. Which three numbers are stored for the color of one pixel?
4. What does a computer do when it samples a sound?
5. According to the reading, what gives a row of bits its meaning?
Try It in the Model · 在模型裡試試
Then make your own color: pick a pixel and try to turn it yellow. Which two of the three numbers have to be high?
接著自己調一個顏色:選一個像素,試著把它變成黃色。三個數裡面,哪兩個要很大?
From far away you see an apple. Walk up to the wall and count how the picture turns into squares.
遠遠看是一顆蘋果。走近這面牆,看圖怎麼變成一格一格的方塊。
Read the three numbers of a red pixel on the apple, then of a green pixel on the leaf.
先讀蘋果上一個紅色像素的三個數,再讀葉子上一個綠色像素的。
The switches from Lesson 1 turn all the way off, then all the way on. Watch the pixel.
第一課的開關先全部關掉,再全部打開。看那個像素怎麼變。
Set the switches to 0100 0001 and read them as a number, as a letter, and as a color.
把開關設成 0100 0001,分別當成數、當成字、當成顏色來讀。
Try It · 動手試試
Type anything: English, Chinese, or an emoji. For each character you will see its number in the Unicode table and the bytes that a web page stores for it in UTF-8.
隨便打:英文、中文或表情符號都可以。每個字都會列出它在 Unicode 表上的編號,以及網頁用 UTF-8 存它的時候用到的位元組。
Try It · 動手試試
The simplest picture has only two colors, so each pixel needs just one bit: 1 for dark, 0 for light. Tap or drag on the grid to draw. Each row of eight squares is one byte, so the whole picture is eight numbers.
最簡單的圖只有兩種顏色,所以每個像素只要一個位元:1 是深色,0 是淺色。在格子上點或拖曳來畫。每一列八格就是一個位元組,所以整張圖就是八個數。
Each row is one byte · 每一列是一個位元組
See How · 看看怎麼做
The smooth line is one wave of sound. The computer measures its height at equal steps and keeps only the numbers. Slide to measure more often, and choose how many bits each measurement gets. Watch the steps get closer to the wave.
那條平滑的線是聲音的一個波。電腦每隔一段相等的時間量一次它的高度,只把數留下來。拉滑桿讓它量得更密,再選每一次用幾個位元來記。看那些階梯怎麼越來越貼近原來的波。
Bits for each measurement · 每次用幾個位元記
The numbers that are saved · 存下來的數
This is an illustration; the wave is drawn, not recorded. The sounds people can hear have up to about 20,000 waves every second, which is why a CD takes 44,100 measurements a second. At 16 bits each, that is 705,600 bits for every second of sound.這是示意,這條波是畫出來的,不是錄下來的。人聽得到的聲音,每秒最多大約有兩萬個波,所以 CD 每秒要量 44,100 次。每次 16 個位元,每一秒的聲音就是 705,600 個位元。
Stories Behind the Codes · 編碼的故事
Four short stories about the agreements behind your screen and speakers.
螢幕和喇叭背後的四個「約定」。
1963 · ASCII
Before ASCII, each computer maker represented letters and digits in its own way; IBM alone used nine different character sets. A committee of computer makers worked out a common code, and ASCII was approved as the American standard on June 17, 1963. The name stands for American Standard Code for Information Interchange. With seven bits it has 128 codes: 1010000 is a capital P, and 1110000 is a lowercase p.
在 ASCII 之前,每家電腦廠商各用各的方法表示字母和數字,光是 IBM 一家就用了九套不同的字元集。電腦廠商組成的委員會訂出一套共同的編碼,1963 年 6 月 17 日,ASCII 獲准成為美國標準。ASCII 是 American Standard Code for Information Interchange(美國資訊交換標準碼)的縮寫。它用七個位元,有 128 個編號:1010000 是大寫的 P,1110000 是小寫的 p。
Unicode · 萬國碼
Unicode gives every character a number of its own, whatever the language. The table keeps growing: version 18.0, released on September 16, 2026, added 13,007 characters for a total of 172,808. The way most web pages store those numbers, UTF-8, was designed by Ken Thompson. His colleague Rob Pike recalled that it happened “on a placemat in a New Jersey diner one night in September or so 1992.”
不管是哪一種語言,Unicode 都給每個字元一個自己的編號。這張表一直在長大:2026 年 9 月 16 日發布的 18.0 版新增 13,007 個字元,總共 172,808 個。大多數網頁存這些編號的方法 UTF-8,是肯・湯普遜(Ken Thompson)設計的。他的同事羅布・派克(Rob Pike)回憶,那是「1992 年 9 月左右的一個晚上,在紐澤西一家小餐館的餐墊紙上」寫出來的。
RGB · 三原色光
A screen makes colors by adding light. Look at a screen through a magnifying glass and you will see that each pixel is made of three small dots: one gives off red light, one green, and one blue. Red and green light together look yellow, and all three together look white. With one byte for each of the three, there are 256 × 256 × 256 = 16,777,216 possible colors.
螢幕是用「把光加在一起」的方法做出顏色的。用放大鏡看螢幕,會看到每個像素由三個小點組成:一個發紅光,一個發綠光,一個發藍光。紅光加綠光看起來是黃色,三種光全開看起來是白色。三個小點各用一個位元組,就有 256 × 256 × 256=16,777,216 種可能的顏色。
1982 · CD
The compact disc was invented together by Philips and Sony and went on sale in 1982. It was how most people first owned music stored as numbers. People can hear sounds up to about 20,000 waves a second, and to catch a wave you must measure it at least twice. So a CD samples a little more than twice that fast: 44,100 times a second.
CD(光碟)由飛利浦和索尼共同發明,1982 年上市。對大多數人來說,這是第一次擁有「存成數字」的音樂。人最高大約能聽到每秒兩萬個波的聲音,而要抓住一個波,至少得量它兩次。所以 CD 取樣的速度比兩倍再快一點:每秒 44,100 次。
Myth vs. Fact · 常見迷思
✗ Myth · 迷思A computer stores the letter A as a tiny picture of an A.電腦把字母 A 存成一個小小的 A 的圖。
✓ Fact · 事實It stores a number, 65. The shape you see comes from a font, which is a separate file that tells the screen how to draw each numbered character.它存的是一個數:65。你看到的形狀來自「字型」,那是另一個檔案,告訴螢幕每個編號的字要怎麼畫。
✗ Myth · 迷思A row of bits knows whether it is a letter, a color, or a sound.一排位元自己知道它是字、是顏色,還是聲音。
✓ Fact · 事實It does not. 01000001 is 65, or A, or a shade of red, depending on the code used to read it. Open a file with the wrong code and you get nonsense.它不知道。01000001 是 65、是 A、還是某種紅,要看用哪一套編碼去讀。用錯編碼打開檔案,看到的就是亂碼。
✗ Myth · 迷思An emoji is a small picture that is sent to your friend.表情符號是一張小圖,傳給了朋友。
✓ Fact · 事實An emoji is a character with a number in Unicode, like a letter. Only the number is sent. Each phone or computer maker draws its own picture for that number, so the same emoji can look different on a friend’s screen.表情符號和字母一樣,是 Unicode 裡有編號的字元。傳出去的只有編號;每家手機或電腦廠商各自替這個編號畫圖,所以同一個表情符號在朋友的螢幕上可能長得不一樣。
✗ Myth · 迷思The character “5” and the number 5 are the same thing to a computer.對電腦來說,字元「5」和數 5 是同一個東西。
✓ Fact · 事實The character “5” is stored as number 53. A program has to convert the character into the number 5 before it can do arithmetic with it.字元「5」存起來是 53 號。程式要先把這個字元轉成數 5,才能拿它來計算。
Remember It · 記憶口訣
Bits make numbers. A code says what the numbers mean.
位元組成數;編碼規定這些數代表什麼。
A letter is stored as its number in a table, not as its shape.
字存的是它在表上的編號,不是它的形狀。
One pixel, three numbers, each from 0 to 255.
一個像素、三個數,每個數從 0 到 255。
Sound is a wave measured many times a second: 44,100 times on a CD.
聲音是每秒量很多次的一條波:CD 每秒量 44,100 次。
Before You Start · 動手之前
Classroom Activity 1 · 課堂活動一
You need · 準備材料
Steps · 步驟
Then ask: what if one pair had used a different table, with A = 1? The same bits would spell a different word, or nothing at all. That is what happens when a file is opened with the wrong code. In Taiwan’s junior high Information Technology curriculum, this lesson fits “Data representation, processing, and analysis” (資 D-IV-1 and 資 D-IV-2; the notes list sampling and the idea of encoding).
接著問:如果有一組用的是另一張表(A=1),會怎樣?同樣的位元會拼出另一個字,或者什麼都不是。這就是用錯編碼打開檔案時發生的事。對照十二年國教國中「資訊科技」的學習內容,這一課屬於「資料表示、處理及分析」(資 D-IV-1、資 D-IV-2;附錄的說明列有「取樣、量化」與「編碼的概念」)。
Classroom Activity 2 · 課堂活動二
You need · 準備材料
Steps · 步驟
A color written as #d62828 is the same three numbers in another form: d6 is 214, 28 is 40, and 28 is 40. That is the red of the apple in the model. Web developers read these numbers every day. In Safari you must first turn on the developer tools in Settings, and menu names differ a little between browsers.
寫成 #d62828 的顏色,是同樣三個數的另一種寫法:d6 是 214,28 是 40,28 是 40——就是模型裡蘋果的紅。寫網站的人每天都在讀這些數。Safari 要先在設定裡打開開發人員工具;各家瀏覽器的選單名稱略有不同。
Go Further · 延伸閱讀
Sources · 資料出處
Names, dates, and facts on this page were checked against these sources (October 2026); the numbers in the model are computed and tested · 本頁的人名、年代與事實依下列資料查證(2026 年 10 月);模型裡的數字是自己算的,並有測試