Question: Exercise 3.3 Overfl ow occurs when a result is too large to be represented accurately given a fi nite word size. Underfl ow occurs when
Exercise 3.3 Overfl ow occurs when a result is too large to be represented accurately given a fi nite word size. Underfl ow occurs when a number is too small to be represented correctly—a negative result when doing unsigned arithmetic, for example. (The case when a positive result is generated by the addition of two negative integers is also referred to as underfl ow by many, but in this textbook, that is considered an overfl ow). The following table shows pairs of decimal numbers.
A B
a. 69 90
b. 102 44 3.3.1 [5] <3.2> Assume A and B are unsigned 8-bit decimal integers. Calculate A − B. Is there overfl ow, underfl ow, or neither?
3.3.2 [5] <3.2> Assume A and B are signed 8-bit decimal integers stored in signmagnitude format. Calculate A + B. Is there overfl ow, underfl ow, or neither?
3.3.3 [5] <3.2> Assume A and B are signed 8-bit decimal integers stored in signmagnitude format. Calculate A − B. Is there overfl ow, underfl ow, or neither?
The following table also shows pairs of decimal numbers.
A B
a. 200 103
b. 247 237 3.3.4 [10] <3.2> Assume A and B are signed 8-bit decimal integers stored in two’s-complement format. Calculate A + B using saturating arithmetic. The result should be written in decimal. Show your work.
3.3.5 [10] <3.2> Assume A and B are signed 8-bit decimal integers stored in two’s-complement format. Calculate A − B using saturating arithmetic. The result should be written in decimal. Show your work.
3.3.6 [10] <3.2> Assume A and B are unsigned 8-bit integers. Calculate A + B using saturating arithmetic. The result should be written in decimal. Show your work.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
