Number System Conversions
Number System Conversions
Number Systems
The system used to count discrete units is called number system. There are four systems of arithmetic which are often used in digital electronics.
Decimal Number System Binary Number System Octal Number System Hexa Decimal System
To indicate digits greater than 9 (nine) we shall use the sum of these digits times power of 10.
number system.
Example:
5 6 2 1
103 102 101 100
= 1 = 20 = 600 = 5000
base 2. The values of the positions are calculated by taking 2 to some power.
Why is the base 2 for binary numbers?
o
In digital systems the information that is being processed is usually presented in binary form. Binary quantities can be represented by any device that has only two operating states or possible conditions. Eg. a switch has only open or closed. We arbitrarily (as we define them) let an open switch represent binary 0 and a closed switch represent binary 1. Thus we can represent any binary number by using series of switches.
Use to represent long binary numbers in computers and microprocessors. These digits can use to program machine language.
000
001 010 011
0
1 2 3
20
21 22 23
1
2 4 8
4 5 6 7
24 25 26 27
16 32 64 128
Significant Digits
Binary: 11101101
Most significant digit Least significant digit
Hexadecimal: 1D63A7A
Most significant digit Least significant digit
converted. Perform successive divisions by 2, placing the remainder of 0 or 1 in each of the positions from right to left. Continue until the quotient is zero. Example: 4210
25 24 23 22 21 20 32 16 8 4 2 1 1 0 1 0 1 0
12
ii. Repeat division method The numbers is divide by 2. Balance for the question is written until the last answer.
12 balance 1
LSB
MSB
Division Algorithm
Convert 67 to its binary equivalent:
6710 = x2
Step 1: 67 / 2 = 33 R 1 Step 2: 33 / 2 = 16 R 1 Step 3: 16 / 2 = 8 R 0 Step 4: 8 / 2 = 4 R 0 Step 5: 4 / 2 = 2 R 0 Step 6: 2 / 2 = 1 R 0 Step 7: 1 / 2 = 0 R 1 Divide 67 by 2. Record quotient in next row Again divide by 2; record quotient in next row Repeat again Repeat again Repeat again Repeat again STOP when quotient equals 0
1 0 0 0 0 1 12
(12.0625)10 = (1100.0001)2
6538
(315)10 = (13B)16
16 315 16 19 16 1 0
B 3 1
LSD MSD
33E16
(225.225)10 = (E1.39)16
1 0 0 1 1 0 1 26 2 5 24 23 22 2 1 20
Multiplication Algorithm
Convert (10101101)2 to its decimal equivalent: Binary
1 0 1 0 1 1 0 1
x x x x x x x x
27 26 25 24 23 22 21 20 128 + 32 + 8 + 4 + 1
Positional Values
Products
17310
1 Group the digits of the binary number by four starting from the right. 2 Replace each group of four digits by an equivalent hexadecimal digit.
Convert 101101012 into a hexadecimal number. 1011 01012 = B516 B 5
Exercise
1 Convert 1010002 into a hexadecimal number.
5
x
3
x
82 384
81 40
80 + 3
42710
Convert from binary to octal by grouping bits in threes starting with the LSB. Each group is then converted to the octal equivalent Leading zeros can be added to the left of the MSB to fill out the last group.
3
Positional Values
B
x
4
x
F
x
Products
15,18310
HEXADECIMAL TO binary
To convert a hexadecimal to binary number, convert each hexadecimal digit to its 4 bit equivalent using the hexa number.
0010 0011
(23.AB)16 = (00100011.10101011)2
i.
i.
0
1 10 11 100 101 110 111 1000 1001
0
1 2 3 4 5 6 7 8 9
0
1 2 3 4 5 6 7 8 9
1010
1011 1100 1101 1110 1111
10
11 12 13 14 15
A
B C D E F