Let R1 and R2 be two 4-bit registers that store numbers in 2’s c...
Stored numbers in registers R1 and R2 are in 2's complement form. Register size is 4 bits. The range of numbers in 2's complement form is -8 to +7. If R1 + R2, the result is out of the above range, then it is overflow.
The given data,
Given two four-bit registers R1 and R2.
Option 1: R1 = 1011 and R2 = 1110
False,
R1 = 1 0 1 1 = -(0101)= -5
+ R2 = 1 1 1 0 = -(0010)= -2
-----------------------------------------------
1 0 0 1 = = -7
Here No overflow occurred, because sign bit is same for (R1 + R2 ).
Option 2: R1 = 1100 and R2 = 1010
True,
R1 = 1 1 0 0 = -(0100)= -4
+ R2 = 1 0 1 0 = -(0110)= -6
--------------------------------------------
0 1 1 0 = = -10
Here Overflow occurred because the sign bit is different for (R1 + R2 ).
Option 3: R1 = 0011 and R2 = 0100
False,
R1 = 0 0 1 1 = +(0011)= +3
+ R2 = 0 1 0 0 = +(0100)= +4
--------------------------------------------
0 1 1 1 = +7
Here No overflow occurred, because the sign bit is the same for (R1 + R2 ).
Option 4: R1 = 1001 and R2 = 1111
False,
R1 = 1 0 0 1 = -(0111) = -7
+ R2 = 1 1 1 1 = -(0001) = -1
--------------------------------------------
1 0 0 0 = = -8
Here No overflow occurred, because the sign bit is the same for (R1 + R2 ).
Hence the correct answer is R1 = 1100 and R2 = 1010.