Question

In: Computer Science

4.4-4.6 The term arithmetic overflow refers to the condition where the result of some computation is...

4.4-4.6 The term arithmetic overflow refers to the condition where the result of some computation is
outside the range of expected results. When a computation produces a result with absolute value
smaller then the computer can represent we have arithmetic underflow.
Answer the following 4 point questions regarding the detection of incorrect computations when processing ALU instructions.


4.4 We have explored the potential for incorrect answers caused by overflow when the ALU operates
on integers. For completeness, we need to examine the possibility of underflow in integer ALU
operations. Either give an example of underflow or explain why underflow is impossible for
integer ALU computations.

4.5 Can floating point arithmetic using the IEEE standard format result in overflow? Either explain
why overflow is impossible for floating point or explain how the presence of overflow can be
detected. Note: an example can be used when giving your answer, but an example without
explanation is too poor to afford full credit.

4.6 Can floating point arithmetic using the IEEE standard format result in underflow? Either explain
why underflow is impossible for floating point computations or explain how the presence of underflow can be detected. Give an example with an explanation.

Solutions

Expert Solution

4.4

Arithmetic underflow is the condition in a computer program where the result of a calculation is a number of smaller absolute value than the computer can actually represent in memory on its central processing unit.

An example of this condition would be:-

When the true result of a floating point operation is smaller in magnitude (that is, closer to zero) than the smallest value representable as a normal floating point number in the target datatype.

It is impossible in integer ALU instruction because there are no decimals and no value really close to 0 (just 1 and -1).

4.5

Yes, overflow can happen using IEEE standards too but in this case, it will not terminate the program. It'll result in producing an exception.

According to IEEE 754, if the absolute value of the rounded value is too large to be represented, an infinity or maximal finite value is returned, depending on which rounding is used.

For example, if the number to be represented is 10000 but the maximum limit is 8191(213-1), then it will show 8191.

4.6

If the rounded value is tiny (as specified in IEEE 754) and inexact (or maybe limited to if it has denormalization loss, as per the 1984 version of IEEE 754), returning a subnormal value including the zeros, an underflow exception will be thrown.

The underflow condition only arises if there is also a loss of precision in the resulting value.

The default handling in IEEE 754 for underflow (as well as other exceptions) is to record as a floating point status that underflow has occurred. This is specified for the application-programming level, but often also interpreted as how to handle it at the hardware level.

Hence, it's presence can be detected if there's a loss of precision in the value or a value of exact zero(decimals too) is returned.


Related Solutions

1)AV block refers to a condition where there is a longer-than normal conduction delay at the...
1)AV block refers to a condition where there is a longer-than normal conduction delay at the AV node. There are different degrees of AV block. Sometimes conduction is only slightly delayed, and sometimes conduction is blocked entirely. Which of the following will not be observed in someone with AV block (of any severity). incorrect answer i selected)Atrial and ventricular systole occur at the same time. correct answer )Atrial contraction rate is slower than ventricular contraction rate. 2)Which of the following...
2. Starting a new business is often the result of some particular event or condition within...
2. Starting a new business is often the result of some particular event or condition within an individual's environment. List four events that could trigger a new business. Give an example of a real business that was triggered by one of the events you mentioned.   (300 words – 20 marks) 3. Define small businesses. Why does a small business act as a catalyst for social change? (200 words – 15 marks)
describe an instance where a government has taken some action the result of which is influence...
describe an instance where a government has taken some action the result of which is influence on commerce. 250 words required. 2 references needed.
5) Consider a situation where the market equilibrium would result in 200 units of some good...
5) Consider a situation where the market equilibrium would result in 200 units of some good being produced (that is – at Q = 200 units is where the supply and demand curves intersect.) a) Explain why a deadweight loss would arise if production were to stop at only 150 units being produced. b.)Explain why a deadweight loss would arise if production were to total 250 units.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT