Question: In prior classes, you learned that signed values are represented in 2 ' s complement form. So subtraction such as A - B is simply

In prior classes, you learned that signed values are represented in 2's complement form. So subtraction such as A-B is simply A +2's complement of B. Also, in hardware subtraction of any two values is done as if they are signed values. You may declare P and Q as unsigned char (or int) in your C code, but P-Q is done as P+2's complement of Q.
eg: 3+5=8(are they signed or unsigned)? answer is the same, still 8.
eg: 3-5=-2 even if 3 and 5 are looked at as unsigned. We cannot say 3-5 is 2 because 3 and 5 are unsigned. ALU hardware makes the answer 11111dots11110 which is -2.
Q1) An arithmetic and logic unit (ALU) performs integer and logic operations. Implement (draw a minimized logic circuit) the logic of a simple ALU that performs 2-bit addition and subtraction. Assume the operands are A1A0 and B1B0, and the output is C1C0. The control signal Op is only one bit, which selects addition or subtraction. Two ways to solve this. (a) Use 2 bit adder (half adder + full adder) with inputs to it being modified based on Op signal, or (b) start from a truth table. Then you may have to develop a truth table and use K maps for 5 variables leading to a large circuit. See next page for help. Recall that subtraction is done with adding after making the subtrahend negative (2's complement) regardless of whether arguments are signed or unsigned.
 In prior classes, you learned that signed values are represented in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!