






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







































§3.1 Introduction
Subtracting two +ve or two –ve operands, no overflow Subtracting +ve1 from –ve2 operand, e.g., -ve2 – ve Overflow if result sign is 0 Subtracting –ve1 from +ve2 operand, e.g., ve2 – (- ve1) Overflow if result sign is 1
For signed addition For unsigned addition
**addu $t $t $t
xor $t $t $t
slt $t $t $zero $ t3=1 if signs differ bne $t $zero No_overflow
xor $t $t $t
slt $t $t $zero
bne $t $zero Overflow
**addu $t $t $t
nor $t $t $zero
sltu $t $t $t $ (2^32 - $t1 – 1) < $$t2 => 2^32-1 < $t1 + $t bne $t $zero Overflow
1000 × 10011000 0000 0000 10001001000 Length of product =length ofmultiplicand + length+ multiplier, if weignore the sign bits multiplicand multiplier product §3.3 Multiplication Multiplication hardware is simplyshifts and adds
Initially 0 1000 × 10011000 0000 0000 10001001000 Takes about 100 cycles if each step takes 1 cycle
64-bit product in HI/LO
Move from HI/LO to rd Can test HI value to see if product overflows 32 bits
Least-significant 32 bits of product –> rd
Initially dividend Initially divisor in left half
Same hardware can be used for both
56
9
2
yyyy
normalized not normalized §3.5 Floating Point