Lecture Notes_3
Lecture Notes_3
The major type of data that computers deal with are numbers. All numbers in the binary
system are formed using the binary digits 0 and 1. Each number can be represented as
unsigned or signed binary number.
1. Signed-Magnitude representation
2. Signed-1's Complement representation
3. Signed-2's Complement representation
Signed-Magnitude Representation:
In ordinary arithmetic, a negative number is indicated by a minus sign and a positive
number by a plus sign. Because of hardware limitations, computers must represent
everything with 0’s and 1’s, including the sign of a number.
It is customary to represent the sign with a bit placed in the leftmost position of the
number. The convention is to make the sign bit 0 for positive numbers and 1 for
negative numbers.
Signed-Complement Representation:
When arithmetic operations are to be performed, negative numbers are represented by
their complements; r's complement and (r − 1)'s complement.
8
COMPLEMENTS
Complements are used in digital computer for simplifying the subtraction operation and
for logical manipulation.
9
Radix (r's) Complement:
The r’s complement of an n-digit number N in base-r is obtained by subtracting it from
rn, [rn − N], if N ≠ 0 and it is 0 for N = 0.
10
For binary numbers r = 2:
11