CPU uses electronic elements such as switches, which are represented in two states i.e., on/off state (high/low state). These two states are indicated as 1 and 0. In other words, computer operates only in two digits 1 and 0.
Hence, our ordinary decimal number system consisting ten digits (0-9) do not suits the data representation of CPU. It works with simple binary system.
BINARY NUMBER SYSTEM
It uses two symbols or digits i.e. 0 and 1. And all the symbol, Arithmetic number etc. are represents in the form of 0’s and 1’s. And ordinary decimal number can be converted to its binary form in the following manner-
Ques:
Convert (45) 10 to its Binary equivalent
2
45
2
22
1
2
11
0
2
5
1
2
2
1
2
1
0
0
1
Thus (45) 10 = (0101101) 2
Converting the above number from binary form to decimal is
1x25 + 0x24+1x23 +1x22 + 0x21 1x20
= 32 + 0 + 8 + 4 + 0 + 1 = 45
The positional values on both sides of binary point are given:
Position : 4 3 2 1 0 -1 -2 -3 -4
Position value : 24 23 22 21 20 2-1 2-2 2-3 2-4
Ques: Convert (.011) 2 to its decimal equivalent
=0x2-1 + 1x2-2 + 1x2-3
=0 + 1/4 + 1/8 = 0 + .25 + .125 =(0.375) 10
Octal No. System - This number system uses 8 symbols (0,1,2,3,4,5,6,7)
Example: -
Binary: 001 100 111 011
Octal: 1 4 7 3
Ques: Convert (3721.2406) 8 to decimal equivalent = 3x83 + 7x82 + 2x81 + 1x80 + 2x8-1 + 4x8-2 + 0x8-3 + 6x8-4 Hexa-Decimal System - This system uses base 16, incorporates the symbols (0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F).
Ques: Convert (0.3125) 10 to binary equivalent
.3125
x 2 --------- 0 .6250 x 2 ---------- 1 .2500 x 2 ---------- 0 .5000 x 2 ---------- 1 .0000 Thus (0.3125) 10 = (0.0101) 2
BCD Code - Binary coded Decimal is one of the early memory codes. Every digit in BCD is represented using 4 bits. (42) 10 = 0100 0010 4 2 Or (0100