You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.3 KiB

6 years ago
# turing_machine
A simulation of a Turing machine with a two-way register and a card reader
6 years ago
## Operation of the turing machine
6 years ago
First the machine will read card one for instructions. The machine will start at registry position zero, it will read the value there (which will be zero) and write the value from the card to that registry entry, then it will move the write head in the indicated direction. After the instruction on the card has been executed it will move to the indicated next card. If that card is the zeroeth card, the machine will halt.
6 years ago
## The anatomy of a Card
This is an example of a one card busy beaver:
```
1
1
6 years ago
0
6 years ago
1
0
0
````
6 years ago
that means
```
# If registry is zero
1 # What to write one or zero
1 # Move left for 1 move right for 0
0 # Number of next card, an int
# If registry is one
1 # What to write one or zero
0 # Move right for 1 move left for 0
0 # Number of next card, an int
````
6 years ago
This means that if the registry value is 0 write a 1 to the left and then move to card zero (halt). If the registry value is 0 write a 1 to the right and then move to card zero.
That is to say that the first three rows correspond to a registry of zero and the last three rows correspond to a registry of one.
6 years ago
A card that will move to the left if it is zero and the right if it is one and tehn exit, but leave everything else in place looks like this:
```
0
1
0
1
0
0
```