Tom Kelliher, CS 220
Oct. 21, 2005
Read 3.6-3.7.
Integer representation schemes.
Floating point.
How can this be?
Would we have this result if we were working in 16 bits?
Operation | A | B | Overflow Result |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
if the signs of A and B are the same if the signs of A and Sum are different overflow has occured.Subtraction is similar.
A compact way of writing this in C:
if (a ^ b >= 0 && a ^ sum < 0) overflow();
addu
, etc.
add
, etc.
How many bits in the datapath? Demonstrate on board.
Running time?
Demonstrate on board.