4 bit Op Code ALU. OpCodes are as follows-
1011 Shift L Logically
1100 Shift R Logically
1101 Shift L Arithmetically
1110 Shift R Arithmetically
1111 Running Sum
Running Sum takes the current 4bit number at the input and continously adds it to the output every second.
Compare is 2’b10 when A is greater than B, 2’b01 when B is greater than A. 2’b11 when equal.
NOT treats A and B as a combined 4bit input.
Subtraction anticipates am unsigned number input (treats them as positive numbers essentially) however will give signed output depending on the operation. It acts as A-B.
Testing can be done by connecting the outputs to LEDs and treating them as an 8 bit output. Seeing how they correspond to the selected OpCodes and inputs.
|0||OpCode 0||segment a||Output bit 0|
|1||OpCode 1||segment b||Output bit 1|
|2||OpCode 2||segment c||Output bit 2|
|3||OpCode 3||segment d||Output bit 3|
|4||B 0||segment e||Output bit 4|
|5||B 1||segment f||Output bit 5|
|6||A 0||segment g||Output bit 6|
|7||A 1||dot||Output bit 7|