Skip to Content
深入理解運算原理|從簡單的機器到無所不能的程式
book

深入理解運算原理|從簡單的機器到無所不能的程式

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
246
|
7
5. 將這兩個數值編碼成適合標籤系統使用的字串。對我們的範例磁帶來說,可以使用
aa
,再跟著 26
bb
的副本,接著是
cc
,然後是 12
dd
的副本。
6. 使用簡單的數值運算(加倍、減半、遞增、遞減、奇偶數檢查)來模擬讀取磁帶的
讀取和寫入,以及磁帶頭的移動。例如,我們可以將代表左邊部分的數值加倍,並
將代表右邊部分的數值減半,就可以在我們的範例磁帶將磁帶頭往右移動
7
26
倍會得到 52,也就是二進位的 11010012 的一半是 6,也就是二進位的 110;所
以新磁帶看起來像是
011010(0)011000
。從磁帶讀取意謂著檢查代表磁帶左邊部分
的數值是偶數還是奇數,而將
1
0
寫入磁帶則意謂著遞增或遞減該數值。
7. 代表模擬圖靈機的目前狀態,可以選擇用於編碼左右磁帶數值的字元:或許當機器
處於狀態 1 的時候,我們用
a
b
c
d
字元來對磁帶編碼,但是當進入狀態 2 時,
我們就改用
e
f
g
h
等字元。
8. 將每條圖靈機規則轉換成以適當方式重寫目前字串的標籤系統:讀取
0
、寫入
1
向右移動磁帶頭並進入狀態 2 的規則可以變成檢查左邊磁帶數值是不是偶數的標籤
系統、遞增它、減半右邊磁帶數值的同時也加倍左邊磁帶數值、並且以狀態 2 的字
元產生編碼過的最終字串。
9. 合併這些個別的標籤系統,製作出可以模擬圖靈機每條規則的大型系統。
圖靈機的標籤系統模擬物如何運作的完整說明,請見馬修 庫克(Matthew
Cook)這篇文件(
http://www.complex-systems.com/pdf/15-1-1.pdf ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs

Publisher Resources

ISBN: 9789864766000