Number System
Number System
CP
Why Number System
Binary numbers
All computers work with 0’s and 1’s so it is like learning alphabets before learning
English
Base conversion
For convenience, people use other bases (like decimal, hexdecimal) and we need to
know how to convert from one to another.
Number systems
There are more than one way to express a number in binary. So 1010 could be -2, -
5 or -6 and need to know which one.
Why Number System
➢ Take each digit in the binary number and multiply it with its place value.
➢ The sum of all the above products will give the equivalent decimal number.
For the fraction (after the decimal point) the place value starts with
negative power of 2. This negative power value increases from left to right.
• The place value of the first left digit in fraction is (2–1)
• The place value of the next right digit in fraction is (2–2)
• The place value of the next right digit in fraction is (2–3) ……. so on
Conversion (Binary to Decimal)
Ex :- Convert the binary number (0.1101)2 into decimal number.
1 1 1 1
(0.1101)2 = (1 x ) + ( 1 x ) + (0 x ) + (1 x )
2 4 8 16
= 1 x 0.5 + 1 x 0.25 + 0 x 0.125 +1 x 0.0625
= 0.5 +0.25 + 0 + 0.0625
= (0.8125)10
Conversion (Binary to Decimal)
Ex :- Convert the binary number (1010.0101)2 into decimal number.
Sol :- Integer part (1010)2 = (1 x 23) + ( 0 x 22) + (1 x 21) + (0 x 20 )
= (1 x 8) + ( 0 x 4) + (1 x 2) + (0 x 1 )
= (10)10
Fractional part (0.0101)2 = (0 x 2–1) + ( 1 x 2–2) + (0 x 2–3) + (1 x 2–4)
1 1 1 1
= (0 x ) + ( 1 x ) + (0 x ) + (1 x )
2 4 8 16
= 0 x 0.5 + 1 x 0.25 + 0 x 0.125 +1 x 0.0625
= 0 + 0.25 + 0 + 0.0625
= (0.3125)10
Conversion (Binary to Decimal)
Ex :- Convert the binary number (1010.0101)2 into decimal number.
Sol :- Integer part (1010)2 = (1 x 23) + ( 0 x 22) + (1 x 21) + (0 x 20 )
= (1 x 8) + ( 0 x 4) + (1 x 2) + (0 x 1 )
= (10)10
Fractional part (0.0101)2 = (0 x 2–1) + ( 1 x 2–2) + (0 x 2–3) + (1 x 2–4)
1 1 1 1
= (0 x ) + ( 1 x ) + (0 x ) + (1 x )
2 4 8 16
= 0 x 0.5 + 1 x 0.25 + 0 x 0.125 +1 x 0.0625
= 0 + 0.25 + 0 + 0.0625
= (0.3125)10
Binary to Octal number system
2. If ‘1’ or “0” occurs as remainder, transfer that ‘1’ or “0” to the binary record.
3. Now take quotient as dividend and divide it by 2 and transfer the remainder to the
binary record.
4. The same procedure is continued until the quotient becomes zero
method.
2. If ‘1’ or ‘0’ occurs in units place in the product, transfer that ‘1’ or ‘0’ to the binary record.
3. The multiplication is continued with the remaining fraction.
5. The first transferred number (1 or 0) to binary record is taken as most significant bit (MSB).
6. The last transferred number (1 or 0) to binary record is taken as least significant bit (LSB).
7. If the multiplication does not end, it can be stopped at any of our desired level.
Decimal to Hexadecimal Conversion