Tiān-náu

thumb
**Tiān-náu** () mā-hō **kè-sǹg-ki** (), sī 1 cho àn-chiàu chí-lēng (thêng-sek) chhau-chok chu-liāu ê ki-khì. Tāi-khài tī 1940-nî kàu 1945-nî sî, tē-1 tâi ū chhin-chhiūⁿ hiān-tāi tiān-náu ê sán-phín chiah hoat-piáu, sui-jiân chìn-chêng í-keng ū chi̍t-koá-á khài-liām-sèng ê sán-phín. Hit-sî-chūn ê tiān-náu chin toā chiah, chiⁿ kah chi̍t-keng toā pâng-keng boán-boán, chia̍h-ê tiān sī hiān-tāi kò-jîn tiān-náu ê kúi pah poē. Hiān-tāi ê tiān-náu in-ūi ū chek-thé tiān-lō͘, m̄-chiah ē-thang piàn sè-chiah, kong-lêng mā cheng-ka kúi pah-bān poē. Taⁿ, kán-tan ê tiān-náu ē-sái khǹg ji̍p chhiú-pió, chia̍h ê tiān iōng chhiú-pió ê tiān-tî tio̍h ē-sái-tit. Kóng-tio̍h tiān-náu, ta̍k-ke siūⁿ tio̍h chiū sī kò-jîn tiān-náu, kî-si̍t chiâⁿ phó͘-phiàn hông sú-iōng ê sī khàm-ji̍p-sek tiān-náu, he sī iōng lâi khòng-chè kî-thaⁿ-ê mi̍h-kiāⁿ, chiâⁿ-chē sī tī ki-hâi lāi-té. Phì-jû-kóng tī chiàn-tàu hui-hêng-ki, kang-gia̍p ki-khì-lâng, tiān-chú hip-siòng-ki, gín-á sńg-mi̍h.

In-ūi tiān-náu ū-hoat-tō͘ thú-chûn jî-chhiáⁿ chip-hêng chí-lēng (thêng-sek), só͘-í kong-lêng chē-chē khoán, che mā sī i kap kè-sǹg-ki ê hun-pia̍t. "Church-Turing Lūn-tê (Church-Turing thesis)" tio̍h sī teh piáu-ta̍t tiān-náu to-kong-lêng ê chi̍t-ê sò͘-ha̍k lūn-tiám: chi̍t-chiah sè-chiah tiān-náu nā ū chi̍t-koá-á siōng ki-pún ê kong-lêng, goân-chek-siōng tio̍h ē-tàng chò kî-thaⁿ jīm-hô chi̍t-tâi tiān-náu só͘ ē-tàng chò ē khang-khoè. Ia̍h tio̍h-sī kóng, chí-iàu sî-kan kap thú-chûn khong-kan ū kàu, chhiūⁿ kò-jîn sò͘-ūi chō͘-lí iōng ê sè-chiah tiān-náu mā ū-hoat-tō͘ chò chi̍t-tâi chhiau-kip tiān-náu chò ê khang-khoè.

## Tiān-náu ê Le̍k-sú
Tó-chi̍t-tâi ke-khì sī siōng chá ê tiān-náu si̍t-chāi chin pháiⁿ kóng, in-ūi tiān-náu i ê Eng-bûn Computer í-chêng ê ì-gī sī sûi sî-tāi lâi ián-piàn, pún-lâi sī kóng choan-bûn hū-chek sǹg-siàu ê lâng, i chhiú-thâu ū chi̍t-kóa kè-sǹg-khì lâi hú-chō͘, chit-khoán lâng hō͘ lâng kiò-chò kè-sǹg-chiá.

Hiān-tāi tiān-náu ê khai-sí sī in-ūi 2-hāng ki-su̍t: chū-tōng kè-sǹg kah khó-thêng-sek-hòa.

Chá-kî ê kè-sǹg mi̍h-kiāⁿ phì-jū-kóng ū sǹg-pôaⁿ, kè-sǹg-chhioh, chheⁿ-pôaⁿ (astrolabe), Antikythera ki-khì (Antikythera mechanism), Hi-lia̍p lâng Hero of Alexandria siat-kè liáu chi̍t-ê ki-khì-hòa ê hì-īⁿ, iōng soh-á, phah-kat chham khí-lûn ē-sái liân ián 10-hun-cheng, chit-chióng siáⁿ-mih sî-chūn ài iōng siáⁿ-mih hong-hoat lâi chò, tio̍h sī thêng-sek-hòa ê pún-chit.

