Your adder/subtractor must take in two 8 bit numbers, a
and b
, and one select value, s
, and have an 8 bit output, c
. If s
is zero, your adder should output a + b
. If s
is one, your adder should output a - b
. For some examples, look at the table below.
a | b | s | c |
---|---|---|---|
00001100 | 00001000 | 0 | 00010100 |
00001100 | 00001000 | 1 | 00000100 |
01101000 | 01010000 | 0 | 10111000 |
01101000 | 01010000 | 1 | 00011000 |
Note that in the third example, we get the wrong answer because of overflow—just like many modern programming languages, we are going to ignore this.
You are required to build this adder/subtracter using only with basic logic gates (i.e., AND, OR, NOT, NOR, NAND and XOR). You are not allowed to use the circuitverse adder. You should take the following steps.
You are required to have a separate half-adder and full-adder subcircuit to get full credit for the lab.
Make sure to select the “save online” button to save your project. This will make your project available to us for grading.