You are on page 1of 11

Representation of positive and negative numbers

in binary

( Different formats used for binary representation of both positive and


negative decimal numbers include the sign-bit magnitude method, the
1's complement method and the 2's complement method.)
1) Sign-magnitude form
In the sign-bit magnitude representation of positive and negative
decimal numbers, the MSB represents the ‘sign’, with a ‘0’ denoting a
plus sign and a ‘1’ denoting a minus sign.
The remaining bits represent the magnitude. In eight-bit
representation, while MSB represents the sign, the remaining seven
bits represent the magnitude.
For example, the eight-bit representation of +9 would be 00001001,
and that for −9 would be 10001001.

+25 = 00011001 -25 = 10011001


2) 1'S COMPLEMENT
In the 1's complement format, the positive numbers remain
unchanged.
The negative numbers are obtained by taking the 1's complement of
the corresponding positive numbers.
For example, +9 will be represented as 00001001 in eight-bit notation,
and−9 will be represented as 11110110
+25 in eight bits 1’s complement notation = 00011001
-25 in eight bits 1’s complement notation = 11100110
3) 2’s Complement
Positive numbers in this method are represented as same way as sign
magnitude and 1’s complement form
For negative numbers take 1’s complement and add 1.
For example, +9 would be represented as 00001001, and−9 would be
written as 11110111.
+25 in eight bits 2’s complement notation = 00011001
-25 in eight bits 2’s complement notation = 11100111
Q) Determine the decimal values of signed binary numbers a) 010111
and b) 1101010 if they are in
(i) sign magnitude form
(ii) 1’s complement
(iii) 2’s complement
Ans a) +23 in each case
b) -42, -21, -22
• Find the decimal equivalent of the following binary numbers expressed in the
8 bits 2's complement format:

(a) 00001110.
(b) 10001110.
(c) 01010110
(d) 10101010
Ans
a) 14
b) -114
c) 86
d) -86
Subtraction using 2’s complement
1) Subtract 14 from 46 using 8 bit 2’s complement
+46  00101110 +
-14  11110010
------------------
100100000 , ignore the carry. Result is +32
2) Subtract 75 from 26 using 8 bit 2’s complement
+26  00011010 +
-75  10110101
-----------------
11001111 , result is -49
3) Add -34 and -57 using 8 bit 2’s complement arithmetic method.
4) Add -62 and 29 using 8 bit 2’s complement arithmetic method.
BCD codes
The BCD equivalent of a decimal number is written by replacing each
decimal digit in the integer and fractional parts with its four-bit binary
equivalent.

As an example, the BCD equivalent of (23.15)10 is written as


(0010 0011.0001 0101)BCD.
1) Convert 98 to BCD
a) 1001 1000
2) Convert 2469 to BCD
b) 0010 0100 0110 1001
3) Convert BCD 001101010001 to binary
a) 351
4) Convert BCD number: 0010 1001.0111 0101 to binary
Ans) Corresponding decimal number: 29.75.
The binary equivalent of 29.75 can be determined to be 11101 for
the integer part and .11 for the fractional part.
Therefore, (0010 1001.0111 0101)BCD=(11101.11)2.
5) Convert binary no: 10101011.101 to BCD
The decimal equivalent of this binary number can be determined
to be 171.625.
The BCD equivalent can then be written as 0001 0111 0001.0110
0010 0101.

You might also like