Tī 1206 nî iû A-lá-pek-lâng Al-Jazari hoat-bêng ê thian-bûn-cheng ē-sái kóng sī chiâⁿ chá ê lūi-pí-sek tiān-náu, chit tâi ē-sái hián-sī N̂g-tō, ji̍t-thâu kah goe̍h-niû ê kúi-tō, ū chiam ē tín-tāng, chi̍t ê chū-tōng-mn̂g múi tiám-cheng lâi phah-khui, ū 5-ê gô͘-lo̍k ki-khì-lâng ē piáu-ián im-ga̍k, he sī khò tio̍h liân-koáiⁿ, tu̍t-lûn, chúi-lûn ê liân-tōng, jî-chhiáⁿ sûi ji̍t-thâu chhut-lâi kah lo̍h-soaⁿ sî-kan ê kái-piàn, ji̍t-sî kah àm-sî ê tn̂g-tō͘ ē-sái ta̍k-kang lâi têng-sin siat-tēng.

15-sè-kí liáu-āu, Au-chiu-lâng tī ki-khì chham sò͘-ha̍k ū sin ê hoat-bêng, tī hit-tong-sî, hiah chē tâi iû Au-chiu-lâng kang-têng-su chò ê ki-hâi kè-sǹg-ki lāi-té, Tek-kok-lâng Wilhelm Schickard tī 1623 nî ê ki-hâi kè-sǹg-ki sǹg sī thâu-chi̍t-tâi khí pō͘, tān-sī bô chi̍t-tâi ha̍p hiān-tāi tiān-náu ê tēng-gī, lóng bô-hoat-tō͘ thêng-sek-hòa.

Tī 1801 nî, Hoat-kok-lâng Joseph Marie Jacquard tùi chit-pò͘-ki ū chi̍t-kóa kái-chìn, i iōng phah-khang ê chóa khah-phìⁿ lâi siat-tēng chit-pò͘-ki, hō͘ i chū-tōng lâi chit chhut ho̍k-cha̍p ê hoe-iūⁿ. Jacquard ê chit-pò͘-ki sī tiān-náu hoat-tián tiōng-iàu ê chi̍t pō͘, in-ūi sú-iōng phah-khang khah-phìⁿ siat-tēng chit-pò͘ hoe-iūⁿ, sui-jiân iú só͘ hān-chè, tān-sī che sī chi̍t-chióng thêng-sek-hòa.

Thâu-chi̍t-tâi ū chū-tōng kè-sǹg kah thêng-sek-hòa ê tiān-náu tī 1837 nî, Eng-kok-lâng Charles Babbage sī thâu-chi̍t-ê lâng, ū kài-liām pēng-chhiáⁿ siat-kè ē-tàng oân-choân thêng-sek-hòa ê ki-hâi-sek tiān-náu, Charles Babbage kiò i hun-sek-ki (Analytical Engine), tān-sī in-ūi keng-hùi kah bô-hoat-tō͘ kian-chhî lo̍h-khì siat-kè, Babbage si̍t-chè-siōng bô oân-sêng hun-sek-ki.

1890 nî ê Bí-kok jîn-kháu phó͘-cha, sī thâu-chi̍t-ê tōa-liōng sú-iōng phah-khang khah-phìⁿ lâi chū-tōng chhú-lí chu-liāu, sī iû bí-kok CTR (Computing Tabulating Recording Corporation) kong-si ê Herman Hollerith siat-kè ê chè-piáu ki-khì, CTR kong-si sī āu--lâi ê IBM kong-si. Kàu 19-sè-kí bóe, chi̍t-kóa-á ki-su̍t ê chhut-hiān, phì-jū phah-khang khah-phìⁿ, lô-chi̍p tāi-sò͘, tiān-lī-chú chin-khong-koán, tiān-pò-ki, khak-si̍t hō͘ tiān-náu lâi khai-sí si̍t-hiān.

Tī 20-sè-kí chêng-pòaⁿ-tōaⁿ, chin chē kho-ha̍k kè-sǹg chú-iàu óa-khò lūi-pí tiān-náu, he sī i-chiàu beh sǹg ê būn-tê, siat-kè ki-hâi-sek kah tiān-chú bô͘-hêng lâi chò kè-sǹg ê ki-chhó͘, tān-sī chia-ê lūi-pí tiān-náu bô-hoat-tō͘ thêng-sek-hòa, jî-chhiáⁿ kah hiān-tāi tiān-náu lâi pí, to-kong-lêng piàn-hòa chham cheng-tō͘ lóng khiàm-khoeh.

Kong-lêng kèng-ka hó jî-chhiáⁿ piàn-thong ê kè-sǹg chong-tì, sio-liân-sòa tī 1930 nî-tāi kàu 1940 nî-tāi lâi cho͘-chong, chiām-chiām ka-ji̍p hiān-tāi tiān-náu chiah ū ê te̍k-sek, sú-iōng sò͘-ūi tiān-chú (chú-iàu iû Claude Shannon tī 1937 nî lâi hoat-bêng) kah kèng-ka piàn-thong thêng-sek-hòa sī tiōng-iàu ê chìn-tián, tān-sī chin pháiⁿ kóng siáng sī thâu-chi̍t-tâi sò͘-ūi tiān-náu, chù-bo̍k ê sêng-chiū pau-koat:

