FANDOM


Simulation for turing machines

Double (Decimal)

0 _ _ l 1
0 * * r 0
1 0 0 l 1
1 1 2 l 1
1 2 4 l 1
1 3 6 l 1
1 4 8 l 1
1 5 0 l 2
1 6 2 l 2
1 7 4 l 2
1 8 6 l 2
1 9 8 l 2
1 _ _ * halt
2 0 1 l 1
2 1 3 l 1
2 2 5 l 1
2 3 7 l 1
2 4 9 l 1
2 5 1 l 2
2 6 3 l 2
2 7 5 l 2
2 8 7 l 2
2 9 9 l 2
2 _ 1 * halt

Addition (2-symbol)

0 1 * r 1
0 + _ * halt
1 1 * r 1
1 + 1 l 2
2 1 * l 2
2 _ _ r 3
3 1 _ * halt

Entire string move right

0 _ _ * halt
0 1 _ r 1a
0 0 _ r 1b
1a _ 1 * halt
1a 1 1 r 1a
1a 0 1 r 1b
1b _ 0 * halt
1b 1 0 r 1a
1b 0 0 r 1b

V1

0 * * r 0
0 _ _ l 1
1 x _ r 2x
2x _ x l 3
1 y _ r 2y
2y _ y l 3
1 z _ r 2z
2z _ z l 3
3 _ _ l 1
1 _ _ * halt

Entire string move left

0 * * r 0
0 _ _ l 1
1 _ _ * halt
1 1 _ l 2a
1 0 _ l 2b
2a _ 1 * halt
2a 1 1 l 2a
2a 0 1 l 2b
2b _ 0 * halt
2b 1 0 l 2a
2b 0 0 l 2b

V1

0 x _ l 1x
1x _ x r 2
0 y _ l 1y
1y _ y r 2
0 z _ l 1z
1z _ z r 2
2 _ _ r 0
0 _ _ * halt

\(x-1\)

0 * * r 0
0 _ _ l 1
1 0 9 l 2
1 9 8 * halt
1 8 7 * halt
1 7 6 * halt
1 6 5 * halt
1 5 4 * halt
1 4 3 * halt
1 3 2 * halt
1 2 1 * halt
1 1 0 * halt
2 * * * 1
2 _ _ r 3
3 9 0 r 3
3 _ _ * halt

V1

0 0 _ r 0
0 * * r 0a
0a * * r 0a
0 _ _ l 1
0a _ _ l 1
1 _ _ * halt
1 0 9 l 2
1 9 8 * halt
1 8 7 * halt
1 7 6 * halt
1 6 5 * halt
1 5 4 * halt
1 4 3 * halt
1 3 2 * halt
1 2 1 * halt
1 1 0 l 4
2 * * * 1
2 _ _ r 3
3 * _ * halt
4 _ _ r 5
4 * * * halt
5 0 _ * halt

\(x-1\) (1 symbol, 1 state)

0 1 _ r halt

\(x+1\)

0 * * r 0
0 _ _ l 1
1 _ 1 * halt
1 0 1 * halt
1 1 2 * halt
1 2 3 * halt
1 3 4 * halt
1 4 5 * halt
1 5 6 * halt
1 6 7 * halt
1 7 8 * halt
1 8 9 * halt
1 9 0 l 1

\(x+1\) (1 symbol, 1 state)

0 * * l 0
0 _ 1 * halt

\(x+y\)

; Init state
0 * * r c1

; C-block (Checking block)
c1 * * r c1
c1 _ _ l s
c2 + + l a
c2 * * l c2

; A-block (X+1 block)
a _ 1 * c1
a 0 1 * c1
a 1 2 * c1
a 2 3 * c1
a 3 4 * c1
a 4 5 * c1
a 5 6 * c1
a 6 7 * c1
a 7 8 * c1
a 8 9 * c1
a 9 0 l a

; S-block (X-1 block)
s 0 9 l s
s 9 8 l c2
s 8 7 l c2
s 7 6 l c2
s 6 5 l c2
s 5 4 l c2
s 4 3 l c2
s 3 2 l c2
s 2 1 l c2
s 1 0 l c2
s + _ r e

; E-block (Ending block)
e * _ r e
e _ _ * halt

Link to this turing machine

\(a_1 + a_2 + a_3 ...\)

; Init state
0 * * r c1

