MGMT 1030 Lecture Notes - Lecture 26: Modular Arithmetic, Negative Number
![](https://new-preview-html.oneclass.com/17vWDzZOJA5gQMkpdKqOjxyMEbRYVrnP/bg1.png)
MGMT 1030 Lecture 26 Notes – Sign-and-Magnitude
Introduction
• What is the sign-and-magnitude value of the four-digit uer represeted i 9’s
complement by 3789?
• In this case, the leftmost digit is in the range 0–4.
• 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-agitude represetatio for this uer, e take the 9’s
opleet: 9999 −9990 9 Therefore, 9990 represets the alue −9.
• Next, let’s osider the operatio of additio he the uers eig 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 opleet sale sho shares the ost iportat harateristi of odular
arithmetic
find more resources at oneclass.com
find more resources at oneclass.com