* Konrad Zuse ê tiān-chú ki-hâi "Z Ki-hâi", Z3 (1941 nî) sī thâu-chi̍t-tâi sú-iōng jī-ūi-goân soàn-su̍t, pau-koat hû-tiám sǹg-su̍t í-ki̍p chi̍t-chióng thêng-sek-hòa ê hong-hoat, tī 1198-nî hō͘ lâng chèng-bêng ū Turing oân-chéng-sèng, só͘-í ē-sái kóng sī thâu-chi̍t-tâi ūn-chok ê tiān-náu.
* Bô thêng-sek-hòa ê Atanasoff–Berry Computer (1941 nî), sú-iōng chin-khong-koán, jī-chìn-ūi, tiān-iông kì-ek-thé.
* Eng-kok sîn-pì ê Colossus computers (1943 nî), ū hān-tō͘ ê thêng-sek-hòa lêng-le̍k, tān-sī soat-bêng kóng i sú-iōng chhiau-kòe 1-bān-ê chin-khong-koán, ē-sái ha̍p-lí thêng-tō͘ lâi têng-sin thêng-sek, chit tâi sī iōng-lâi phò-kái Jī-chhù Tāi-chiàn sî Tek-kok ê kun-sū bi̍t-bé ê.
* Harvard Mark I (1944 nî), chi̍t-tâi tōa-chiah ê tiān-chú ki-hâi tiān-náu, ū hān-tō͘ ê thêng-sek-hòa lêng-le̍k.
* Bí-kok kun-hong ê tân-tō gián-kiù si̍t-giām-sek ê ENIAC (1946 nî), sú-iōng si̍p-chìn-ūi soàn-su̍t, ū lâng kóng sī thâu-chi̍t-tâi m̄ sī te̍k-iōng kong-lêng ê tiān-chú tiān-náu (chū 1941 nî Konrad Zuse ê Z3, iōng tiān-chû tāi-thè tiān-chú), khí-seng in-ūi ENIAC kò͘-chō tō bô piàn-thong, si̍t-chè-siōng ài têng-siá chiah ē-tàng piàn i ê thêng-sek.

ENIAC ê hoat-tián-chiá jīn-ti tio̍h ki-khì ê khoat-tiám, só͘-í hoat-tián kèng-ka piàn-thong kah káng-kiù ê siat-kè, tio̍h sī kiò "ī-chûn thêng-sek kò͘-chō" ia̍h-sī "Von Neumann kò͘-chō". Chit-chióng siat-kè hong-sek sī iû John von Neumann tī 1945 nî ê chèng-sek pò-kò *First Draft of a Report on the EDVAC* lāi-té thê-chhut, kāng sî-kî, ū chin chē ê choan-àn hoat-tián tiān-náu iōng ī-chûn thêng-sek hong-sek, tē-it-ê oân-sêng sī tī Eng-kok, thâu-chi̍t-ê tián-sī ūn-chok ê sī Manchester sió-hêng si̍t-giām ke-khì, sī thâu-chi̍t-ê si̍t-chok ī-chûn thêng-sek ê siat-kè, ESDAC tī 1-nî āu mā oân-sêng, bô-gōa-kú liáu-āu, EDVAC mā oân-sêng, m̄-koh lēng-gōa nn̄g-ê á-bô-hoat-tō͘ kui-ji̍t sú-iōng.

Kiōng-beh, só͘-ū hiān-tāi tiān-náu lóng ū sú-iōng ī-chûn thêng-sek kò͘-chō ê hong-sek, hō͘ ī-chûn thêng-sek pìⁿ chò tiān-náu ê chi̍t-hāng te̍k-teng, sui-jiân tùi 1940 nî-tāi āu ê thâu-chi̍t-tâi tiān-chú, hui te̍k-pia̍t iōng-tô͘ ê tiān-chú tiān-náu liáu-āu, tiān-náu ê ki-su̍t pìⁿ leh chin kín, tān-sī tōa-pō͘-hūn iá-sī sú-iōng von Neumann kò͘-chō.

1950 nî-tāi tiān-náu sú-iōng chin-khong-koán chò tiān-chú lêng-kiāⁿ, kàu 1960 nî-tāi í-keng tōa-liōng hō͘ tiān-cheng-thé lâi chhú-tāi, in-ūi koh khah sè, khah kín, khah sio̍k, chia̍h tiān khah-chió jî-chhiáⁿ khó-khò, 1953 nî, thâu-chi̍t-tâi tiān-cheng-thé tiān-náu tī Eng-kok Manchester tāi-ha̍k hoat-piáu. Tī 1970-nî-tāi, chek-thé tiān-lō͘ ki-su̍t í-ki̍p sán-seng ê bî-chhú-lí-khì, pí-lūn-kóng Intel 4004, kā tiān-náu ê chhùn-chhioh, sêng-pún sok-sió chiâⁿ chē, jî-chhiáⁿ sok-tō͘ kèng-ka kín kah khó-khò. Kàu 1980 nî-tāi, tiān-náu í-keng ū-kàu sè jî-chhiáⁿ sio̍k, ē-sái chhú-tāi ka-iōng tiān-sán-phín lāi-té ê kán-tan ki-hâi khòng-chè, pí-lūn-kóng sé-saⁿ-ki. Kāng-khoán tī 1980 nî-tāi, ē-sái khòaⁿ-tio̍h ka-iōng tiān-náu kah hiān-chāi chin phó͘-phiàn ê kò-jîn tiān-náu, in-ūi bāng-chè bāng-lō͘ (Internet) ê hoat-tián, chhù-lāi ū kò-jîn tiān-náu í-keng kah ū tiān-sī, tiān-ōe sī kāng-khoán phó͘-phiàn. I ki-su̍t lâi khòaⁿ, chit-má kāng-khoán phó͘-phiàn ê tì-hūi-hêng chhiú-ki-á mā sǹg sī oân-choân thêng-sek-hòa ê tiān-náu.

