0% found this document useful (0 votes)
23 views2 pages

Signed Number Representations

The document discusses three main methods for representing signed numbers in binary: signed magnitude, one’s complement, and two’s complement. Signed magnitude uses the most significant bit for the sign, leading to two representations of zero, while one’s complement inverts bits but also has the same zero representation issue and requires corrective steps in calculations. Two’s complement resolves these problems by providing a single representation for zero and simplifying arithmetic operations with negative numbers.

Uploaded by

aub.tho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Signed Number Representations

The document discusses three main methods for representing signed numbers in binary: signed magnitude, one’s complement, and two’s complement. Signed magnitude uses the most significant bit for the sign, leading to two representations of zero, while one’s complement inverts bits but also has the same zero representation issue and requires corrective steps in calculations. Two’s complement resolves these problems by providing a single representation for zero and simplifying arithmetic operations with negative numbers.

Uploaded by

aub.tho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Signed Number Representations

We can represent negative numbers in decimal using the minus symbol (-). However,
since numbers are represented in computers as sequences of bits, negative numbers also need
to be represented using binary. There are three main methods of signed number representation
in binary - signed magnitude, one’s complement and two’s complement.

Signed Magnitude

Also called sign-magnitude or sign and magnitude representation. In this system the sign
of the number is represented using the most significant bit or MSB (the leftmost digit) which is
set to 0 for positive and 1 for negative. The remaining bits in the number represent the
magnitude or absolute value of the number.

A byte (8 bits) can represent numbers from -12710 to +12710, since the most significant
bit is used for the sign, the remaining seven bits (11111112) can represent a maximum absolute
value of 127. 111111112 then would represent -12710.

While this method is simple, it has many drawbacks. One problem is that there are two
possible representations of 0 in this system. For example, for an 8 bit number, both 100000002
and 000000002 can represent 010 . Another issue is that the sign has to be treated separately
in performing calculations, which can become very complex to implement in the computer’s
hardware.

One’s Complement

The one’s complement of a binary number is found by applying the bitwise NOT
operation to the number, referred to as the “complement” (inverse) of its positive representation.
This is achieved by simply inverting each bit of the number so that 1s become 0s and 0s
become 1s. For example the one’s complement of 10102 would be 01012.

This system also has the issue of having two ways of representing 0 (11111111 and
00000000 for 8-bit numbers).
Another issue is that when performing calculations with negative numbers, an additional
step is required to get the correct result. For example adding the numbers -110 and +210 using
one’s complement (using 8-bit binary numbers):

binary decimal
00000001 1 positive binary representation
11111110 –1 one’s complement
+ 00000010 +2
─────────── ──
1 00000000 0 ← Overflow bit is discarded
1 +1 ← Corrective step (add 1)
─────────── ──
00000001 1 ← Correct answer

Notice that in this calculation the initial sum had a carry bit which exceeded the 8 bit
range. This bit is discarded. While this result is accurate for those two numbers, this means that
a sum larger than 127 (for 8 bit signed numbers) cannot be represented accurately.

Two’s Complement

Two’s complement solves the problem of multiple representations of 0 and doesn’t


require a corrective step when doing arithmetic with negative numbers. This method represents
negative numbers by adding 1 to the one’s complement of a positive number. There is only one
representation of 0 (00000000 in an 8 bit number).

For example the number 4110 = 001010012 , Applying one’s complement gives:
110101102 and then adding 1 gives 110101112 which is the two’s complement representation
of that number

00101001 positive binary representation


11010110 one’s complement
+ 1 add one
________
11010111 two’s complement

You might also like