Go to file
Rhinemann cb19425b8a Merge pull request 'New Feature: add square root extraction implementation' (#5) from square-root-support into master
Reviewed-on: #5
2024-06-17 21:13:26 +03:00
lib Made independent. 2024-01-19 21:02:47 +02:00
LICENSE Initial commit 2023-06-17 21:44:27 +03:00
README.md README.md updated with releases. 2024-01-21 13:58:52 +02:00
bitutilities.py add square root extraction implementation 2024-06-17 21:07:51 +03:00
main.py add square root extraction implementation 2024-06-17 21:07:51 +03:00

README.md

binaryCalculatorPrototype

This is a Python language prototype for a binary calculator to be used in Computer Arithmetics lab works for first-year students studying Computer Engineering at KPI.

English

Requirements

The user must have installed:

  • python 3 (for the calculator itself);

Installation

Cloning the repository

To install the experimental version of the calculator just clone the repository locally:

git clone -b master http://139.162.162.130:3000/Rhinemann/binaryCalculatorPrototype.git

Stable packages

To install a stable release of the calculator download the archive from releases page and decompress it in a directory of your choice.

User instructions

Start the calculator using the following command:

python3 main.py

After that you must input the binary number as your first and second operands, as such:

Enter first operand: 110101
Enter second operand: 110

Note that you can't input any digit other than 0 or 1 into the operands:

Enter first operand: 234123
[ERROR] The first operand may contain only 1-s and 0-s!
Enter first operand: 12314
[ERROR] The first operand may contain only 1-s and 0-s!
Enter first operand: 1234123
[ERROR] The first operand may contain only 1-s and 0-s!

After inputting the operands properly, you will be presented with such prompt:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) >

(110101 000110) are the operands you have input.

You may now choose the operations performed on the operands as such:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > a

Sum: 111011
Carry: 0

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > s

Subtraction: 101111
Carry: 1

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > m

Choose method to use (1-4):
(110101 000110) m > 1

Multiplication (method 1):
+------+--------+--------+--------+-----+----------------------+
| iter |  RG1   |  RG2   |  RG3   |  CT |   MicroOperations    |
+------+--------+--------+--------+-----+----------------------+
|  0   | 000000 | 110101 | 000110 | 110 |          -           |
+------+--------+--------+--------+-----+----------------------+
|  1   | 000110 | 110101 | 000110 | 110 |   RG1 := RG1 + RG3   |
|  1   | 000011 | 011010 | 000110 | 101 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  2   | 000001 | 101101 | 000110 | 100 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  3   | 000111 | 101101 | 000110 | 100 |   RG1 := RG1 + RG3   |
|  3   | 000011 | 110110 | 000110 | 011 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  4   | 000001 | 111011 | 000110 | 010 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  5   | 000111 | 111011 | 000110 | 010 |   RG1 := RG1 + RG3   |
|  5   | 000011 | 111101 | 000110 | 001 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  6   | 001001 | 111101 | 000110 | 001 |   RG1 := RG1 + RG3   |
|  6   | 000100 | 111110 | 000110 | 000 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
Result: 000100111110

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > d

Choose method to use (1-2):
(110101 000110) d > 1

Division (method 1):
+------+---------+----------+----------+-----------------------+
| iter |   RG3   |   RG2    |   RG1    |    MicroOperations    |
+------+---------+----------+----------+-----------------------+
|  0   | 1111111 | 00110101 | 00000110 |           -           |
+------+---------+----------+----------+-----------------------+
|  1   | 1111111 | 00101111 | 00000110 |    RG2 := RG2 - RG1   |
|  1   | 1111111 | 01011110 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  2   | 1111111 | 01011000 | 00000110 |    RG2 := RG2 - RG1   |
|  2   | 1111111 | 10110000 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  3   | 1111111 | 10110110 | 00000110 |    RG2 := RG2 + RG1   |
|  3   | 1111110 | 01101100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  4   | 1111110 | 01100110 | 00000110 |    RG2 := RG2 - RG1   |
|  4   | 1111101 | 11001100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  5   | 1111101 | 11010010 | 00000110 |    RG2 := RG2 + RG1   |
|  5   | 1111010 | 10100100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  6   | 1111010 | 10101010 | 00000110 |    RG2 := RG2 + RG1   |
|  6   | 1110100 | 01010100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  7   | 1110100 | 01001110 | 00000110 |    RG2 := RG2 - RG1   |
|  7   | 1101001 | 10011100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  8   | 1101001 | 10100010 | 00000110 |    RG2 := RG2 + RG1   |
|  8   | 1010010 | 01000100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  9   | 1010010 | 00111110 | 00000110 |    RG2 := RG2 - RG1   |
|  9   | 0100101 | 01111100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
Result: 100101