## Ī-chûn Thêng-sek Kò͘-chō
Hiān-tāi tiān-náu kah pa̍t-khoán ki-hâi bô-kâng ê só͘-chāi tio̍h sī i ē-tàng lâi thêng-sek, iā tio̍h sī kóng ē-sái hō͘ tiān-náu chí-lēng (thêng-sek), tiān-náu ē seng pó-chûn--khí-lâi, pēng-chhiáⁿ tī bó͘ chi̍t-ê sî-kan lâi chip-hêng ūn-chok.

Tōa-pō͘-hūn ê chêng-hêng, tiān-náu chí-lēng sī kán-tan--ê: ke chi̍t-ê sò͘-jī, sóa khǹg chu-liāu ê só͘-chāi, sàng chi̍t-ê sìn-sit hō͘ lēng-gōa chong-tì téng-téng, chia-ê chí-lēng iû tiān-náu kì-ek-thé tha̍k-chhut liáu-āu, phó͘-thong àn-chiàu tong-chho͘ pó-chûn sūn-sī lâi chip-hêng, tān-sī mā ū te̍k-pia̍t chí-lēng, ē kiò tiān-náu thiàu-chêng ia̍h-sī thiàu-āu, seng khì chip-hêng pa̍t-ūi ê chí-lēng, chit-chióng kiò-chò thiàu-io̍k chí-lēng (ia̍h sī hun-kî), jî-chhiáⁿ thiàu-io̍k chí-lēng, ū ê sī chiàu pa̍t-ūi ê kè-sǹg kiat-kó, iah-sī in-ūi gōa-pō͘ sū-kiāⁿ, chiah phòaⁿ-toàn beh thiàu khì tó pō͘-hūn, só͘-í bô-kâng ê pō͘-hūn ū-khó-lêng hō͘ chip-hêng, chin chē tiān-náu thê-kiong chú-thêng-sek, he ē-kì-chit thiàu-io̍k chí-lēng sī tùi tó-ūi lâi, mā ē-sái iōng lēng-gōa ê chí-lēng hôe-choán jî-chhiáⁿ chip-hêng āu-chi̍t-ê chí-lēng.

Thêng-sek chip-hêng chhin-chhiūⁿ tha̍k chi̍t-pún chheh, lâng khòaⁿ-chheh ê sî sī chi̍t-chōa chi̍t-jī chiàu leh tha̍k, tān-sī mā ē thiàu tńg-khì thâu-chêng khòaⁿ, ia̍h-sī thiàu-kòe bô hèng-chhù ê só͘-chāi, kāng-khoán ah, tiān-náu mā ē thiàu-tó-tńg jî-chhiáⁿ têng chò chí-lēng, it-ti̍t kàu hû-ha̍p kiat-sok ê tiâu-kiāⁿ, che kiò-chò tiān-náu ê khòng-chè-liû, tiān-náu ē têng chò chí-lēng, bián lâng lo̍h-khì kan-sia̍p.

Lâi tùi-pí khòaⁿ, lâng ē sú-iōng kè-sǹg-ki, ji̍h kúi-ē-á tio̍h ē-sái chò kán-tan ê sǹg-su̍t, m̄-koh nā-sī beh 1 kàu 1000 ka--khí-lâi, tio̍h ài ji̍h chhian-gōa pái jî-chhiáⁿ gâu chha-chhò, ōaⁿ pa̍t chióng hong-hoat, tiān-náu ē-sái thêng-sek kúi-ê chí-lēng tio̍h chò-ē-kàu, pí-lūn-kóng:

            mov      #0,sum        ; set sum to 0
            mov      #1,num        ; set num to 1
 loop:   add       num,sum     ; add num to sum
            add       #1,num        ; add 1 to num
            cmp      num,#1000  ; compare num to 1000
            ble        loop             ; if num 1+2+3+...+n = {{n(n+1)} \over 2}

