MGMT 1030 Lecture Notes - Lecture 26: Modular Arithmetic, Negative Number

15 views2 pages
MGMT 1030 Lecture 26 Notes Sign-and-Magnitude
Introduction
What is the sign-and-magnitude value of the four-digit uer represeted i 9’s
complement by 3789?
In this case, the leftmost digit is in the range 04.
Therefore, the number is positive, and is already in correct form.
The answer is +3789.
This example emphasizes the difference between the representation of a number in
complementary form and the operation of taking the complement of a number.
The representation just tells us what the number looks like in complementary form.
The operation of finding the complement of a number consists of performing the steps
that are necessary to change the number from one sign to the other.
Note that if the value represents a negative number
It is necessary to perform the operation if we wish to convert the number into sign-and-
magnitude form.
What is the sign-and-magnitude value of the four-digit number represented by 9990?
This value is negative.
To get the sign-and-agitude represetatio for this uer, e take the 9’s
opleet: 9999 −9990 9 Therefore, 9990 represets the alue −9.
Next, let’s osider the operatio of additio he the uers eig added are i 9’s
complementary form.
When you studied programming language, you learned that modular arithmetic could
be used to find the remainder of an integer division.
You recall that in modular arithmetic, the count repeats from 0 when a limit, called the
modulus, is exceeded.
Thus, as an example, 4 mod 4 has the value 0 and 5 mod 4 has the value 1.
The 9’s opleet sale sho shares the ost iportat harateristi of odular
arithmetic
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