The results of the operations will be displayed, and you will get prompted for the next operation to perform.

Note the results of previous operations don't impact the operands, therefore you can't plug your previous results into the calculator without restarting the program!

Also, as a quality of life feature, you can chain multiple operations in one prompt as such:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > asm1d1

Sum: 111011
Carry: 0

Subtraction: 101111
Carry: 1

Multiplication (method 1):
+------+--------+--------+--------+-----+----------------------+
| iter |  RG1   |  RG2   |  RG3   |  CT |   MicroOperations    |
+------+--------+--------+--------+-----+----------------------+
|  0   | 000000 | 110101 | 000110 | 110 |          -           |
+------+--------+--------+--------+-----+----------------------+
|  1   | 000110 | 110101 | 000110 | 110 |   RG1 := RG1 + RG3   |
|  1   | 000011 | 011010 | 000110 | 101 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  2   | 000001 | 101101 | 000110 | 100 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  3   | 000111 | 101101 | 000110 | 100 |   RG1 := RG1 + RG3   |
|  3   | 000011 | 110110 | 000110 | 011 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  4   | 000001 | 111011 | 000110 | 010 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  5   | 000111 | 111011 | 000110 | 010 |   RG1 := RG1 + RG3   |
|  5   | 000011 | 111101 | 000110 | 001 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  6   | 001001 | 111101 | 000110 | 001 |   RG1 := RG1 + RG3   |
|  6   | 000100 | 111110 | 000110 | 000 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
Result: 000100111110

Division (method 1):
+------+---------+----------+----------+-----------------------+
| iter |   RG3   |   RG2    |   RG1    |    MicroOperations    |
+------+---------+----------+----------+-----------------------+
|  0   | 1111111 | 00110101 | 00000110 |           -           |
+------+---------+----------+----------+-----------------------+
|  1   | 1111111 | 00101111 | 00000110 |    RG2 := RG2 - RG1   |
|  1   | 1111111 | 01011110 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  2   | 1111111 | 01011000 | 00000110 |    RG2 := RG2 - RG1   |
|  2   | 1111111 | 10110000 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  3   | 1111111 | 10110110 | 00000110 |    RG2 := RG2 + RG1   |
|  3   | 1111110 | 01101100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  4   | 1111110 | 01100110 | 00000110 |    RG2 := RG2 - RG1   |
|  4   | 1111101 | 11001100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  5   | 1111101 | 11010010 | 00000110 |    RG2 := RG2 + RG1   |
|  5   | 1111010 | 10100100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  6   | 1111010 | 10101010 | 00000110 |    RG2 := RG2 + RG1   |
|  6   | 1110100 | 01010100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  7   | 1110100 | 01001110 | 00000110 |    RG2 := RG2 - RG1   |
|  7   | 1101001 | 10011100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  8   | 1101001 | 10100010 | 00000110 |    RG2 := RG2 + RG1   |
|  8   | 1010010 | 01000100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  9   | 1010010 | 00111110 | 00000110 |    RG2 := RG2 - RG1   |
|  9   | 0100101 | 01111100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
Result: 100101

So that multiple operations are performed on the same operands without the need for multiple prompts.

Українська

Вимоги

Користувач мусить мати:

  • python 3 (для роботи калькулятора);

Завантаження

Клонування репозиторію

Щоб встановити експериментальну версію калькулятора пропишіть цю команду, щоб клонувати репозиторій:

git clone -b master http://139.162.162.130:3000/Rhinemann/binaryCalculatorPrototype.git

Стабільні версії

Щоб встановити стабільний реліз калькулятора завантажте архів зі сторінки релізів та розархівуйте в обраній директорії.

Інструкція користувачам

Калькулятор запускається цією командою:

python3 main.py

Після цього користувач має ввести два операнди у двійковій системі, наприклад:

Enter first operand: 110101
Enter second operand: 110

Варто зауважити, що не можна ввести жодну цифру крім 0 чи 1 у значення операндів:

Enter first operand: 234123
[ERROR] The first operand may contain only 1-s and 0-s!
Enter first operand: 12314
[ERROR] The first operand may contain only 1-s and 0-s!
Enter first operand: 1234123
[ERROR] The first operand may contain only 1-s and 0-s!

Після коректного введення операндів користувач побачить такий запит:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) >

(110101 000110) - це операнди введені користувачем.

Користувач тепер може обрати операції що виконуватимуться:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > a

Sum: 111011
Carry: 0

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > s

Subtraction: 101111
Carry: 1

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > m

Choose method to use (1-4):
(110101 000110) m > 1

Multiplication (method 1):
+------+--------+--------+--------+-----+----------------------+
| iter |  RG1   |  RG2   |  RG3   |  CT |   MicroOperations    |
+------+--------+--------+--------+-----+----------------------+
|  0   | 000000 | 110101 | 000110 | 110 |          -           |
+------+--------+--------+--------+-----+----------------------+
|  1   | 000110 | 110101 | 000110 | 110 |   RG1 := RG1 + RG3   |
|  1   | 000011 | 011010 | 000110 | 101 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  2   | 000001 | 101101 | 000110 | 100 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  3   | 000111 | 101101 | 000110 | 100 |   RG1 := RG1 + RG3   |
|  3   | 000011 | 110110 | 000110 | 011 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  4   | 000001 | 111011 | 000110 | 010 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  5   | 000111 | 111011 | 000110 | 010 |   RG1 := RG1 + RG3   |
|  5   | 000011 | 111101 | 000110 | 001 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  6   | 001001 | 111101 | 000110 | 001 |   RG1 := RG1 + RG3   |
|  6   | 000100 | 111110 | 000110 | 000 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
Result: 000100111110

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > d

Choose method to use (1-2):
(110101 000110) d > 1

Division (method 1):
+------+---------+----------+----------+-----------------------+
| iter |   RG3   |   RG2    |   RG1    |    MicroOperations    |
+------+---------+----------+----------+-----------------------+
|  0   | 1111111 | 00110101 | 00000110 |           -           |
+------+---------+----------+----------+-----------------------+
|  1   | 1111111 | 00101111 | 00000110 |    RG2 := RG2 - RG1   |
|  1   | 1111111 | 01011110 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  2   | 1111111 | 01011000 | 00000110 |    RG2 := RG2 - RG1   |
|  2   | 1111111 | 10110000 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  3   | 1111111 | 10110110 | 00000110 |    RG2 := RG2 + RG1   |
|  3   | 1111110 | 01101100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  4   | 1111110 | 01100110 | 00000110 |    RG2 := RG2 - RG1   |
|  4   | 1111101 | 11001100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  5   | 1111101 | 11010010 | 00000110 |    RG2 := RG2 + RG1   |
|  5   | 1111010 | 10100100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  6   | 1111010 | 10101010 | 00000110 |    RG2 := RG2 + RG1   |
|  6   | 1110100 | 01010100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  7   | 1110100 | 01001110 | 00000110 |    RG2 := RG2 - RG1   |
|  7   | 1101001 | 10011100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  8   | 1101001 | 10100010 | 00000110 |    RG2 := RG2 + RG1   |
|  8   | 1010010 | 01000100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  9   | 1010010 | 00111110 | 00000110 |    RG2 := RG2 - RG1   |
|  9   | 0100101 | 01111100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
Result: 100101

