Show how the overflow is set in an ALU. 0-31 bits for the X value and 0-31 bits for the Y value each coming from a separate wire into the adder, and 0-31 bits from the output O from computing X+Y coming out of the adder. Write the logical expression that will determine the results of the overflow signal.
see Detecting Overflow
Overflow occurs on machines since we represent values with a
limited number of bits. Remember that the operands are values that
can be represented. The first two lines in the table represent when
overflow can occur since the signs of the operands are the same and
the result is different. The next two lines represent that overflow
cannot occur when the signs of the operands and the result are the
same. The last four lines represent that overflow cannot occur when
the signs of the operands are different. The definition of C and
C++ ignores overflow. Remember that the
addu
,
addiu
, and
subu
do not cause an overflow
exception, while add
,
addi
, and
sub
can cause an overflow
exception.
Get Answers For Free
Most questions answered within 1 hours.