Kán-tan kúi pō͘ mā ū chèng-khak ê tap-àn (500,500), só͘-í-kóng bīn-téng ê tiān-náu thêng-sek, iōng chi̍t-piàn koh chi̍t-piàn ka-hoat ê lē, sī bô khó-lū ài ū hāu-lu̍t kah kî-thaⁿ hong-àn ê siá-hoat.

### Thêng-sek
Si̍t-chè-siōng, bûn-su chhú-lí-khì ia̍h-sī bāng-ia̍h liû-lám-khì lāi-té ê chi̍t-ki tiān-náu thêng-sek, ē-sái tùi kúi-tiâu chí-lēng kàu pah-bān-tiâu, hiān-tāi ê tiān-náu ē-sái 1-bió-cheng lāi chip-hêng cha̍p-kúi-ek ê chí-lēng, kui-nî thàng-thiⁿ ūn-chok koh hán leh chhò-gō͘, tān-sī tōa-chiah ê tiān-náu thêng-sek sī ha̍p kúi-nā-ê pah-bān tiâu chí-lēng, che sī khó-lêng ài thêng-sek siat-kè-su iōng kúi-nā-nî ê sî-kan lo̍h-khì siá, só͘-í, kui-ki thêng-sek kóng lóng bô chhò-gō͘ mā bô-siáⁿ khó-lêng.

Tiān-náu thêng-sek lāi-té ê chhò-gō͘ ū lâng ti̍t-chiap kiò i chò chhàu-thâng (Bug), chit-chiah chhàu-thâng khó-lêng khai-sí chip-hêng liáu-āu tùi thêng-sek ê kong-lêng pēng bô éng-hióng, ia̍h-sī bô-siáⁿ kám-kak ê éng-hióng, tān-sī ū chi̍t-kóa chêng-hóng sī ē hō͘ thêng-sek thêng--khí-lâi (hang), tùi jīm-hô su-ji̍p tōng-chok lóng bô hoán-èng, pí-lūn-kóng chhiú ji̍h ku̍t-chhí, kiān-pôaⁿ, mā ū liân hē-thóng kui-ê tòng-ki (Fail or Crash), iá-ū chêng-hóng sī ū-lâng siá chi̍t-tōaⁿ exploit thêng-sek lâi kò͘-ì ín-khí, ē hō͘ tiān-náu bô-thang chèng-siông ūn-chok. Kî-si̍t chhàu-thâng pēng m̄-sī tiān-náu ê kòe-sit, in-ūi tiān-náu chí-sī chiàu chí-lēng chip-hêng, chhàu-thâng kî-si̍t sī thêng-sek siat-kè-chiá siá-ê chhò-gō͘, iah-sī tī thêng-sek siat-kè khí-seng ê so͘-sit.

Tī tōa-pō͘-hūn ê tiān-náu, chí-lēng sī iōng ki-hâi-bé ê hong-sek chûn--khí-lâi, thâu-chêng sī chi̍t-ê hō-bé sò͘-jī (tāi-piáu ūn-soàn-goân), pí-lūn-kóng ka-hoat ê ūn-soàn-goân sī chi̍t-ê hō-bé, sêng-hoat-ê ūn-soàn-goân sī lēng-gōa chi̍t-ê hō-bé, kán-tan ê tiān-náu chí-ū kúi-ê-á ê chí-lēng, khah ho̍k-cha̍p ê tiān-náu ū pah-kúi ê, ta̍k-ê lóng ū chi̍t-ê hō-bé, in-ūi tiān-náu ē-sái pó-chûn sò͘-jī, só͘-í tio̍h piàn-chò ē-sái pó-chûn chí-lēng, che tio̍h sī chí-chhut chi̍t-ê tiōng-iàu ê sū-si̍t, kui-ki thêng-sek ē-sái iōng chi̍t-tui sò͘-jī lâi piáu-sī, jî-chhiáⁿ iōng chit-tui ê sò͘-jī lâi chhau-chok tiān-náu ê chu-liāu (chu-liāu mā-iōng sò͘-jī lâi-piáu-sī), tiān-náu ê ī-chûn thêng-sek iōng sò͘-jī piáu-sī ê ki-pún koan-liām sī von Neumann thê-chhut ê iàu-tiám. Pō͘-hūn ê tiān-náu chok-hoat sī kā thêng-sek pó-chûn tī kì-ek-thé, ū choân-pō͘ pó-chûn mā ū-pō͘-hūn pó-chûn, kah i beh ūn-sǹg ê chu-liāu hun-khui khǹg, chit-chióng sī Harvard Mark I tiān-náu ê Harvard kò͘-chō, hiān-tāi von Neumann sek tiān-náu ê siat-kè, mā ū chi̍t-kóa-á iōng-tio̍h Harvard kò͘-chō ê te̍k-tiám, pí-lūn-kóng tiong-iong chhú-lí-khì (CPU) ê khoài-chhú (caches).

