Decimal number system - base 10
deci -> 1/10
0 1 2 3 4 5 6 7 8 9
Binary number system - base 2
0 1
0 --> off 1--> on
Octal number system - base 8
Octagon
0 1 2 3 4 5 6 7
Hexadecimal number system - base 16
Hexagon
hexa + decimal = 6 + 10
=========================================================================
Convert Number Systems
=========================================================================
1) Decimal -> Binary
2) Decimal -> Octal
3) Decimal -> Hexadecimal
4) Binary -> Decimal
5) Binary -> Octal
6) Binary -> Hexadecimal
7) Octal -> Decimal
8) Octal -> Binary
9) Octal -> Hexadecimal
10) Hexadecimal -> Decimal
11) Hexadecimal -> Binary
12) Hexadecimal -> Octal
-----------------------------------------------------------------------------------------------------------------------------
1) Decimal -> Binary
There are two ways to do that, the first method is
Subtraction method
ex:- 75 to binary
The highest base 2 number less than 75 is 64
75 -> 64
75-64 =11
then the highest number less than 11 is 8
75 -> 64 + 8
11 -8 =3
the next highest number less than 3 is 2
75 -> 64 + 8 + 2
3-2 =1
So final remainder also selected.
75 -> 64 + 8 + 2 + 1
So the selected numbers we gonna put value 1 and other value for 0
The answer is 1001011 in base 2
Successive division method
ex:- 75 to binary
R =Reminder
(75/2 =37.5 the floating value multiple by division value, 2* 0.5 = 1, that's how reminder comes R =1)
75/2 =37 R 1
37/2 =18 R 1
18/2 =9 R 0
9/2=4 R 1
4/2=2 R 0
2/2=1 R 0
1/2=1 R 1
Now write R values bottom to top
1001011 base 2
This is another method
ex:- 75 to binary
-----------------------------------------------------------------------------------------------------------------------------
2) Decimal -> Octal
ex:- 394 to octal
394/8 =49.25 49 R 2 (R= 8*0.25)
49/8= 6.125 6 R 1 (R=8*0.125)
6/8=0.75 0 R 6 (R=8*0.75)
612 base 8
Another example is using long division without a calculator
ex:- 468 to octal
-----------------------------------------------------------------------------------------------------------------------------
3) Decimal -> Hexadecimal
ex:- 479 base 10 to hexadecimal
479/16 = 29.9375 29 R 15 (R = 0.9375*16)
29/16 = 1.8125 1 R 13 (R = 0.8125*16)
1/16 = 0.0625 0 R 1
R values, 1 13 15 = 1 D F = 1DF base 16
-----------------------------------------------------------------------------------------------------------------------------
4) Binary -> Decimal
1. ex: - 1010 base 2
1 0 1 0
2^3 2^2 2^1 2^0
2^3 + 0 + 2^1 + 0
8 + 2
10 base 10
Now look a fractional binary no
2. ex: - 1100.101 base 2
1 1 0 0 . 1 0 1
2^3 2^2 2^1 2^0 2^-1 2^-2 2^-3
8 + 4 + 0 + 0 + 1/2 + 0 + 1/8
12 + 0.5 + 0.125
12.625 base 10
-----------------------------------------------------------------------------------------------------------------------------
5) Binary -> Octal
first, we need to group by 3 digits, right to left in this binary number, because 8= 2^3.
ex:- 1111110 to octal
1111110
0 0 1 1 1 1 1 1 0
4 2 1 4 2 1 4 2 1
1 7 6
176 base 8
-----------------------------------------------------------------------------------------------------------------------------
6) Binary -> Hexadecimal
first, we need to group by 4 digits, right to left in this binary number, because 16= 2^4.
ex:- 1111011111100 to hexadecimal
0 0 0 1 1 1 1 0 1 1 1 1 1 1 0 0
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
1 14 15 12
1 E F C
1EFC base 16
-----------------------------------------------------------------------------------------------------------------------------
7) Octal -> Decimal
ex:- 370 base 8 to decimal
3 7 0
8^2 8^1 8^0
64*3 + 8*7 + 0
192 + 56 + 0
248 base 10
-----------------------------------------------------------------------------------------------------------------------------
8) Octal -> Binary
1. ex: 56 base 8 to binary
(4 2 1 = 2^2 2^1 2^0)
5 6
4 2 1 4 2 1
5 makes by 4 and 2
6 makes by 4 and 2
So we add value 1 for that numbers and others value for 0.
4 2 1 4 2 1
1 0 1 1 1 0
101110 base 2
2. ex: 35 base 8 to binary
3 5
4 2 1 4 2 1
0 1 1 1 0 1 * note:- If there any left-side front zero, that is not used for the answer.
1 1 1 0 1
11101 base 2
-----------------------------------------------------------------------------------------------------------------------------
9) Octal -> Hexadecimal
1. ex: 213 base 8 to hexadecimal
step 1-> convert this number to binary
2 1 3
4 2 1 4 2 1 4 2 1
0 1 0 0 0 1 0 1 1
step 2 -> rearrange this binary number into groups by 4 digits.
0 1000 1011
* note:- If there any left-side front zero, that is not used for the answer.
1 0 0 0 1 0 1 1
8 4 2 1 8 4 2 1
8 11
8B base 16
-----------------------------------------------------------------------------------------------------------------------------
10) Hexadecimal -> Decimal
1. ex: 23E base 16 to decimal
2 3 E
16^2 16^1 16^0
2*256 +16*3+1*14
512 + 48 +14
574 base 10
2. ex: 3B4.C8 base 16 to decimal
3 B 4 . C 8
16^2 16^1 16^0 16^-1 16^-2
3*256 + 11*16 + 4*1+ 12/16 + 8/256
768 + 176 + 4 +0.75 +0.03125
948.78125 base 10
-----------------------------------------------------------------------------------------------------------------------------
11) Hexadecimal -> Binary
1. ex: 1D29 base 16 to binary
1 D 2 9
1 13 2 9
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
0 0 0 1 1 1 0 1 0 0 1 0 1 0 0 1
1 1101 0010 1001
1110100101001 base 2
-----------------------------------------------------------------------------------------------------------------------------
12) Hexadecimal -> Octal
1. ex: 1EF base 16 to octal
1 E F
1 14 15
8 4 2 1 8 4 2 1 8 4 2 1
0 0 0 1 1 1 1 0 1 1 1 1
rearrange this binary number into groups by 3 digits.
0 0 0 1 1 1 1 0 1 1 1 1
left-side front zero, that is not used for the answer
1 1 1 1 0 1 1 1 1
4 2 1 4 2 1 4 2 1
7 5 7
757 base 8
Comments
Post a Comment