Результати обчислень будуть виведені, а користувач отримає повторний запит операції.

Увага результати обчислень не змінюють операнди, тому їх неможливо використовувати у майбутніх обчисленнях без перезапуску програми!

Також, для зручності користувач може об'єднати декілька операцій у один запис:

Choose the operation:
[a]ddition, [s]ubtraction, [m]ultiplication, [d]ivision, [q]uit
(110101 000110) > asm1d1

Sum: 111011
Carry: 0

Subtraction: 101111
Carry: 1

Multiplication (method 1):
+------+--------+--------+--------+-----+----------------------+
| iter |  RG1   |  RG2   |  RG3   |  CT |   MicroOperations    |
+------+--------+--------+--------+-----+----------------------+
|  0   | 000000 | 110101 | 000110 | 110 |          -           |
+------+--------+--------+--------+-----+----------------------+
|  1   | 000110 | 110101 | 000110 | 110 |   RG1 := RG1 + RG3   |
|  1   | 000011 | 011010 | 000110 | 101 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  2   | 000001 | 101101 | 000110 | 100 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  3   | 000111 | 101101 | 000110 | 100 |   RG1 := RG1 + RG3   |
|  3   | 000011 | 110110 | 000110 | 011 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  4   | 000001 | 111011 | 000110 | 010 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  5   | 000111 | 111011 | 000110 | 010 |   RG1 := RG1 + RG3   |
|  5   | 000011 | 111101 | 000110 | 001 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
|  6   | 001001 | 111101 | 000110 | 001 |   RG1 := RG1 + RG3   |
|  6   | 000100 | 111110 | 000110 | 000 | RG2 := RG1[1].r(RG2) |
|      |        |        |        |     |   RG1 := 0.r(RG1)    |
|      |        |        |        |     |     CT := CT - 1     |
+------+--------+--------+--------+-----+----------------------+
Result: 000100111110

Division (method 1):
+------+---------+----------+----------+-----------------------+
| iter |   RG3   |   RG2    |   RG1    |    MicroOperations    |
+------+---------+----------+----------+-----------------------+
|  0   | 1111111 | 00110101 | 00000110 |           -           |
+------+---------+----------+----------+-----------------------+
|  1   | 1111111 | 00101111 | 00000110 |    RG2 := RG2 - RG1   |
|  1   | 1111111 | 01011110 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  2   | 1111111 | 01011000 | 00000110 |    RG2 := RG2 - RG1   |
|  2   | 1111111 | 10110000 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  3   | 1111111 | 10110110 | 00000110 |    RG2 := RG2 + RG1   |
|  3   | 1111110 | 01101100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  4   | 1111110 | 01100110 | 00000110 |    RG2 := RG2 - RG1   |
|  4   | 1111101 | 11001100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  5   | 1111101 | 11010010 | 00000110 |    RG2 := RG2 + RG1   |
|  5   | 1111010 | 10100100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  6   | 1111010 | 10101010 | 00000110 |    RG2 := RG2 + RG1   |
|  6   | 1110100 | 01010100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  7   | 1110100 | 01001110 | 00000110 |    RG2 := RG2 - RG1   |
|  7   | 1101001 | 10011100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  8   | 1101001 | 10100010 | 00000110 |    RG2 := RG2 + RG1   |
|  8   | 1010010 | 01000100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
|  9   | 1010010 | 00111110 | 00000110 |    RG2 := RG2 - RG1   |
|  9   | 0100101 | 01111100 | 00000110 | RG3 := l(RG3).!RG2[8] |
|      |         |          |          |    RG2 := l(RG2).0    |
+------+---------+----------+----------+-----------------------+
Result: 100101

Таким чином обчислення послідовно над операндами без потреби у декількох запитах.