Chá-kî khak-si̍t ū bē-chió tiān-náu iōng chi̍t-tui hō-bé sò͘-jī (hō-chò ki-hâi gí-giân) siá thêng-sek, tān-sī si̍t-chè-siōng án-ne siá ē chin-hoân kah bô-liâu, iû-kî sī ho̍k-cha̍p ê thêng-sek, āu--lâi tio̍h iōng kán-tan eng-gí-jī lâi tāi-thè mā khah hó kì, pí-lūn-kóng ADD (ke), SUB (kiám), MULT (sêng) ia̍h-sī JUMP (thiàu), chit-chióng kì-tî hong-hoat kiò-chò cho͘-ha̍p gí-giân (assembly language), kā lâng siá--chhut-lâi ê cho͘-ha̍p gí-giân choán-ōaⁿ chò tiān-náu bat ê ki-hâi gí-giân, hit-chiòng mi̍h-kiāⁿ kiò cho͘-ha̍p-khì (assembler). Ki-hâi gí-giân kah cho͘-ha̍p gí-giân (chit 2-chióng sī khah hā-kai-kip thêng-sek gí-giân) it-poaⁿ ū ka-kī sek-iōng ê tiān-náu, pí-lūn-kóng ARM kò͘-chō ê tiān-náu (PDA, khǹg-chhiú ê éng-im sńg-mi̍h), tio̍h bô-hoat-tō͘ liáu-kái Intel Pentium ia̍h-sī AMD  Athlon 64 siá tī kò jîn tiān-náu ê ki-hâi gí-giân.

Sui-jiân cho͘-ha̍p gí-giân pí ki-hâi gí-giân khah kán-tan, tān-sī nā beh siá tōa-ki ê thêng-sek, mā sī pháiⁿ siá koh ū khó-lêng siá m̄-tio̍h, só͘-í khah ho̍k-cha̍p tio̍h iōng kài-lūn-sek biâu-siá ê ko-kai-kip gí-giân lâi siá, che khah sek-ha̍p thêng-sek siat-kè-su ê hong-piān, sūn-sòa kiám-chió siat-kè-chiá ê chhò-gō͘. Ko-kai-kip gí-giân ài iōng lēng-gōa chi̍t ê thêng-sek lâi pian-siá chò ki-hâi gí-giân, chit-hāng mi̍h-kiāⁿ kiò-chò pian-e̍k-khì (Compiler), in-ūi ko-kai-kip thêng-sek gí-giân pí cho͘-ha̍p gí-giân khah kán-tan lâi biâu-siá, só͘-í ū khó-lêng iōng bô-kâng ê pian-e̍k-khì lâi hoan kâng ki ko-kai-kip thêng-sek, mā ē-sái hoan sêng bô-kâng hêng-sek ê tiān-náu ki-hâi gí-giân, ah chit-ê éng-im sńg mi̍h lāi-té ê thêng-sek, mā ē-sái iōng tī kok-chióng hêng-sek ê kò-jîn tiān-náu, chiong-toan-ki. It-poaⁿ kài-chheng tiān-náu lāi-té kok-chióng ê thêng-sek kiò-chò nńg-thé, khai-hoat tōa-hêng hē-thóng ê khang-khòe, ài hù-chhut chin tōa ê náu-le̍k. Chiàu le̍k-sú ê keng-giām, hoat-tián chi̍t-ê hē-thóng ài ē-ēng-ê, koh ài khó-khò, koh ài ha̍p kè-ōe chham ī-soàn sī chi̍t-ê tōa thiau-chiàn, nńg-thé kang-têng tio̍h-sī ūi-tio̍h choan-bûn chhú-lí chit-ê būn-tê.

### Kí-lē

Chún-kóng chi̍t-tâi tiān-náu beh iōng khì koán si̍p-jī-lō͘-kháu ê chheⁿ-âng-teng, tiān-náu ū ē-kha 5-ê chí-lēng

```
KHUI(lō͘-miâ, tiān-hóe sek)      kah tó-chi̍t-tiâu lō͘, tó-chi̍t-sek tian-hóe chhiat-kng

KOAIⁿ(lō͘-miâ, tiān-hóe-sek)      kah tó-chi̍t-tiâu lō͘, tó-chi̍t-sek tiān-hóe chhiat-tiāu

TÁN(bió)    tán-thāi kúi bió

KHAI-SÍ        khai-sí thêng-sek

TÊNG-LÂI        kiò tiān-náu têng-lâi tó pō͘-hūn ê thêng-sek
```

