|
A) CALCULATIONS WITH NUMBERS WRITTEN IN UNARY |
|
Addition of 2 unaries Solution 1
2 states |
|
|
|
|
|
|
Addition of 2 unaries Solution 2 Copy X to the right of Y
5 states |
|
|
|
|
|
|
Subtract X from Y with X < Y
3 states |
|
|
|
|
|
|
Multiplication of two integers written in unary
10 states |
|
|
|
|
|
|
Euclidean division by 3 in unary
8 states |
|
|
|
|
|
|
Calculation of N modulo p in unary N > 0 and p > 0
7 states |
|
|
|
|
|
|
Euclidean division of A by B in unary
9 states |
| |
|
|
|
Calculation of 2 n in unary
The machine treats the unary as the binary to which it will add 1 to obtain 2 n
6 states |
|
|
|
|
|
|
Comparison of two unaries
8 states |
| |
|
|
|
B) Unary to binary and binary to unary passages |
|
Writing a unary in binary
5 states |
|
|
|
|
|
|
Writing a binary to unary
6 states |
|
|
|
|
|
|
C) CALCULATIONS WITH BINARY NUMBERS |
|
Add 1 to a binary number
1 state |
|
|
|
|
|
|
Subtract 1 from a binary
1 state
The binary is > 1 |
|
|
|
|
|
|
Addition of 2 binary numbers
6 states |
|
|
|
|
|
|
Subtract one binary from another
6 states
We assume X > Y > 0 |
|
|
|
|
|
|
Difference of 2 binary with deletion of 0
9 states
We assume X > Y > 0 |
|
|
|
|
|
|
Calculation of 3n in binary
Multiply a binary by 11
3 States |
|
|
|
|
|
|
Calculation of 3n + 1 in binary
4 states |
|
|
|
|
|
|
Calculation of 3n + 2 in binary
4 states |
|
|
|
|
|
|
Division by 11 with divisibility test and suppression of mute 0s.
11 states |
|
|
|
|
|
|
Calculation of 5n in binary
Multiply a binary by 101
5 States |
|
|
|
|
|
|
Calculation of 5n + 1 in binary
6 states |
|
|
|
|
|
|
Calculation of 5n + 2 in binary
6 states |
|
|
|
|
|
|
Calculation of 5n + 3 in binary
6 states |
|
|
|
|
|
|
Calculation of 5n + 4 in binary
6 states |
|
|
|
|
|
|
Dividing a binary by 101
10 states |
|
|
|
|
|
|
Passage of the binary system to the Gros-Gray code
2 states |
|
|
|
|
|
|
Passage of the Gros-Gray code to the binary system
2 states |
|
|
|
|
|
|