Question: An error: integer overflow We will take your data from Exercise 1 and put an error into it to illustrate an important point about Von

An error: integer overflow

We will take your data from Exercise 1 and put an error into it to illustrate an important point about Von Neumann machines.

Load the file example1.mac. Edit either of the data cells in the program, so that the value in one of them is '0111111111111111'. This is the largest positive integer that can be represented by 16-bit signed magnitude notation. What do you suppose should happen when the machine tries to add a positive number to this value?

The best way to see is to run the program. Be sure that the other number is greater than zero (1 will do just fine). The program should halt at the addition instruction with an error message. This is an example of an error for integer overflow. The nice thing about this error is that the machine finds it for you and tells you exactly what it is and where it occurs. Integer overflow occurs when the machine cannot represent the result of an arithmetic calculation in the given amount of memory. In the case of our machine, the magnitude or absolute value of the number must not exceed 32767.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!