Thêng-sek soat-bêng thâu-chêng iōng //, pí-lūn-kóng lō͘-miâ sī Tiong-san-lō͘ (Tiongsan) kah Tiong-hàu-lō͘ (Tionghau), phòe-ha̍p gōa-kok-mi̍h thêng-sek chí-lēng pō͘-hūn ài iōng Eng-gí siá

    START
    
    //Thong-hêng Tiong-san-lō͘
    OFF(Tiongsan, Red)
    ON(Tiongsan, Green)
    WAIT(60 seconds)
    
    //Thêng-chí Tiong-san-lō͘
    OFF(Tiongsan, Green)
    ON(Tiongsan, Yellow)
    WAIT(3 seconds)
    OFF(Tiongsan, Yellow)
    ON(Tiongsan, Red)
    
    //Thong-hêng Tiong-hàu-lō͘
    OFF(Tionghau, Red)
    ON(Tionghau, Green)
    WAIT(60 seconds)
    
    //Thêng-chí Tiong-hàu-lō͘
    OFF(Tionghau, Green)
    ON(Tionghau, Yellow)
    WAIT(3 seconds)
    OFF(Tionghau, Yellow)
    ON(Tionghau, Red)
    
    //Kiò tiān-náu liân-sòa têng chò thêng-sek
    REPEAT ALL

Iōng chia-ê chí-lēng, tiān-náu tio̍h ē hō͘ nn̄g-pêng chheⁿ-âng-teng chiò âng, chheⁿ, n̂g liân-sòa lo̍h-khì tio̍h.

Nā-sī ū chi̍t-ê kán-tan ê on/off khai-koan liân-tio̍h tiān-náu, beh iōng-lâi tī ûi-siu ê sî hō͘ chheⁿ-âng-teng kan-na sih âng-teng, nā án-ne thêng-sek tio̍h ē-sái siá chò:

    START
    
    IF Switch == OFF then: //Chèng-siông tiān-hóe ūn-chok
    {
     //Thong-hêng Tiong-san-lō͘
    OFF(Tiongsan, Red)
    ON(Tiongsan, Green)
    WAIT(60 seconds)
    
    //Thêng-chí Tiong-san-lō͘
    OFF(Tiongsan, Green)
    ON(Tiongsan, Yellow)
    WAIT(3 seconds)
    OFF(Tiongsan, Yellow)
    ON(Tiongsan, Red)
    
    //Thong-hêng Tiong-hàu-lō͘
    OFF(Tionghau, Red)
    ON(Tionghau, Green)
    WAIT(60 seconds)
    
    //Thêng-chí Tiong-hàu-lō͘
    OFF(Tionghau, Green)
    ON(Tionghau, Yellow)
    WAIT(3 seconds)
    OFF(Tionghau, Yellow)
    ON(Tionghau, Red)
    
    
    //Kiò tiān-náu liân-sòa têng chò pún-tōaⁿ chí-lēng
    REPEAT THIS SECTION
    }
    
    IF Switch == ON THEN: //Ûi-siu chōng-hóng
    {
    //Âng-teng chhiat-kng jî-chhiáⁿ tán 1 bió-cheng
    ON(Tiongsan, Red)
    ON(Tionghau, Red)
    WAIT(1 second)
    
    //Âng-teng chhiat-tiāu jî-chhiáⁿ tán 1 bió-cheng
    OFF(Tiongsan, Red)
    OFF(Tionghau, Red)
    WAIT(1 second)
    
    //Kiò tiān-náu liân-sòa têng chò pún-tōaⁿ chí-lēng
    REPEAT THIS SECTION
    }

Iōng chit-khoán hong-sek, nā sī khai-koan sī khui--ê, thêng-sek kan-na ē chip-hêng sih-âng-teng ê chí-lēng. Nā sī khai-koan sī koaiⁿ--ê, thêng-sek tio̍h ē chip-hêng it-poaⁿ chōng-hóng ê chí-lēng. Chit 2-ki thêng-sek kí-lē sī tiān-náu thêng-sek iú-koan chheⁿ-âng-teng ê tāi-khài siá-hoat, jīm-hô ū keng-giām ê siat-kè-chiá ē-sái chí-chhut chiâⁿ chē nńg-thé chhàu-thâng, pí-lūn-kóng thêng-sek pēng bô khak-tēng chheⁿ-teng í-keng hoa-khì tō khì chhiat âng-teng hō͘ sih, tān-sī nā ài tû-tiāu só͘-ū khó-lêng ê chhàu-thâng, ē hō͘ thêng-sek piàn chiâⁿ-tńg kah ho̍k-cha̍p, tùi it-poaⁿ tho̍k-chiá sī chin pháiⁿ-khòaⁿ, chia-ê kí-lē chí-sī tián-lám tiān-náu thêng-sek seⁿ-chò án-nóa.

## Tiān-náu Án-nóa Kiâⁿ
It-poaⁿ ê tiān-náu ū 4 tōa tè: sǹg-su̍t kah lô-chi̍p tan-goân, khòng-chè tan-goân, kì-ek-thé, su-ji̍p / su-chhut chong-tì (ū iōng Eng-gí kán-tan siá-chò I/O), tan-goân chi-kan iōng hōe-liû-pâi (bus) sio-chiap, hōe-liû-pâi pún-sin sī iōng kui pâi tiān-sòaⁿ kap chò-hóe chò--ê.

