MGMT 1030 Lecture Notes - Lecture 36: Overflow Flag

13 views2 pages
MGMT 1030 Lecture 36 Notes Overflow and Carry Conditions
Introduction
It is useful to be able to predict approximate sizes of integers that are represented in
complementary form without going through the conversion.
A few hints will help positive numbers are always represented by themselves.
Since they always start with 0, they are easily identified.
Small negative numbers, that is, negative numbers close to 0, have representations that
start with large numbers of 1s.
The uer − i 8-it ’s opleet, for eaple, is represeted  
hereas −8
The largest egatie ’s opleet uer, is represeted  
This is evident from the scale
Since there is only a difference in value of 1 between 1’s ad ’s opleet
representations of negative numbers (positive numbers are, of course, identical in both
representations)
You can get a quick idea of the value in either representation simply by inverting all the
1s and 0s and approximating the value from the result.
We noted earlier in this discussion that overflows occur when the result of a calculation
does not fit into the fixed number of bits available for the result.
I ’s opleet, a additio or sutratio oerflo ours he the result
overflows into the sign bit.
Thus, overflows can occur only when both operands have the same sign and can be
detected by the fact that the sign of the result is opposite that of the operands.
Computers provide a flag that allows a programmer to test for an overflow condition.
The overflow flag is set or reset each time a calculation is performed by the computer.
In addition, the computer provides a carry flag that is used to correct for carries and
borrows that occur when large numbers must be separated into parts to perform
additions and subtractions.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents