-
Notifications
You must be signed in to change notification settings - Fork 0
/
div.json
33 lines (33 loc) · 834 Bytes
/
div.json
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
//Sample instruction set to divide a binary number by 2 (truncate remainder)
[
//state 0
[
//read 0
{"write": 0,"direction": "L","next_state": 0},
//read 1
{"write": 1,"direction": "L","next_state": 0},
//read e
{"write": "0","direction": "R","next_state": 1}
],
//state 1
[
//read 0
{"write": 0,"direction": "R","next_state": 1},
//read 1
{"write": 1,"direction": "R","next_state": 1},
//read e
{"write": "e","direction": "L","next_state": 2}
],
//state 2
[
//read 0
{"write": "e","direction": "L","next_state": 3},
//read 1
{"write": "e","direction": "L","next_state": 3},
//read e
{"write": "e","direction": "L","next_state": 3}
],
[
//halt state (because it is last in the file)
]
]