-
Notifications
You must be signed in to change notification settings - Fork 0
/
sum3.turingmachine
102 lines (71 loc) · 1003 Bytes
/
sum3.turingmachine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Input: a#b (a and b are binary numbers)
// Ouput: a+b
// Example: 1011#10 outputs 1101
//
// Binary Addition Algorithm
// for Turing Machine Simulator
// turingmachinesimulator.com
// By Jose Antonio Matte
name: Binary addition
init: q0
accept: q5
q0,0,_,_
q0,0,_,_,>,-,-
q0,1,_,_
q0,1,_,_,>,-,-
q0,#,_,_
q1,_,_,_,>,-,-
q1,0,_,_
q1,_,0,_,>,>,-
q1,1,_,_
q1,_,1,_,>,>,-
q1,_,_,_
q2,_,_,_,<,<,-
q2,_,0,_
q2,_,0,_,<,-,-
q2,_,1,_
q2,_,1,_,<,-,-
q2,1,0,_
q3,1,0,_,-,-,-
q2,1,1,_
q3,1,1,_,-,-,-
q2,0,1,_
q3,0,1,_,-,-,-
q2,0,0,_
q3,0,0,_,-,-,-
q3,1,0,_
q3,1,0,1,<,<,<
q3,0,1,_
q3,0,1,1,<,<,<
q3,0,0,_
q3,0,0,0,<,<,<
q3,1,1,_
q4,1,1,0,<,<,<
q3,_,_,_
q5,_,_,_,-,-,-
q3,1,_,_
q3,1,_,1,<,<,<
q3,0,_,_
q3,0,_,0,<,<,<
q3,_,1,_
q3,_,1,1,<,<,<
q3,_,0,_
q3,_,0,0,<,<,<
q4,0,0,_
q3,0,0,1,<,<,<
q4,0,1,_
q4,0,1,0,<,<,<
q4,1,0,_
q4,1,0,0,<,<,<
q4,1,1,_
q4,1,1,1,<,<,<
q4,_,0,_
q3,_,0,1,<,<,<
q4,_,1,_
q4,_,1,0,<,<,<
q4,1,_,_
q4,1,_,0,<,<,<
q4,0,_,_
q3,0,_,1,<,<,<
q4,_,_,_
q5,_,_,1,-,-,-