Khòng-chè tan-goân, sǹg-su̍t kah lô-chi̍p tan-goân, chiām-chûn-khì í-ki̍p ki-pún su-chhut-ji̍p ha̍p-chheng kiò tiong-iang chhú-lí tan-goân (CPU), chá-kî CPU sī iû chin-chē lêng-kiāⁿ cho͘--khí-lâi ê, kàu 1970 nî-tāi tiong-kî ê sî CPU ē sú-iōng tan chi̍t-ê chi̍p-thé tiān-lō͘ lâi-chō; kiò bî-chhú-lí-khì.
### Khòng-chè Tan-goân
Khòng-chè tan-goân (iā kiò khòng-chè hē-thóng ia̍h-sī tiong-iong khòng-chè-khì) chí-hui tiān-náu ê kok-hāng lêng-kiāⁿ, i tha̍k-chhut chi̍t-ê chi̍t-ê têng-sek chí-lēng, jî-chhiáⁿ hoan-e̍k (kái-má) piàn-chò chi̍t-tui khòng-chè sìn-hō, lâi chhau-chok tiān-náu kî-thaⁿ pō͘-hūn, tī sian-chìn tiān-náu ê khòng-chè hē-thóng ē-sái kái-piàn pō͘-hūn chí-lēng ê chêng-āu, lâi kái-chìn hāu-lêng.

Só͘-ū--ê CPU lóng ū chi̍t-ê tiōng-iàu lêng-kiāⁿ, tio̍h sī têng-sek kè-siàu-khì, chi̍t-tè te̍k-pia̍t--ê kì-ek-thé (chiām-chûn-khì), lâi kì āu chi̍t-pō͘ chí-lēng beh ùi tó-ūi tha̍k--chhut-lâi.

Khòng-chè hē-thóng ê ūn-chok chhin-chhiūⁿ ē-kha só͘ siá (chhiáⁿ chù-ì che sī chi̍t-ê kán-tan--ê soat-bêng, jî-chhiáⁿ ū--ê CPU ē kúi-nā pō͘ chò-tīn chò ia̍h-sī pâi-lia̍t bô-kâng)

#Chiàu têng-sek kè-siàu-khì chí-tēng ê kì-ek-thé tha̍k-chhut āu chi̍t-ê chí-lēng
#Kái-khui chí-lēng ê sò͘-jī hō-bé, choán-chò chi̍t-tui hō͘ kî-thaⁿ hē-thóng ê bēng-lēng ia̍h-sī sìn-hō
#Têng-sek kè-siàu-khì chìn āu chi̍t-pō͘, chí-hiòng āu chi̍t-ê chí-lēng
#Tùi kì-ek-thé (ia̍h-sī su-ji̍p chong-tì) tha̍k-chhut chí-lēng beh iàu ê chu-liāu; chí-lēng pian-má ū lâu chu-liāu khǹg ê só͘-chāi
#Thê-kiong chu-liāu hō͘ ALU ia̍h-sī chiām-chûn-khì
#Nā-sī chí-lēng su-iàu ALU ia̍h-sī te̍k-pia̍t ngē-thé khì oân-sêng, tio̍h chhau-chok ngē-thé khì oân-sêng ūn-chok
#Kā ALU ê kiat-kó siá khì kì-ek-thé, chiām-chûn-khì iah-sī su-chhut chong-tì
#Thiàu khì tē-it-pō͘

In-ūi têng-sek kè-siàu-khì ia̍h-sī chi̍t-tui kì-ek-thé, i ē-sái hō͘ ALU kè-sǹg kiat-kó lâi kái-piàn, nā ke 100 kàu têng-sek kè-siàu-khì, tio̍h ē hō͘ āu chi̍t-ê chí-lēng beh tha̍k ê só͘-chāi piàn koh-khah hn̄g, kái-piàn têng-sek kè-siàu-khì tio̍h-sī it-poaⁿ "thiàu-ūi" (jumps) chí-lēng, iá-ū "liân-khoân" (loops) têng-sek ē têng chò chí-lēng, í-ki̍p tiâu-kiāⁿ chí-lēng ê chip-hêng (chit nn̄g-ê sī khòng-chè têng-sek liû-hiòng ê lē).

Ūi-tio̍h khòng-chè tan-goân pún-sin ka-kī ūn-chok ê sūn-sū, che ài chi̍t-ki tiān-náu têng-sek lâi chhú-lí, kî-si̍t chi̍t-kóa-á ho̍k-cha̍p--ê CPU siat-kè, iá-ū lēng-gōa chi̍t-tâi sè-ki tiān-náu (bî-sūn sū-khì, microsequencer), ē cháu chi̍t-ki têng-sek lâi chhú-lí chia-ê tāi-chì.

### Sǹg-su̍t kah Lô-chi̍p Tan-goân (ALU)

### Kì-ek-thé

### Su-ji̍p / Su-chhut Hē-thóng (I/O)

### To-kang (Multitasking)

### To Chhú-lí (Multiprocessing)

### Bāng-lō͘ kah Bāng-chè-bāng-lō͘ (internet)