MGMT 1030 Lecture Notes - Lecture 30: Subtraction

10 views2 pages
MGMT 1030 Lecture 30 Notes Complement Scale
Introduction
Both  ad  epeset , speifially, + ad −, espetiely.
The ’s opleet sale fo -bit binary numbers is shown
Addition also works in the same way.
To add two numbers, regardless of the implied sign of either input, the computer simply
adds the numbers as though they were unsigned integers.
If there is a carryover into the next bit beyond the leftmost specified bit, 1 is added to
the result, following the usual end-around carry rule.
Subtraction is done by inverting the subtrahend (i.e., changing every 0 to 1 and every 1
to 0) and adding.
Overflows are detected in the same way as previously discussed
If both inputs are of the same sign
The sign of the result is different, overflow has occurred
The result is outside the range.
Notice that this test can be performed simply by looking at the leftmost bit of the two
inputs and the result.
An important comment about conversion between signed binary and decimal integers in
their complementary form
Although the tehiue used is idetial etee ’s opleet deial
’s opleet iay
The modulus used in the two systems is obviously not the same!
For example, the modulus in three-digit decimal is 999, with a positive range of 499.
The modulus in 8-bit binary is 11111111, or 25510, with a positive range of 01111111,
or 12710.
This eas that you aot oet dietly etee ’s opleet deial ad ’s
complement binary.
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