Question: Note: the inputs should be two 2-bit positive numbers (greater than 0). You should only use 2 bits to represent both 2-bit inputs. This will

Note: the inputs should be two 2-bit positive numbers (greater than 0). You should only use 2 bits to represent both 2-bit inputs. This will cause problem for representing negative number such as -3. If we can use 3 bits, then -3 will be 101 in two's complement. But we can use only 2 bits for inputs, then we need to use 01 as -3. That's why we need to consider only positive inputs (avoid 0). For question 2 in the lab, you need to construct a 2-bit adder/subtractor using the 4-bit chip. The adder part is easy, you just need to connect the more significant bits of the inputs to 0 appopriately. For the subtraction, the idea is using 2's complement. To compute A - B, we compute A+(B)+1, where (B) means inverting each bit of input B. To compute A+ B, we compute A B as normal Let CO be the toggle between doing add and subtract; i.e. when CO 1, we do subtract, and when CO 0, we do add. Then we can have the following logic: If co = 1, we compute A + ~(B) + CO = A + ~(B) + 1 If CO 0, we compute ABCO AB0 The remaining problem is inverting bits of B when CO 1, and keeping bits of B as usual when CO 0. Solve this problem and you will have a 2-bit adder/subtractor. For this question, do the following Explain how you manipulate the bits of B to do both add and subtract. Draw the logic diagram (not circuit diagram) of the 2-bit adder/subtractor. For the adder chip, use the logic symbol in the first page
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
