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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started