; C-block (Checking block)
c1 * * r c1
c1 _ _ l s
c2 + + l a
c2 * * l c2

; A-block (X+1 block)
a _ 1 * c1
a 0 1 * c1
a 1 2 * c1
a 2 3 * c1
a 3 4 * c1
a 4 5 * c1
a 5 6 * c1
a 6 7 * c1
a 7 8 * c1
a 8 9 * c1
a 9 0 l a
a + x r m1

; M-block (Move right block)
m1 * * r m1
m1 _ _ l m2
m2 0 _ r m3
m2 1 _ r m4
m2 2 _ r m5
m2 3 _ r m6
m2 4 _ r m7
m2 5 _ r m8
m2 6 _ r m9
m2 7 _ r m10
m2 8 _ r m11
m2 9 _ r m12
m2 + _ r m13
m2 x + r m15
m3 _ 0 l m14
m4 _ 1 l m14
m5 _ 2 l m14
m6 _ 3 l m14
m7 _ 4 l m14
m8 _ 5 l m14
m9 _ 6 l m14
m10 _ 7 l m14
m11 _ 8 l m14
m12 _ 9 l m14
m13 _ + l m14
m14 _ _ l m2
m14 + + r m15
m15 _ 1 r c1

; S-block (X-1 block)
s 0 9 l s
s 9 8 l c2
s 8 7 l c2
s 7 6 l c2
s 6 5 l c2
s 5 4 l c2
s 4 3 l c2
s 3 2 l c2
s 2 1 l c2
s 1 0 l c2
s + _ r e

; E-block (Ending block)
e * _ r e
e _ _ l b1

; B-block
b1 _ _ l b1
b1 * * l b2
b2 _ _ r halt
b2 + + l b3
b2 * * l b2
b3 + + r 0
b3 _ _ r 0
b3 * * l b3

\(x+y\) (Unary)

0 * * r 0
0 + 1 r 1
0 _ _ * halt
1 * * r 1
1 _ _ l 2
2 1 _ l halt

\(x!\) (Unary)

0 * * l s1
s1 _ _ l s2
s2 _ 0 r s3
s3 * * r s4
s4 _ _ r 5
s4 1 1 * c0
c0 1 x r c1
c0 x x r c0
c0 _ _ l c5
c1 * * r c1
c1 _ _ r c2
c2 * * r c2
c2 _ 1 l c3
c3 _ _ l c4
c3 * * l c3
c4 * * l c4
c4 _ _ r c0
c5 x 1 l c5
c5 _ _ r 1
1 1 1 r 1
1 _ _ r 2
2 1 1 r 2
2 _ _ l 3
3 1 _ l 4
4 * * l 4
4 _ _ r s4
5 _ _ l 5
5 * * l 6
6 _ _ l 7
7 _ _ * halt
7 * * l 8
8 * * l 8
8 _ _ r m0
m0 1 _ r m1
m0 _ _ r m9
m1 1 1 r m1
m1 _ _ r m2
m2 1 _ r m3
m2 _ _ l m7
m3 1 1 r m3
m3 _ _ r m4
m4 1 1 r m4
m4 _ 1 l m5
m5 1 1 l m5
m5 _ _ l m6
m6 1 1 l m6
m6 _ 1 r m2
m7 1 1 l m7
m7 _ _ l m8
m8 1 1 l m8
m8 _ _ r m0
m9 1 _ r m9
m9 _ _ * 9
9 1 1 l 9
9 _ _ l 10
10 * * * 17
10 _ _ r 11
11 _ 1 r 12
12 * * r 13
13 * * r 13
13 _ _ l 14
14 1 _ l 15
15 * * l 15
15 _ _ l 10
16 1 _ l 9
17 0 _ * halt
17 * * l 8

Copying (1-symbol)

0 1 _ r 1
0 _ _ * halt
1 * * r 1
1 _ _ r 2
2 1 1 r 2
2 _ 1 l 3
3 1 1 l 3
3 _ _ l 4
4 1 1 l 4
4 _ 1 r 0

\(a_1 + a_2 + a_3 ...\) (Unary)

0 * * r 0
0 _ _ l 1
1 1 1 l 1
1 + 1 r add1
1 _ _ * halt
add1 1 1 r add1
add1 _ _ l add2
add2 1 _ l 1

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.