|
The ALU is controlled by the three wires F0, F1 and F2. These form a binary number between 0 and 7. Here is what they tell the ALU to put on its output wires: F2 F1 F0 ------------------------------------------------------------- 0 0 0 identity A pass through A's value unchanged 0 0 1 identity TMP pass through TMP's value unchanged 0 1 0 A and TMP bitwise Boolean AND of A and TMP 0 1 1 A or TMP bitwise Boolean OR of A and TMP 1 0 0 not TMP bitwise Boolean NOT of TMP (A ignored) 1 0 1 A + TMP arithmetic addition of A and TMP 1 1 0 A - TMP arithmetic subtraction of A and TMP 1 1 1 unused |