Department of
Physics
2.1. Decimal Number System
• The decimal number system is a radix-10 number system and therefore has 10 different
digits or symbols.
• These are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. All higher numbers after ‘9’ are represented in
terms of these 10 digits only.
• The process of writing higher-order numbers after ‘9’ consists in writing the second digit
(i.e., ‘1’) first, followed by the other digits, one by one, to obtain the next 10 numbers
from ‘10’ to ‘19’.
• The next 10 numbers from ‘20’ to ‘29’ are obtained by writing the third digit (i.e., ‘2’)
first, followed by digits ‘0’ to ‘9’, one by one.
• The process continues until we have exhausted all possible two-digit combinations and
reached ‘99’.
• Then we begin with three-digit combinations.
• The first three-digit number consists of the lowest two-digit number followed by ‘0’ (i.e.,
100), and the process goes on endlessly.
• The place values of different digits in a mixed decimal number, starting from the decimal
point, are 100, 101, 102 and so on (for the integer part) and 10-1, 10-2, 10-3 and so on (for
the fractional part).
The value or magnitude of a given decimal number can be expressed as the sum of the various
digits multiplied by their place values or weights.
As an illustration, in the case of the decimal number 3586.265, the integer part (i.e., 3586) can
be expressed as
3586 = 6×100 +8×101 +5×102 +3×103 = 6+80 +500 +3000 = 3586
and the fractional part can be expressed as
0.265 = 2×10−1 +6×10−2 +5×10−3 = 0.2 + 0.06 + 0.005 = 0.265
We have seen that the place values are a function of the radix of the concerned number system
and the position of the digits. We will also discover in subsequent sections that the concept of
each digit having a place value depending upon the position of the digit and the radix of the
number system is equally valid for the other more relevant number systems.
2.2. Binary Number System
• The binary number system is a radix-2 number system with ‘0’ and ‘1’ as the two
independent digits.
• All larger binary numbers are represented in terms of ‘0’ and ‘1’.
• The procedure for writing higher order binary numbers after ‘1’ is similar to the one
explained in the case of the decimal number system.
• For example, the first 16 numbers in the binary number system would be 0, 1, 10, 11,
100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111.
Chapter 2
Department of
Physics
• The next number after 1111 is 10000, which is the lowest binary number with five digits.
This also proves the point made earlier that a maximum of only 16 (= 24 numbers could
be written with four digits.
• Starting from the binary point, the place values of different digits in a mixed binary
number are 20, 21, 22 and so on (for the integer part) and 2−1, 2−2, 2−3 and so on (for the
fractional part).
2.3. Octal Number System.
• The octal number system has a radix of 8 and therefore has eight distinct digits.
• All higher-order numbers are expressed as a combination of these on the same pattern as
the one followed in the case of the binary and decimal number systems described in
Sections 1 and 2.
• The independent digits are 0, 1, 2, 3, 4, 5, 6 and 7.
• The next 10 numbers that follow ‘7’, for example, would be 10, 11, 12, 13, 14, 15, 16,
17, 20 and 21.
• In fact, if we omit all the numbers containing the digits 8 or 9, or both, from the decimal
number system, we end up with an octal number system.
• The place values for the different digits in the octal number system are 80, 81, 82 and so
on (for the integer part) and 8−1, 8−2, 8−3 and so on (for the fractional part).
2.4. Hexadecimal Number System.
• The hexadecimal number system is a radix-16 number system and its 16 basic digits are
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.
• The place values or weights of different digits in a mixed hexadecimal number are 16 0,
161, 162 and so on (for the integer part) and 16−1, 16−2, 16−3 and so on (for the fractional
part).
• The decimal equivalent of A, B, C, D, E and F are 10, 11, 12, 13, 14 and 15 respectively,
for obvious reasons.
• The hexadecimal number system provides a condensed way of representing large binary
numbers stored and processed inside the computer.
• One such example is in representing addresses of different memory locations. Let us
assume that a machine has 64K of memory.
• Such a memory has 64K (= 216 = 65 536) memory locations and needs 65 536 different
addresses.
• These addresses can be designated as 0 to 65 535 in the decimal number system and
00000000 00000000 to 11111111 11111111 in the binary number system.
• The decimal number system is not used in computers and the binary notation here appears
too cumbersome and inconvenient to handle.
• In the hexadecimal number system, 65 536 different addresses can be expressed with
four digits from 0000 to FFFF.
• Similarly, the contents of the memory when represented in hexadecimal form are very
convenient to handle.
Chapter 2
Department of
Physics
2.5. Decimal to Binary Conversion
A systematic way to convert a decimal number into equivalent binary number is known as
double dabble. This method involves successive division by 2 and recording the remainder (the
remainder will be always 0 or 1). The division is stopped when we get a quotient of 0 with a
remainder of 1. The remainders when read upwards give the equivalent binary number.
Example 1 Convert decimal number 10 into its equivalent binary number.
Solution:
2 10- Remainder
2 5 - 0 (MSB)
2 2 - 1
2 1 - 0
0 - 1 (LSB)
The binary number is (1010)2.
Example 2.2. Convert decimal number 25 into its binary equivalent.
Solution:
2 25- Remainder
2 12 - 1
2 6 - 0
2 3 - 0
2 1 - 1
2 0 - 1
The binary number is (11001)2.
Fractions
Example 2.3 Express the number 0.6875 into binary equivalent.
Solution:
Fraction Fraction × 2 Remainder new fraction Integer
0.6875 1.375 0.375 1 (MSB)
0.375 0.75 0.75 0
0.75 1.5 0.5 1
0.5 1.0 . 1 (LSB)
The binary equivalent is 0.1011.
Chapter 2
Department of
Physics
2.6. Binary to Decimal Conversion
The procedure to convert a binary number to decimal is called dibble-dabble method.
1. We start with the left-hand bit.
2. Multiply this value by 2 and add the next bit.
3. Again multiply by 2 and add the next bit.
4. Stop when the bit on extreme righthand side is reached.
Another fast and easy method to convert binary number to decimal number is as under:
1. Write the binary number.
2. Write the weights 20, 21, 22, 23 etc., under the binary digits starting with the bit on right hand
side.
3. Cross out weights under zeros.
4. Add the remaining weights.
Example 2.1. Convert (100101)2 to decimal.
Solution: Left hand bit 1
Multiply by 2 and add next bit 2 × 1 + 0 = 2
Multiply by 2 and add next bit 2 × 2 + 0 = 4
Multiply by 2 and add next bit 2 × 4 + 1 = 9
Multiply by 2 and add next bit 2 × 9 + 0 = 18
Multiply by 2 and add next bit 2 × 18 + 1 = 37
Therefore, (100101)2 = (37)10
Example 2.2 Convert 11012 into equivalent decimal number.
1 1 0 1 Binary number
Solution:
23 = 8 22 = 4 21 = 2 20 = 1 Write weights
2 Cross out weights
8 4 1
under zeros
8 + 4 + 0 + 1 = 13 Add weights
Therefore, (1101)2 = (13)10.
Fractions
Chapter 2
Department of
Physics
In the binary system, the weights of the binary bits after the binary point, can be written as
(0.1011)2 = 1 × 2-1 + 0 × 2-2 + 1 × 2-3 + 1 × 2-4
= 1 ×12 + 0 × 14 + 1 × 18 + 1 × 161
= 0.5 + 0 + 0.125 + 0.0625
= 0.6875 (decimal).
(0.1011)2 = (0.6875)10
Chapter 2