One switch, two states一個開關,兩種狀態
Watch the rightmost switch flip off, on, off, on. That is everything one bit can say.
看最右邊的開關關、開、關、開。一個位元能說的就這麼多。
How Computers Work · Unit 1 · Lesson 1 · 電腦概論 單元一 第一課
Flip eight switches in 3D and watch a row of light bulbs count from 0 to 255. Count to 31 on one hand, read numbers written in lights, and see why on and off are so hard to mix up.
在 3D 裡撥八個開關,看一排燈泡從 0 數到 255。用一隻手數到 31、讀出用燈寫的數字,再看看為什麼「開」和「關」最不容易弄錯。
A computer is built from switches that are either off (0) or on (1). Two states are the hardest to mix up, and a row of switches can still count to very large numbers, because each switch is worth twice the one to its right.
電腦是用開關做成的,每個開關不是關(0)就是開(1)。兩種狀態最不容易弄錯;而一排開關照樣能數到很大的數,因為每個開關代表的數都是右邊那一個的兩倍。
3D Model · 3D 模型
Tap any switch to flip it, and its light turns on or off. The switch on the far right is worth 1, and each one to the left is worth double: 2, 4, 8, and on up to 128. The panel adds up the lights that are on. Press +1 to add one, or Count up to keep adding, and watch the carry jump from right to left like falling dominoes.
點任何一個開關把它撥過去,它的燈就亮或滅。最右邊的開關代表 1,往左每一個加倍:2、4、8,一直到 128。右邊會把亮著的燈加起來。按「+1」加一,或按「往上數」一直加,看進位像骨牌一樣從右往左跳過去。
Tap a switch · 點一下開關 Drag to turn · 拖曳旋轉 Scroll or pinch to zoom · 滾輪/雙指縮放
This 3D model needs WebGL, which this browser does not support. The row of switch buttons below still works, and so do the reading, the cards, and the games.
這個瀏覽器不支援 WebGL,無法顯示 3D 模型;下面那一排開關按鈕照樣能用,課文、卡片和小遊戲也都能用。
A teaching model. A real computer has no light bulbs and nobody flips its switches by hand: the switches are transistors on a chip, far too small to see, and they are turned on and off by electricity. The carry is slowed down here so that you can watch it. The numbers are exact: eight switches show every whole number from 0 to 255.
這是教學用的示意模型。真的電腦裡沒有燈泡,也沒有人用手去撥開關:那些開關是晶片上的電晶體,小到看不見,由電來控制開和關。這裡把進位放慢了,好讓你看得見。數字是精確的:八個開關可以表示 0 到 255 的每一個整數。
Model and code are drawn and programmed by My Culture Connect. The counting rules are tested in tools/computers/test/bits.test.mjs.
模型與程式由人師教育協會自行繪製、撰寫;數數的規則有自動測試(tools/computers/test/bits.test.mjs)。
Reading · 英文閱讀
Your phone or computer can show photos, play songs, and send messages around the world. But if you could look deep inside its chips, you would not find any pictures, sounds, or letters. You would find switches: billions of them on a single chip, each one far too small to see. Every switch can be in only one of two states, off or on. We write off as 0 and on as 1. Everything a computer does, from games to video calls, is built out of these two digits.
One switch holds the smallest piece of information there is: a single 0 or 1. It is called a bit, which is short for “binary digit.” Binary means “made of two parts.” The mathematician John Tukey suggested the word, and Claude Shannon used it in 1948 in a famous paper about sending messages. One bit cannot say much. It can answer only one yes-or-no question: Is the light on? Is the door open?
A row of bits can say much more. Think about how we normally count. We have ten digits, 0 to 9. When we run out, we carry into a new place, and each place is worth ten times the one to its right: ones, tens, hundreds. Binary works the same way with only two digits, so each place is worth two times the one to its right: 1, 2, 4, 8, 16, and so on. To read a row of switches, add up the places that are on. The row 1101 means 8 + 4 + 1, which is 13.
Counting up is simple, too. To add one, flip the switch on the far right. If it was off, it turns on, and you are done. If it was already on, it turns off and passes a carry to the switch on its left, which does the same thing. The carry can run down the row like falling dominoes: 0111 is 7, and one more makes 1000, which is 8. With eight switches you can count from 0 to 255. Eight bits together are called a byte. Every switch you add doubles how far you can count.
Why two states and not ten? A computer could try to use ten levels of voltage, one for each digit. But electrical signals are never perfectly steady. There is always a little unwanted wobble, called noise. With ten levels packed close together, a small wobble could make a 6 look like a 7. With only two levels, far apart, the signal has to change a lot before off could be mistaken for on. Engineers have tried other ways: ENIAC, an early American computer, counted in tens, and a Soviet computer called Setun used three states. Nearly every computer today uses two.
The idea is much older than computers. The German thinker Gottfried Leibniz had worked out binary numbers by 1679, and in 1703 he wrote an article explaining how to do arithmetic with only 0 and 1. In it he also described something a French missionary in Beijing, Joachim Bouvet, had noticed: the six-line figures in the ancient Chinese Book of Changes match binary numbers, if a whole line is read as 1 and a broken line as 0. Much later, as a student at MIT, Claude Shannon showed that circuits made of switches could carry out logic. Today those switches are transistors on a chip. They are tiny and fast, but each one still does what the lights in the model do: off or on, 0 or 1.
Questions · 閱讀理解
What is a bit, and what two values can it have?
How do you find the number that a row of switches shows?
Why is it safer for a computer to use two levels of electricity than ten?
Words & Phrases · 生字及片語
Quick Check · 小測驗
1. What is “bit” short for?
2. In a row of switches, the one on the far right is worth 1. What is the fourth switch from the right worth?
3. What number does the row 1101 show?
4. What is the largest number that eight switches can show?
5. According to the reading, why do computers use two states instead of ten?
Try It in the Model · 在模型裡試試
Then press Count up and let the row run. Which light changes every single time, and which one almost never does?
最後按「往上數」讓它自己跑。哪一盞燈每一次都在變?哪一盞幾乎不動?
Watch the rightmost switch flip off, on, off, on. That is everything one bit can say.
看最右邊的開關關、開、關、開。一個位元能說的就這麼多。
One light at a time, from right to left. How much is each switch worth by itself?
由右往左,一次只亮一盞。每個開關自己代表多少?
Seven lights are on. Add one in slow motion and count how many switches have to move.
七盞燈亮著。用慢動作加一,數數看有幾個開關要動。
All eight on makes 255. What happens when you add one more and there is no ninth switch?
八個全開是 255。再加一,可是沒有第九個開關,會怎樣?
Try It · 動手試試
Counting the usual way, one hand gets you to 5. Counting in binary, each finger is a switch: the thumb is worth 1, then 2, 4, 8, and 16. Tap the fingers to raise or lower them. All five up is 16 + 8 + 4 + 2 + 1 = 31.
照平常的數法,一隻手只能數到 5。用二進位來數,每根手指就是一個開關:拇指代表 1,接著是 2、4、8、16。點手指把它舉起來或放下。五根全舉起來是 16+8+4+2+1=31。
A right hand with the palm facing you: the thumb, worth 1, is on the right, just like the row of lights.右手,手心朝自己:代表 1 的拇指在右邊,和那一排燈一樣。
Your hand shows · 你的手比的是
0
0
In binary · 二進位寫法 00000
Challenge · 挑戰
Show the number 19 · 比出這個數
Game · 小遊戲
Eight rows of lights, from four lights up to eight. Choose the number each row shows. The game counts how many you get right on the first try.
八排燈,從四盞到八盞。選出每一排代表的數;遊戲會記下你第一次就答對幾題。
Right on the first try · 第一次就答對 0 / 0
See Why · 看看為什麼
Imagine sending the digits 0 to 9 as ten levels of brightness, and sending 0 and 1 as just off and on. Each dot is one signal after a little random noise has pushed it left or right. A signal is read as whichever level it lands closest to. Slide the noise up and compare.
想像用十段亮度來送 0 到 9,另一邊只用關和開來送 0 和 1。每個點是一個訊號,被一點隨機的雜訊往左或往右推了一下;它落在離哪一段最近,就被讀成哪一段。把雜訊往上拉,比比看。
Ten levels of brightness, for the digits 0 to 9十段亮度,代表 0 到 9
Two levels: off and on兩段:關和開
This is an illustration, not a measurement of a real circuit. The noise here is random and evenly spread, and both rows get exactly the same noise. With ten levels, each level sits 1/18 of the full range (about 5.6%) from its border; with two levels, each sits one half (50%) away, nine times as far.這是示意,不是真實電路的量測。這裡的雜訊是均勻的隨機數,兩排受到的雜訊完全相同。十段時,每一段離界線是全幅的 1/18(約 5.6%);兩段時是一半(50%),是前者的九倍。
Stories Behind 0 and 1 · 0 和 1 的故事
Four short stories about where binary came from.
關於二進位從哪裡來的四個小故事。
A New Word · 一個新詞
In 1948 Claude Shannon, an engineer at Bell Labs, published “A Mathematical Theory of Communication.” In it he wrote that units of information measured in base 2 “may be called binary digits, or more briefly bits, a word suggested by J. W. Tukey.” Tukey was a statistician who worked with him. The next sentence of the paper could describe the model on this page: a device with two stable positions can store one bit.
1948 年,貝爾實驗室的工程師克勞德・夏農發表〈通訊的數學理論〉。他在文中寫道,以 2 為底來量資訊時,單位「可以叫做 binary digits,或更簡短地叫 bits,這個詞是 J. W. Tukey 建議的」。圖基是和他共事的統計學家。論文的下一句簡直就是在講這一頁的模型:一個有兩種穩定位置的裝置,可以存一個位元。
An Old Book · 一本古書
People often say that binary came from the Book of Changes (Yijing, or I Ching). The order was the other way around. Leibniz had worked out binary numbers by March 1679. In February 1701 he explained them in a letter to Joachim Bouvet, a Jesuit missionary in China. Bouvet wrote back from Beijing in November 1701 that the hexagrams matched Leibniz’s numbers, and sent a chart of all 64. In his 1703 article, Leibniz explained how to read them: a whole line means 1, and a broken line means 0. The article was printed in 1705.
常有人說二進位是從《易經》來的,其實先後順序正好相反。萊布尼茲在 1679 年 3 月就已經把二進位的數弄清楚了。1701 年 2 月,他寫信給在中國的耶穌會傳教士白晉(Joachim Bouvet),說明自己的二進位。白晉 1701 年 11 月從北京回信,說卦和萊布尼茲的數對得起來,還附上六十四卦的圖。萊布尼茲在 1703 年的文章裡說明怎麼讀:一條完整的線代表 1,一條斷開的線代表 0。這篇文章 1705 年印行。
Eight Bits · 八個位元
It was not always so. At first, a byte meant any short string of bits that made up one simple piece of information, such as a single character, and there were four-bit and six-bit bytes. In time the standard settled on eight. Eight bits give 256 patterns, so one byte can stand for a number from 0 to 255, exactly what the eight switches in the model show.
並不是一開始就這樣。起初,byte 指的是組成一小份資訊(例如一個字元)的一小串位元,有四個位元的,也有六個位元的;後來標準才定在八個。八個位元有 256 種排法,所以一個位元組可以代表 0 到 255 的一個數,正好就是模型裡那八個開關能表示的範圍。
Two Exceptions · 兩個例外
ENIAC, built at the University of Pennsylvania and formally dedicated on February 15, 1946, worked in base 10, not base 2. At Moscow State University, a small computer named Setun was finished in December 1958. It was built on three-valued logic instead of two, and about 50 were made before production stopped in 1965. Both machines worked. Two-state designs still became the standard.
在賓州大學建造、1946 年 2 月 15 日正式啟用的 ENIAC,用的是十進位,不是二進位。在莫斯科大學,一台叫 Setun 的小型電腦於 1958 年 12 月完成,它用的是三值邏輯而不是二值,一共造了大約 50 台,1965 年停產。這兩種機器都能運作,但後來成為標準的還是兩種狀態的設計。
Myth vs. Fact · 常見迷思
✗ Myth · 迷思There are tiny 0s and 1s written inside a computer.電腦裡面寫著一個一個小小的 0 和 1。
✓ Fact · 事實There are no numerals inside. 0 and 1 are our names for two states of a switch. In computer memory, for example, a 1 is a high voltage and a 0 is a low voltage.裡面沒有數字。0 和 1 是我們替開關的兩種狀態取的名字;以電腦的記憶體來說,1 是高電壓,0 是低電壓。
✗ Myth · 迷思With only 0 and 1, a computer can handle only small numbers.只有 0 和 1,電腦只能處理很小的數。
✓ Fact · 事實Every extra bit doubles the count. Eight bits reach 255, sixteen bits reach 65,535, and thirty-two bits give more than four billion patterns (4,294,967,296).每多一個位元,能數的範圍就加倍。8 個位元數到 255,16 個位元數到 65,535,32 個位元有四十多億種排法(4,294,967,296)。
✗ Myth · 迷思Binary is a different kind of math.二進位是另一種數學。
✓ Fact · 事實It is the same numbers, written a different way. Thirteen is still thirteen whether you write 13 or 1101, and adding works by the same rule: when a place is full, carry to the left.數還是同樣的數,只是寫法不同。十三不管寫成 13 還是 1101 都是十三;加法的規則也一樣:這一位滿了,就往左進位。
✗ Myth · 迷思Binary was copied from the Book of Changes.二進位是從《易經》抄來的。
✓ Fact · 事實Leibniz had worked out binary numbers by 1679. The link to the hexagrams was pointed out to him by Joachim Bouvet, in a letter written in Beijing in 1701 that reached him in 1703.萊布尼茲 1679 年就已經把二進位弄清楚了。卦和二進位的關聯,是白晉 1701 年從北京寫信告訴他的,信到 1703 年才收到。
Remember It · 記憶口訣
One switch, two states, one bit.
一個開關、兩種狀態,就是一個位元。
From the right: 1, 2, 4, 8, 16, 32, 64, 128.
從右邊數過來:1、2、4、8、16、32、64、128。
1101 is 8 + 4 + 1 = 13. Skip the places that are off.
1101 就是 8+4+1=13,沒亮的那一位跳過。
Five switches reach 31, eight reach 255, and ten reach 1,023.
五個開關數到 31,八個數到 255,十個數到 1,023。
Before You Start · 動手之前
Classroom Activity 1 · 課堂活動一
You need · 準備材料
Steps · 步驟
The tally should come out as 31, 15, 7, 3, and 1, from the 1 card to the 16 card: each place changes half as often as the one before it. Each student watches only one neighbor, and that is all a carry is. In Taiwan’s junior high Information Technology curriculum, this lesson fits the topic “Data representation, processing, and analysis” (learning content 資 D-IV-2, whose notes list binary data representation).
記下來應該是 31、15、7、3、1(從拿 1 的到拿 16 的):每一位變的次數大約是前一位的一半。每個人只要看一位鄰居,這就是進位。對照十二年國教國中「資訊科技」的學習內容,這一課屬於「資料表示、處理及分析」主題(資 D-IV-2 數位資料的表示方法;附錄的學習內容說明列有「二進位資料表示法」)。
Classroom Activity 2 · 課堂活動二
You need · 準備材料
Steps · 步驟
255 is eight 1s, and 256 is a 1 followed by eight 0s: the calculator has a ninth switch, and the model does not. For a second check, open any web browser’s developer console, type (13).toString(2), and press Enter. It answers “1101.” The names of the menus may differ a little in other versions of Windows and macOS.
255 是八個 1;256 是一個 1 後面接八個 0:計算機有第九個開關,模型沒有。還有第二種驗證法:打開任何瀏覽器的開發人員主控台,輸入 (13).toString(2) 再按 Enter,它會回答 "1101"。不同版本的 Windows 和 macOS,選單的名稱可能略有不同。
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 月);模型裡的數字是自己算的,並有測試