© 2026 schoolict.net (Ruwan Mangala Suraweera)
3.3 Binary ↔ Decimal, Octal and Hexadecimal ConversionsBinary ↔ දශම, Octal සහ Hexadecimal හැරවීම්
G.C.E. O/L Grade 10 ICT · Lesson 3G.C.E. O/L ICT · 10 ශ්රේණිය · පාඩම 3
In this videoමේ වීඩියෝවේ
- Binary → decimal: add place values of the 1s.Binary → දශම: 1 ඇති ස්ථානවල අගය එකතු කරන්න.
- Binary → octal: groups of 3 from the right.Binary → octal: දකුණේ සිට 3 බැගින්.
- Binary → hex: groups of 4 from the right.Binary → hex: දකුණේ සිට 4 බැගින්.
- Add leading 0s to complete the last group.අවසාන කාණ්ඩයට වමට 0 එකතු කරන්න.
- Octal ↔ hex: go through binary.Octal ↔ hex: binary හරහා යන්න.
Notesසටහන්
Now we go the other way. You will convert binary to decimal using place values, and convert binary ↔ octal and binary ↔ hexadecimal quickly by grouping bits in 3s and 4s. Finally you will convert octal ↔ hexadecimal through binary. Only positive whole numbers are used.දැන් අපි අනෙක් පැත්තට යමු. ස්ථානීය අගය භාවිතයෙන් binary → දශම ද, bit 3 සහ 4 කාණ්ඩ කිරීමෙන් binary ↔ octal සහ binary ↔ hexadecimal ද ඉක්මනින් හරවමු. අවසානයේ binary හරහා octal ↔ hexadecimal හරවමු. ධන පූර්ණ සංඛ්යා පමණක් භාවිතා වේ.
1. Binary → decimal (place value method)1. Binary → දශම (ස්ථානීය අගය ක්රමය)
Write the place values (1, 2, 4, 8 …) under each bit from the right. Add the place values where the bit is 1.දකුණේ සිට සෑම bit එකකටම යටින් ස්ථානීය අගය (1, 2, 4, 8 …) ලියන්න. Bit එක 1 වන ස්ථානවල අගයන් එකතු කරන්න.
Worked example 1: 101101₂ → decimalඋදාහරණය 1: 101101₂ → දශම
| Digitඉලක්කම | 11 | 00 | 11 | 11 | 00 | 11 |
|---|---|---|---|---|---|---|
| Place valueස්ථානීය අගය | 2⁵ = 322⁵ = 32 | 2⁴ = 162⁴ = 16 | 2³ = 82³ = 8 | 2² = 42² = 4 | 2¹ = 22¹ = 2 | 2⁰ = 12⁰ = 1 |
| Digit × place valueඉලක්කම × ස්ථානීය අගය | 1 × 32 = 321 × 32 = 32 | 0 × 16 = 00 × 16 = 0 | 1 × 8 = 81 × 8 = 8 | 1 × 4 = 41 × 4 = 4 | 0 × 2 = 00 × 2 = 0 | 1 × 1 = 11 × 1 = 1 |
The same method works for octal and hex → decimal: multiply each digit by its place value and add.Octal සහ hex → දශම සඳහාද එම ක්රමයමයි: සෑම ඉලක්කමක්ම ස්ථානීය අගයෙන් ගුණ කර එකතු කරන්න.
Worked example 2: 3A7₁₆ → decimalඋදාහරණය 2: 3A7₁₆ → දශම
| Digitඉලක්කම | 33 | AA | 77 |
|---|---|---|---|
| Place valueස්ථානීය අගය | 16² = 25616² = 256 | 16¹ = 1616¹ = 16 | 16⁰ = 116⁰ = 1 |
| Digit × place valueඉලක්කම × ස්ථානීය අගය | 3 × 256 = 7683 × 256 = 768 | 10 × 16 = 16010 × 16 = 160 | 7 × 1 = 77 × 1 = 7 |
2. Binary ↔ octal (groups of 3)2. Binary ↔ octal (bit 3 කාණ්ඩ)
Because 8 = 2³, one octal digit = exactly 3 bits. Group the bits in threes from the right; add 0s on the left if needed. Change each group to one digit.8 = 2³ නිසා octal ඉලක්කම් 1 = bit 3 හරියටම. Bits දකුණේ සිට තුන බැගින් කාණ්ඩ කරන්න; අවශ්ය නම් වමට 0 එකතු කරන්න. සෑම කාණ්ඩයක්ම එක් ඉලක්කමකට හරවන්න.
| OctalOctal | 00 | 11 | 22 | 33 | 44 | 55 | 66 | 77 |
|---|---|---|---|---|---|---|---|---|
| BinaryBinary | 000000 | 001001 | 010010 | 011011 | 100100 | 101101 | 110110 | 111111 |
Worked example 3: 1101011₂ → octalඋදාහරණය 3: 1101011₂ → octal
| Groupකාණ්ඩය | 001001 | 101101 | 011011 |
|---|---|---|---|
| Valueඅගය | 11 | 55 | 33 |
Worked example 4: 572₈ → binaryඋදාහරණය 4: 572₈ → binary
| Digitඉලක්කම | 55 | 77 | 22 |
|---|---|---|---|
| Bitsබිටු | 101101 | 111111 | 010010 |
3. Binary ↔ hexadecimal (groups of 4)3. Binary ↔ hexadecimal (bit 4 කාණ්ඩ)
Because 16 = 2⁴, one hex digit = exactly 4 bits (a nibble). Group from the right in fours.16 = 2⁴ නිසා hex ඉලක්කම් 1 = bit 4 හරියටම (nibble). දකුණේ සිට හතර බැගින් කාණ්ඩ කරන්න.
| HexHex | 00 | 11 | 22 | 33 | 44 | 55 | 66 | 77 | 88 | 99 | AA | BB | CC | DD | EE | FF |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BinaryBinary | 00000000 | 00010001 | 00100010 | 00110011 | 01000100 | 01010101 | 01100110 | 01110111 | 10001000 | 10011001 | 10101010 | 10111011 | 11001100 | 11011101 | 11101110 | 11111111 |
Worked example 5: 1011111010₂ → hexadecimalඋදාහරණය 5: 1011111010₂ → hexadecimal
| Groupකාණ්ඩය | 00100010 | 11111111 | 10101010 |
|---|---|---|---|
| Valueඅගය | 22 | FF | AA |
Worked example 6: 9C₁₆ → binaryඋදාහරණය 6: 9C₁₆ → binary
| Digitඉලක්කම | 99 | CC |
|---|---|---|
| Bitsබිටු | 10011001 | 11001100 |
4. Octal ↔ hexadecimal (via binary)4. Octal ↔ hexadecimal (binary හරහා)
There is no direct grouping between 8 and 16. Go through binary: octal → binary (3 bits each) → regroup in 4s → hex, and the reverse for hex → octal.8 සහ 16 අතර සෘජු කාණ්ඩ කිරීමක් නැත. Binary හරහා යන්න: octal → binary (බැගින් bit 3) → 4 බැගින් නැවත කාණ්ඩ → hex; hex → octal සඳහා ප්රතිවිරුද්ධව.
Worked example 7: 357₈ → hexadecimalඋදාහරණය 7: 357₈ → hexadecimal
| Digitඉලක්කම | 33 | 55 | 77 |
|---|---|---|---|
| Bitsබිටු | 011011 | 101101 | 111111 |
| Groupකාණ්ඩය | 11101110 | 11111111 |
|---|---|---|
| Valueඅගය | EE | FF |
Worked example 8: 2B₁₆ → octalඋදාහරණය 8: 2B₁₆ → octal
| Digitඉලක්කම | 22 | BB |
|---|---|---|
| Bitsබිටු | 00100010 | 10111011 |
| Groupකාණ්ඩය | 101101 | 011011 |
|---|---|---|
| Valueඅගය | 55 | 33 |
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1Convert 11010₂ to decimal.11010₂ දශම වලට හරවන්න.
2Why do we group bits in 3s for octal?Octal සඳහා bits 3 බැගින් කාණ්ඩ කරන්නේ ඇයි?
3Convert 11110110₂ to hexadecimal.11110110₂ hexadecimal වලට හරවන්න.
4Convert 47₈ to binary.47₈ binary වලට හරවන්න.
5From which side do you start grouping bits?Bits කාණ්ඩ කිරීම ආරම්භ කරන්නේ කුමන පැත්තෙන්ද?
6How do you convert octal to hexadecimal?Octal → hexadecimal හරවන්නේ කෙසේද?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1What is 101101₂ in decimal?101101₂ දශම වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
32+8+4+1 = 45.32+8+4+1 = 45.
2What is 1111₂ in decimal?1111₂ දශම වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
8+4+2+1 = 15.8+4+2+1 = 15.
3What is 1100100₂ in decimal?1100100₂ දශම වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
64+32+4 = 100.64+32+4 = 100.
4What is 1101011₂ in octal?1101011₂ octal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
001 101 011 → 1 5 3.001 101 011 → 1 5 3.
5What is 1011111010₂ in hexadecimal?1011111010₂ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
0010 1111 1010 → 2 F A.0010 1111 1010 → 2 F A.
6What is 572₈ in binary?572₈ binary වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
5→101, 7→111, 2→010.5→101, 7→111, 2→010.
7What is 9C₁₆ in binary?9C₁₆ binary වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
9→1001, C→1100.9→1001, C→1100.
8When converting binary to hexadecimal, bits are grouped in:Binary → hexadecimal හැරවීමේදී bits කාණ්ඩ කරන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
16 = 2⁴; start at the LSB.16 = 2⁴; LSB වලින් පටන් ගන්න.
9What is 357₈ in hexadecimal?357₈ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
357₈ = 11101111₂ = EF₁₆.357₈ = 11101111₂ = EF₁₆.
10What is 2B₁₆ in octal?2B₁₆ octal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
2B = 101011₂ = 101 011 = 53₈.2B = 101011₂ = 101 011 = 53₈.
11What is 3A7₁₆ in decimal?3A7₁₆ දශම වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
3×256 + 10×16 + 7 = 935.3×256 + 10×16 + 7 = 935.
12What is 11110110₂ in hexadecimal?11110110₂ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
1111 0110 → F6.1111 0110 → F6.
13One hexadecimal digit is equal to how many bits?Hexadecimal ඉලක්කම් එකක් bits කීයකට සමානද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
16 = 2⁴ → 4 bits.16 = 2⁴ → bit 4.
14What is 75₈ in decimal?75₈ දශම වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
7×8 + 5 = 61.7×8 + 5 = 61.
15Which binary number equals 7F₁₆?7F₁₆ ට සමාන binary අංකය?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
7→0111, F→1111 → 1111111.7→0111, F→1111 → 1111111.
MCQ answer keyMCQ පිළිතුරු
- A – 32+8+4+1 = 45.32+8+4+1 = 45.
- C – 8+4+2+1 = 15.8+4+2+1 = 15.
- A – 64+32+4 = 100.64+32+4 = 100.
- B – 001 101 011 → 1 5 3.001 101 011 → 1 5 3.
- C – 0010 1111 1010 → 2 F A.0010 1111 1010 → 2 F A.
- D – 5→101, 7→111, 2→010.5→101, 7→111, 2→010.
- C – 9→1001, C→1100.9→1001, C→1100.
- D – 16 = 2⁴; start at the LSB.16 = 2⁴; LSB වලින් පටන් ගන්න.
- B – 357₈ = 11101111₂ = EF₁₆.357₈ = 11101111₂ = EF₁₆.
- A – 2B = 101011₂ = 101 011 = 53₈.2B = 101011₂ = 101 011 = 53₈.
- B – 3×256 + 10×16 + 7 = 935.3×256 + 10×16 + 7 = 935.
- C – 1111 0110 → F6.1111 0110 → F6.
- A – 16 = 2⁴ → 4 bits.16 = 2⁴ → bit 4.
- D – 7×8 + 5 = 61.7×8 + 5 = 61.
- B – 7→0111, F→1111 → 1111111.7→0111, F→1111 → 1111111.
Structured Questionsව්යුහගත ප්රශ්න
1Convert 10110011₂ to (i) decimal (ii) octal (iii) hexadecimal. Show working. (6 marks)10110011₂ (i) දශම (ii) octal (iii) hexadecimal වලට හරවන්න. ක්රියාවලිය පෙන්වන්න. (ලකුණු 6) (6 marksලකුණු 6)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
(ii) 010 110 011 → 263₈
(iii) 1011 0011 → B3₁₆(i) 128+32+16+2+1 = 179₁₀
(ii) 010 110 011 → 263₈
(iii) 1011 0011 → B3₁₆
2Convert 645₈ to binary and then to hexadecimal. (4 marks)645₈ binary වලට, පසුව hexadecimal වලට හරවන්න. (ලකුණු 4) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Convert A5₁₆ to (i) binary (ii) octal (iii) decimal. (3 marks)A5₁₆ (i) binary (ii) octal (iii) දශම වලට හරවන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4A student converted 1101101₂ to hex as 1101 101 → D5. (i) What mistake was made? (1 mark) (ii) Give the correct answer. (2 marks)සිසුවෙක් 1101101₂ hex වලට 1101 101 → D5 ලෙස හැරෙව්වා. (i) කළ වරද කුමක්ද? (ලකුණු 1) (ii) නිවැරදි පිළිතුර දෙන්න. (ලකුණු 2) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Arrange in ascending order after converting to decimal: 1110₂, 17₈, 10₁₆. (3 marks)දශම වලට හරවා ආරෝහණ පිළිවෙළට සකසන්න: 1110₂, 17₈, 10₁₆. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
6Convert 1F₁₆ to octal using binary. Show both steps. (3 marks)Binary හරහා 1F₁₆ octal වලට හරවන්න. පියවර දෙකම පෙන්වන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Binary → decimal: add place values where the bit is 1.Binary → දශම: bit 1 වන ස්ථානවල අගයන් එකතු කරන්න.
- Octal/hex → decimal: digit × place value, then add.Octal/hex → දශම: ඉලක්කම × ස්ථානීය අගය, පසුව එකතු කරන්න.
- 1 octal digit = 3 bits (8 = 2³).Octal ඉලක්කම් 1 = bit 3 (8 = 2³).
- 1 hex digit = 4 bits (16 = 2⁴), called a nibble.Hex ඉලක්කම් 1 = bit 4 (16 = 2⁴), nibble.
- Always group from the right; add leading 0s on the left.හැම විටම දකුණේ සිට කාණ්ඩ කරන්න; වමට 0 එකතු කරන්න.
- Octal/hex → binary: write each digit as 3 or 4 bits.Octal/hex → binary: සෑම ඉලක්කමක්ම bit 3 හෝ 4 ලෙස.
- Octal ↔ hex: go through binary and regroup.Octal ↔ hex: binary හරහා ගොස් නැවත කාණ්ඩ කරන්න.
- Check answers by converting both to decimal.දෙකම දශම වලට හරවා පිළිතුරු පරීක්ෂා කරන්න.
