This is a sort of 4-bit ALU that can do addition, subtraction, negatives, multiplication, AND, OR, and XOR.
To use it, put in the number values into the input pins and the number result will come out of the output pins.
There isn't really any external hardware needed.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | fourth bit of second number (B) | 0 (unless doing multiplication - then it is part of output) | XOR |
1 | third bit of second number (B) | 0 (unless doing multiplication - then it is part of output) | OR |
2 | second bit of second number (B) | 0 (unless doing multiplication - then it is part of output) | AND |
3 | first bit of second number (B) | 0 (unless doing multiplication - then it is part of output) | Multiplication |
4 | fourth bit of first number (A) | result/output | Subtraction |
5 | third bit of first number (A) | result/output | Negative of B(second number) |
6 | second bit of first number (A) | result/output | Negative of A(first number) |
7 | first bit of first number (A) | result/output (number) | Addition |