4-bit Full Adder WITH AND and OR
Alter your 4-bit full adder simulation add two new commands. Your full adder should now be capable of adding, subtracting, bitwise XOR, bitwise OR and bitwise AND operations. The full adder should have the following inputs and outputs.
INPUTS
A0-A3 - Attach to a 4-bit hex keypad
B0-B3 - Attach to a 4-bit hex keypad
Sub control Line
XOR control Line
AND control Line
OR control Line
(You may not need all four control lines, but you should NOT need more than 4)
OUTPUTS
S0-S3 - Attach to a 4-bit LED Display
Overflow / Carry - Attach to LED
4-bit Full Adder WITH simple Instruction Decode
Alter your 4-bit full adder with subtract simulation to add an instruction decode. The opcode is 3 bits. Your full adder should now be capable of the AND, OR, XOR, ADD and SUBTRACT FUNCTIONS.
The Opcode for the 5 functions are as follows
FUNCTION NAME OPCODE OUTPUT
ADD 0x02 A + B
SUB 0x06 B – A
AND 0x04 A AND B
OR 0x01 A OR B
XOR 0x07 A XOR B
The full adder should have the following inputs and outputs.
INPUTS
A0-A3 - Attach to a 4-bit hex keypad
B0-B3 - Attach to a 4-bit hex keypad
Op0-Op2 - Attach to a 4-bit hex keypad
OUTPUTS
S0-S3 - Attach to a 4-bit LED Display
C3 - Attach to LED