Chapter 2 – Encoding Schemes and Number System
Exercise Solutions
1. Write base values of binary, octal and hexadecimal number system.
The base values of different number systems are as follows:
Binary Number System: | Base 2 |
Octal Number System: | Base 8 |
Hexadecimal Number System: | Base 16 |
These systems use different sets of symbols to represent values, with binary using 0 and 1, octal using digits 0-7, and hexadecimal using digits 0-9 and letters A-F.
2. Give full form of ASCII and ISCII.
ASCII | American Standard Code for Information Interchange |
ISCII | Indian Script Code for Information Interchange |
3. Try the following conversions:
(i) (514)8 = (?)10
To convert the octal number (514)8 to decimal, we can use the positional value of each digit in the octal system, which is base 8. Each digit is multiplied by 8 raised to the power of its position (counting from right to left, starting at 0).
Conversion Steps:
– Identify the digits: 5, 1, 4
-Assign positional values:
- 5 is in the 82 place
- 1 is in the 81 place
- 4 is in the 80 place
– Calculate the decimal value:
(514)8 = 5×82 + 1×81 + 4×80
= 5×64 + 1×8 + 4×1
= 320 + 8 + 4
= 332
(ii) (220)8 = (?)2
Lets convert from Octal to Decimal first:
(220)8 = 2×82 + 2×81 + 0×80
= 2×64 + 2×8 + 0×1
= 128 + 16 + 0
= 144
Now, convert to Binary:
To convert the decimal number 144 to binary, you can use the method of successive division by 2.
Here’s how it works:
– Divide the number by 2 and record the quotient and the remainder.
– Continue dividing the quotient by 2 until the quotient becomes 0.
– The binary equivalent is the remainders read in reverse order (from bottom to top).
Division | Quotient | Remainder |
144 ÷ 2 | 72 | 0 |
72 ÷ 2 | 36 | 0 |
36 ÷ 2 | 18 | 0 |
18 ÷ 2 | 9 | 0 |
9 ÷ 2 | 4 | 1 |
4 ÷ 2 | 2 | 0 |
2 ÷ 2 | 1 | 0 |
1 ÷ 2 | 0 | 1 |
Now, read the remainders from bottom to top: 10010000
(iii) (76F)16 = (?)10
Follow below steps:
Identify the values of each digit:
- 7 corresponds to 7
- 6 corresponds to 6
- F corresponds to 15
Apply the positional values:
Each digit in a hexadecimal number is multiplied by 16n, where n is the position of the digit from right to left, starting at zero:
- For 7
7 × 162 = 7 × 256 = 1792
- For 6
6 × 161 = 6 × 16 = 96
- For F
15 × 160 = 15 × 1 = 15
Sum the results
1792 + 96 + 15 = 1903
Thus, the decimal equivalent of (76F)16 is 1903
(iv) (4D9)16 = (?)10
Identify the values of each digit:
- 4 corresponds to 44
- D corresponds to 13
- 9 corresponds to 9
Apply the positional values:
Each digit in a hexadecimal number is multiplied by 16n, where n is the position of the digit from right to left, starting at zero:
- For 4
4 × 162 = 4 × 256 = 1024
- For D
13 × 161 = 13 × 16 = 208
- For 9
9 × 160 = 9×1 = 9
Sum the results
1024 + 208 + 9 = 1241
Thus, the decimal equivalent of (4D9)16 is 1241.
(v) (11001010)2 = (?)10
Step 1: Identify the values of each digit
Each digit in a binary number represents a power of 2, starting from the rightmost digit (which is 20).
Postion from right | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Binary Digit | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
Step 2: Calculate the decimal value
1 × 27 = 1 × 128 = 128
1 × 26 = 1 × 64 = 64
0 × 25 = 0 × 32 = 0
0 × 24 = 0 × 16 = 0
1 × 23 = 1 × 8 = 8
0 × 22 = 0 × 4 = 0
1 × 21 = 1 × 2 = 2
0 × 20 = 0 × 1 = 0
Step 3: Sum the results
128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 = 202
Thus, the decimal equivalent of the binary number 11001010 is 202.
(vi) (1010111)2 = (?)10
Step 1: Identify the values of each digit
Each digit in a binary number represents a power of 2, starting from the rightmost digit (which is 20).
Position from right | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Binary Digit | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
Step 2: Calculate the decimal value
1 × 26 = 1 × 64 = 64
0 × 25 = 0 × 32 = 0
1 × 24 = 1 × 16 = 16
0 × 23 = 0 × 8 = 0
1 × 22 = 1 × 4 = 4
1 × 21 = 1 × 2 = 2
1 × 20 = 1 × 1 = 1
Step 3: Sum the results
64 + 0 + 16 + 0 + 4 + 2 + 1 = 87
Thus, the decimal equivalent of the binary number 1010111 is 87.
4. Try the following conversions:
(i) (54)10 = (?)2
Step-by-Step Conversion
54 ÷ 2 = 27, remainder 0
27 ÷ 2 = 13, remainder 1
13 ÷ 2 = 6, remainder 1
6 ÷ 2 = 3, remainder 0
3 ÷ 2 = 1, remainder 1
1 ÷ 2 = 0, remainder 1
Thus 54 in binary is: 110110
(ii) (120)10 = (?)2
Step-by-Step Conversion
120 ÷ 2 = 60, remainder 0
60 ÷ 2 = 30, remainder 0
30 ÷ 2 = 15, remainder 0
15 ÷ 2 = 7, remainder 1
7 ÷ 2 = 3, remainder 1
3 ÷ 2 = 1, remainder 1
1 ÷ 2 = 0, remainder 1
Thus 120 in binary is 1111000
(iii) (76)10 = (?)8
Step-by-Step Conversion
76 ÷ 8 = 9, remainder 4
9 ÷ 8 = 1, remainder 1
1 ÷ 8 = 0, remainder 1
This 76 in Octal is 114
(iv) (889)10 = (?)8
Step-by-Step Conversion
889 ÷ 8 = 111, remainder 1
111 ÷ 8 = 13, remainder 7
13 ÷ 8 = 1, remainder 5
1 ÷ 8 = 0, remainder 1
Thus 889 in Octal is 1571
(v) (789)10 = (?)16
Step-by-Step Conversion
789 ÷ 16 = 49, remainder 5
49 ÷ 16 = 3, remainder 1
3 ÷ 16 = 0, remainder 3
Thus 789 in hexadecimal is 315
(vi) (108)10 = (?)16
Step-by-Step Conversion
108 ÷ 16 = 6, remainder 12 (which is represented as C in hexadecimal)
6 ÷ 16 = 0, remainder 6
Thus 108 in Hexadecimal is 6C
5. Try the following conversions from Octal to Decimal:
(i) 145
Steps:
( 1 × 82 ) + (4 × 81 ) + ( 5 × 80 )
= ( 1 × 64 ) + ( 4 × 8 ) + ( 5 × 1 )
= 64 + 32 + 5
= 101
Thus 145 in Octal is 101 in Decimal
(ii) 6760
Steps:
( 6 × 83 ) + ( 7 × 82 ) + ( 6 × 81 ) + ( 0 × 80 )
= ( 6 × 512 ) + ( 7 × 64 ) + ( 6 × 8 ) + ( 0 × 1 )
= 3072 + 448 + 48 + 0
= 3568
Thus 6760 in Octal is 3568 in Decimal.
(iii) 455
Steps:
( 4 × 82 ) + ( 5 × 81 ) + ( 5 × 80 )
= ( 4 × 64 ) + ( 5 × 8 ) + ( 5 × 1 )
= 256 + 40 + 5
= 301
Thus 455 in Octal is 301 in Decimal
(iv) 10.75
Steps:
Calculate the Decimal value:
( 1 × 81 ) + ( 0 × 80 )
= ( 1 × 8 ) + ( 0 × 1 )
= 8 + 0
= 8
Convert the fractional part (0.75)
( 7 × 8−1 ) + ( 5 × 8−2 )
= ( 7 × 1/8 ) + ( 5 × 1/64 )
= 7/8 + 5/64
= 61/64
Now add both parts:
8 + 61/64
= 8.953125
6. Express the following decimal numbers to hexadecimal numbers:
(i) 548
Steps:
548 ÷ 16 = 34, remainder 4
34 ÷ 16 = 2, remainder 2
2 ÷ 16 = 0, remainder 2
Thus 548 is 224 in Hexadecimal
(ii) 4052
Steps:
4052 ÷ 16 = 253, remainder 4
253 ÷ 16 = 15, remainder 13 (which is represented as D in hexadecimal)
15 ÷ 16 = 0, remainder 15 (which is represented as F in hexadecimal)
Thus 4052 is FD4 in Hexadecimal
(iii) 58
Steps:
58 ÷ 16 = 3, remainder 10 (which is represented as A in hexadecimal)
3 ÷ 16 = 0, remainder 3
Thus 58 is 3A in Hexadecimal
(iv) 100.25
Step 1: Convert the Integer Part (100)
100 ÷ 16 = 6, remainder 4
6 ÷ 16 = 0, remainder 6
Step 2: Convert the Fractional Part (0.25)
Multiply by 16:
0.25 × 16 = 4.0
Thus 100.25 in Hexadecimal is 64.4
7. Express the following hexadecimal numbers into equivalent decimal numbers.
(i) 4A2
Identify the positions and their values:
The hexadecimal number is read from right to left, where each digit’s position corresponds to a power of 16.
The digits in 4A2 are:
- 22 in the 160 (ones) place
- AA (which is 10 in decimal) in the 161 (sixteens) place
- 4 in the 162 (two hundred fifty-sixes) place
Calculate the decimal value for each digit:
2 × 160 = 2 × 1 = 2
10 × 161 = 10 × 16 = 160
4 × 162 = 4 × 256 = 1024
Sum all the values:
1024 + 160 + 2 = 1186
Thus 4A2 in Decimal is 1186
(ii) 9E1A
Calculate decimal value for each digit:
9 × 163 = 9 × 4096 = 36864
14 × 162 = 14 × 256 = 3584
1 × 161 = 1 × 16 = 16
10 × 160 = 10 × 1 = 10
Sum all the values: 40474
(iii) 6BD
Calculate decimal value for each digit:
6 × 162 = 6 × 256 = 1536
11 × 161 = 11 × 16 = 176
13 × 160 = 13 × 1 = 13
Sum all the values: 1725
(iv) 6C.34
Calculate decimal value for integer part (6C)
6 × 161 = 6 × 16 = 96
12 × 160 = 12 × 1 = 12
Convert the fractional part (.34)
3 × 16−1 = 0.1875
4 × 16−2 = 0.015625
Sum all values and combine both parts to get the answer: 108.203125.
8. Convert the following binary numbers into octal and hexadecimal numbers.
(i) 1110001000
Convert to Decimal first: 904
Now, convert 904 to Octal:
904 ÷ 8 = 113 with a remainder of 0
113 ÷ 8 = 14 with a remainder of 1
14 ÷ 8 = 1 with a remainder of 6
1 ÷ 8 = 0 with a remainder of 1
Octal value: 1610
Now, convert 904 to Hexadecimal:
904 ÷ 16 = 56 with a remainder of 8
56 ÷ 16 = 3 with a remainder of 8
3 ÷ 16 = 0 with a remainder of 3
Hexadecimal value: 388
(ii) 110110101
Convert to Decimal first: 437
Now convert 437 to Octal:
437 ÷ 8 = 54 with a remainder of 5
54 ÷ 8 = 6 with a remainder of 6
6 ÷ 8 = 0 with a remainder of 6
Octal value: 665
Now convert 437 to Hexadecimal:
437 ÷ 16 = 27 with a remainder of 5
27 ÷ 16 = 1 with a remainder of 11 (which is represented as B in hexadecimal)
1 ÷ 16 = 0 with a remainder of 1
Hexadecimal value: 1B5
(iii) 1010100
Convert to Decimal first: 84
Now convert 84 to Octal:
84 ÷ 8 = 10 with a remainder of 4
10 ÷ 8 = 1 with a remainder of 2
1 ÷ 8 = 0 with a remainder of 1
Octal value: 124
Now convert 84 to Hexadecimal:
84 ÷ 16 = 5 with a remainder of 4
5 ÷ 16 = 0 with a remainder of 5
Hexadecimal value: 54
(iv) 1010.1001
Convert to Decimal first: 10.5625
Now convert 10.5625 to Octal:
Integer Part:
10 ÷ 8 = 1 with a remainder of 2
1 ÷ 8 = 0 with a remainder of 1
Fractional Part:
0.5625 × 8 = 4.5 (Take the integer part, which is 4)
0.5 × 8 = 4.0 (Take the integer part, which is 4)
Octal value: 12.44
Now convert 10.5625 to Hexadecimal
Integer Part:
10 ÷ 16 = 0 with a remainder of 10 (which is represented as A in hexadecimal)
Fractional Part:
0.5625 × 16 = 9.0 (Take the integer part, which is 9)
Hexadecimal value: A.9
9. Write binary equivalent of the following octal numbers.
(i) 2306
Convert to Decimal: 1222
Now convert 1222 to Binary:
1222 ÷ 2 = 611 with a remainder of 0
611 ÷ 2 = 305 with a remainder of 1
305 ÷ 2 = 152 with a remainder of 1
152 ÷ 2 = 76 with a remainder of 0
76 ÷ 2 = 38 with a remainder of 0
38 ÷ 2 = 19 with a remainder of 0
19 ÷ 2 = 9 with a remainder of 1
9 ÷ 2 = 4 with a remainder of 1
4 ÷ 2 = 2 with a remainder of 0
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Binary value: 1 0 0 1 1 0 0 0 1 1 0
(ii) 5610
Convert to Decimal: 2952
Now convert 2952 to Binary:
2952 ÷ 2 = 1476 with a remainder of 0
1476 ÷ 2 = 738 with a remainder of 0
738 ÷ 2 = 369 with a remainder of 0
369 ÷ 2 = 184 with a remainder of 1
184 ÷ 2 = 92 with a remainder of 0
92 ÷ 2 = 46 with a remainder of 0
46 ÷ 2 = 23 with a remainder of 0
23 ÷ 2 = 11 with a remainder of 1
11 ÷ 2 = 5 with a remainder of 1
5 ÷ 2 = 2 with a remainder of 1
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Binary value: 101110001000
(iii) 742
Convert to Decimal: 482
Now convert 482 to Binary:
482 ÷ 2 = 241 with a remainder of 0
241 ÷ 2 = 120 with a remainder of 1
120 ÷ 2 = 60 with a remainder of 0
60 ÷ 2 = 30 with a remainder of 0
30 ÷ 2 = 15 with a remainder of 0
15 ÷ 2 = 7 with a remainder of 1
7 ÷ 2 = 3 with a remainder of 1
3 ÷ 2 = 1 with a remainder of 1
1 ÷ 2 = 0 with a remainder of 1
Binary value: 111100010
(iv) 65.203
Convert to Decimal: 53.255859375
Now convert 53.255859375 to Binary:
Integer Part:
53 ÷ 2 = 26 with a remainder of 1
26 ÷ 2 = 13 with a remainder of 0
13 ÷ 2 = 6 with a remainder of 1
6 ÷ 2 = 3 with a remainder of 0
3 ÷ 2 = 1 with a remainder of 1
1 ÷ 2 = 0 with a remainder of 1
Fractional Part:
0.255859375 × 2 = 0.51171875 (integer part = 0)
0.51171875 × 2 = 1.0234375 (integer part = 1)
0.0234375 × 2 = 0.046875 (integer part = 0)
0.046875 × 2 = 0.09375 (integer part = 0)
0.09375 × 2 = 0.1875 (integer part = 0)
0.1875 × 2 = 0.375 (integer part = 0)
0.375 × 2 = 0.75 (integer part = 0)
0.75 × 2 = 1.5 (integer part = 1)
0.5 × 2 = 1.0 (integer part = 1, and we stop here as we reach zero)
Thus 65.203 in Binary is: 110101 . 010000011
10. Write binary representation of the following hexadecimal numbers:
(i) 4026
Convert to Decimal: 16422
Now convert 16422 to Binary:
16422 ÷ 2 = 8211 with a remainder of 0
8211 ÷ 2 = 4105 with a remainder of 1
4105 ÷ 2 = 2052 with a remainder of 1
2052 ÷ 2 = 1026 with a remainder of 0
1026 ÷ 2 = 513 with a remainder of 0
513 ÷ 2 = 256 with a remainder of 1
256 ÷ 2 = 128 with a remainder of 0
128 ÷ 2 = 64 with a remainder of 0
64 ÷ 2 = 32 with a remainder of 0
32 ÷ 2 = 16 with a remainder of 0
16 ÷ 2 = 8 with a remainder of 0
8 ÷ 2 = 4 with a remainder of 0
4 ÷ 2 = 2 with a remainder of 0
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Binary value: 100000000100110
(ii) BCA1
Convert to Decimal: 48289
Now convert 48289 to Binary:
48289 ÷ 2 = 24144 with a remainder of 1
24144 ÷ 2 = 12072 with a remainder of 0
12072 ÷ 2 = 6036 with a remainder of 0
6036 ÷ 2 = 3018 with a remainder of 0
3018 ÷ 2 = 1509 with a remainder of 0
1509 ÷ 2 = 754 with a remainder of 1
754 ÷ 2 = 377 with a remainder of 0
377 ÷ 2 = 188 with a remainder of 1
188 ÷ 2 = 94 with a remainder of 0
94 ÷ 2 = 47 with a remainder of 0
47 ÷ 2 = 23 with a remainder of 1
23 ÷ 2 = 11 with a remainder of 1
11 ÷ 2 = 5 with a remainder of 1
5 ÷ 2 = 2 with a remainder of 1
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Binary value: 1011110010100001
(iii) 98E
Convert to Decimal: 2446
Now convert 2446 to Binary:
2446 ÷ 2 = 1223 with a remainder of 0
1223 ÷ 2 = 611 with a remainder of 1
611 ÷ 2 = 305 with a remainder of 1
305 ÷ 2 = 152 with a remainder of 1
152 ÷ 2 = 76 with a remainder of 0
76 ÷ 2 = 38 with a remainder of 0
38 ÷ 2 = 19 with a remainder of 0
19 ÷ 2 = 9 with a remainder of 1
9 ÷ 2 = 4 with a remainder of 1
4 ÷ 2 = 2 with a remainder of 0
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Binary value: 100110001110
(iv) 132.45
Convert to Decimal: 306.26953125
Now convert the integer part to Binary:
306 ÷ 2 = 153 with a remainder of 0
153 ÷ 2 = 76 with a remainder of 1
76 ÷ 2 = 38 with a remainder of 0
38 ÷ 2 = 19 with a remainder of 0
19 ÷ 2 = 9 with a remainder of 1
9 ÷ 2 = 4 with a remainder of 1
4 ÷ 2 = 2 with a remainder of 0
2 ÷ 2 = 1 with a remainder of 0
1 ÷ 2 = 0 with a remainder of 1
Now convert the fraction part to Binary:
0.26953125 × 2 = 0.5390625 (integer part = 0)
0.5390625 × 2 = 1.078125 (integer part = 1)
0.078125 × 2 = 0.15625 (integer part = 0)
0.15625 × 2 = 0.3125 (integer part = 0)
0.3125 × 2 = 0.625 (integer part = 0)
0.625 × 2 = 1.25 (integer part = 1)
0.25 × 2 = 0.5 (integer part = 0)
0.5 × 2 = 1.0 (integer part = 1, and we stop here as we reach zero)
Combine to get final Binary value: 100110010 . 01000101
11. How does computer understand the following text? (hint: 7 bit ASCII code).
(i) HOTS
Each character in “HOTS” has a specific ASCII value:
H: ASCII = 72, Binary = 1001000
O: ASCII = 79, Binary = 1001111
T: ASCII = 84, Binary = 1010100
S: ASCII = 83, Binary = 1010011
(ii) Main
M: ASCII = 77, Binary = 1001101
a: ASCII = 97, Binary = 1100001
i: ASCII = 105, Binary = 1101001
n: ASCII = 110, Binary = 1101110
(iii) CaSe
C: ASCII = 67 Binary = 1000011
a: ASCII = 97 Binary = 1100001
S: ASCII = 83 Binary = 1010011
e: ASCII = 101 Binary = 1100101
12. The hexadecimal number system uses 16 literals (0 – 9, A– F). Write down its base value.
The base value in Hexadecimal system is: 16
13. Let X be a number system having B symbols only. Write down the base value of this number system.
In a number system where XX has BB symbols, the base value of that number system is B.
Example:
In the Decimal system (base-10), there are 10 symbols (0-9), so B=10
In the Binary system (base-2), there are 2 symbols (0 and 1), so B=2
In the Hexadecimal system (base-16), there are 16 symbols (0-9 and A-F), so B=16.
14. Write the equivalent hexadecimal and binary values for each character of the phrase given below. हम सब एक.
Representation:
ह: Hex = 0939, Binary = 0000100100111001
म: Hex = 092E, Binary = 0000100100101110
स: Hex = 0938, Binary = 0000100100111000
ब: Hex = 092C, Binary = 0000100100101100
ए: Hex = 090F, Binary = 0000100100001111
क: Hex = 0915, Binary = 0000100100010101
15. What is the advantage of preparing a digital content in Indian language using UNICODE font?
- Universal Compatibility: Ensures consistent display across various devices and operating systems without needing specific font installations.
- Multilingual Support: Allows seamless integration of multiple Indian languages on a single platform.
- Consistent Representation: Maintains uniformity in text appearance, reducing misinterpretation when sharing content.
- Ease of Use: Simplifies typing and displaying text without requiring special software or encoding schemes.
17. Encode the word ‘COMPUTER’ using ASCII and convert the encode value into Binary value.
Character | ASCII Value | Binary |
C | 67 | 1000011 |
O | 79 | 1001111 |
M | 77 | 1001101 |
P | 80 | 1010000 |
U | 85 | 1010101 |
T | 84 | 1010100 |
E | 69 | 1000101 |
R | 82 | 1010010 |