© 2026 schoolict.net (Ruwan Mangala Suraweera)
3.2 Decimal to Binary, Octal and Hexadecimalදශම සිට Binary, Octal සහ Hexadecimal
G.C.E. O/L Grade 10 ICT · Lesson 3G.C.E. O/L ICT · 10 ශ්රේණිය · පාඩම 3
In this videoමේ වීඩියෝවේ
- Bases: binary 2, octal 8, decimal 10, hex 16.පාද: binary 2, octal 8, දශම 10, hex 16.
- Hex digits A–F = 10–15.Hex ඉලක්කම් A–F = 10–15.
- Octal place values 1, 8, 64; hex 1, 16, 256.Octal ස්ථානීය අගය 1, 8, 64; hex 1, 16, 256.
- Divide by the new base again and again.නව පාදයෙන් නැවත නැවත බෙදන්න.
- Read remainders bottom to top, then check.ශේෂ පහළ සිට ඉහළට කියවා පරීක්ෂා කරන්න.
Notesසටහන්
Computers use binary, but long strings of 1s and 0s are hard for people to read. So programmers also use octal (base 8) and hexadecimal (base 16). In this note you will learn the four number systems, their place values, and how to convert a decimal number to any of them using repeated division.පරිගණක binary භාවිතා කළත්, 1, 0 දිගු පේළි මිනිසුන්ට කියවීම අපහසුයි. ඒ නිසා programmers octal (පාදය 8) සහ hexadecimal (පාදය 16) ද භාවිතා කරයි. සංඛ්යා පද්ධති හතර, ඒවායේ ස්ථානීය අගයන් සහ නැවත නැවත බෙදීම මගින් දශම අංකයක් ඒවාට හරවන හැටි මේ සටහනෙන් ඉගෙන ගමු.
1. Four number systems1. සංඛ්යා පද්ධති හතර
| Systemපද්ධතිය | Baseපාදය | Digits usedභාවිත ඉලක්කම් | Exampleඋදාහරණය |
|---|---|---|---|
| BinaryBinary (ද්විමය) | 22 | 0, 10, 1 | 1011₂1011₂ |
| OctalOctal (අෂ්ටමය) | 88 | 0 – 70 – 7 | 157₈157₈ |
| DecimalDecimal (දශම) | 1010 | 0 – 90 – 9 | 249₁₀249₁₀ |
| HexadecimalHexadecimal (ෂඩ් දශමය) | 1616 | 0 – 9, A – F0 – 9, A – F | 3F₁₆3F₁₆ |
The base tells you how many digits the system has. The biggest digit is always base − 1 (1 in binary, 7 in octal, 9 in decimal, F in hex).පාදය පද්ධතියේ ඉලක්කම් ගණන කියයි. විශාලතම ඉලක්කම හැම විටම පාදය − 1 (binary හි 1, octal හි 7, දශම හි 9, hex හි F).
2. Hexadecimal digits A–F2. Hexadecimal ඉලක්කම් A–F
Hex needs 16 single digits, so after 9 it uses letters:Hex වලට තනි ඉලක්කම් 16ක් අවශ්ය නිසා 9න් පසු අකුරු භාවිතා කරයි:
| HexHex | AA | BB | CC | DD | EE | FF |
|---|---|---|---|---|---|---|
| Decimalදශම | 1010 | 1111 | 1212 | 1313 | 1414 | 1515 |
3. Place values3. ස්ථානීය අගයන්
In every system the right-most place is worth 1 (base⁰). Each place to the left is worth base times more.හැම පද්ධතියකම දකුණු කෙළවරේ ස්ථානය 1 (පාදය⁰). වමට යන සෑම ස්ථානයක්ම පාදය ගුණයක් වැඩියි.
| Baseපාදය | 4th place4th place | 3rd place3rd place | 2nd place2nd place | 1st place1st place |
|---|---|---|---|---|
| 22 | 2³ = 82³ = 8 | 2² = 42² = 4 | 2¹ = 22¹ = 2 | 2⁰ = 12⁰ = 1 |
| 88 | 8³ = 5128³ = 512 | 8² = 648² = 64 | 8¹ = 88¹ = 8 | 8⁰ = 18⁰ = 1 |
| 1010 | 10³ = 100010³ = 1000 | 10² = 10010² = 100 | 10¹ = 1010¹ = 10 | 10⁰ = 110⁰ = 1 |
| 1616 | 16³ = 409616³ = 4096 | 16² = 25616² = 256 | 16¹ = 1616¹ = 16 | 16⁰ = 116⁰ = 1 |
4. Repeated division method4. නැවත නැවත බෙදීමේ ක්රමය
- Divide the decimal number by the new base (2, 8 or 16).දශම අංකය නව පාදයෙන් (2, 8 හෝ 16) බෙදන්න.
- Write down the remainder.ශේෂය ලියන්න.
- Divide the quotient again; repeat until the quotient is 0.ලබ්ධිය නැවත බෙදන්න; ලබ්ධිය 0 වන තුරු කරන්න.
- Read the remainders from bottom to top. In hex, change 10–15 to A–F.ශේෂ පහළ සිට ඉහළට කියවන්න. Hex හි 10–15 → A–F.
Worked example 1: 47₁₀ → binaryඋදාහරණය 1: 47₁₀ → binary
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 47 ÷ 247 ÷ 2 | 2323 | 11 |
| 23 ÷ 223 ÷ 2 | 1111 | 11 |
| 11 ÷ 211 ÷ 2 | 55 | 11 |
| 5 ÷ 25 ÷ 2 | 22 | 11 |
| 2 ÷ 22 ÷ 2 | 11 | 00 |
| 1 ÷ 21 ÷ 2 | 00 | 11 |
Worked example 2: 156₁₀ → octalඋදාහරණය 2: 156₁₀ → octal
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 156 ÷ 8156 ÷ 8 | 1919 | 44 |
| 19 ÷ 819 ÷ 8 | 22 | 33 |
| 2 ÷ 82 ÷ 8 | 00 | 22 |
| Digitඉලක්කම | 22 | 33 | 44 |
|---|---|---|---|
| Place valueස්ථානීය අගය | 8² = 648² = 64 | 8¹ = 88¹ = 8 | 8⁰ = 18⁰ = 1 |
| Digit × place valueඉලක්කම × ස්ථානීය අගය | 2 × 64 = 1282 × 64 = 128 | 3 × 8 = 243 × 8 = 24 | 4 × 1 = 44 × 1 = 4 |
Worked example 3: 500₁₀ → hexadecimalඋදාහරණය 3: 500₁₀ → hexadecimal
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 500 ÷ 16500 ÷ 16 | 3131 | 44 |
| 31 ÷ 1631 ÷ 16 | 11 | 15 = F15 = F |
| 1 ÷ 161 ÷ 16 | 00 | 11 |
5. Comparing the same number5. එකම අංකය සැසඳීම
| DecimalDecimal | BinaryBinary | OctalOctal | HexHex |
|---|---|---|---|
| 88 | 10001000 | 1010 | 88 |
| 1010 | 10101010 | 1212 | AA |
| 1515 | 11111111 | 1717 | FF |
| 1616 | 1000010000 | 2020 | 1010 |
| 6464 | 10000001000000 | 100100 | 4040 |
| 100100 | 11001001100100 | 144144 | 6464 |
| 255255 | 1111111111111111 | 377377 | FFFF |
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1What is the base of the octal number system and which digits does it use?Octal පද්ධතියේ පාදය සහ ඉලක්කම් මොනවාද?
2What do the letters A to F stand for in hexadecimal?Hexadecimal හි A සිට F දක්වා අකුරු නිරූපණය කරන්නේ?
3Convert 100₁₀ to octal.100₁₀ octal වලට හරවන්න.
4Convert 250₁₀ to hexadecimal.250₁₀ hexadecimal වලට හරවන්න.
5What are the first four place values in hexadecimal?Hexadecimal හි පළමු ස්ථානීය අගයන් හතර?
6Why do programmers use hexadecimal?Programmers hexadecimal භාවිතා කරන්නේ ඇයි?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1What is the base of the hexadecimal system?Hexadecimal පද්ධතියේ පාදය?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Hexa (6) + decimal (10) = 16.Hexa (6) + decimal (10) = 16.
2Which digit is NOT used in the octal system?Octal පද්ධතියේ භාවිතා නොවන ඉලක්කම?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Octal digits are 0–7.Octal ඉලක්කම් 0–7.
3In hexadecimal, the letter D stands for:Hexadecimal හි D අකුර නිරූපණය කරන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
A10 B11 C12 D13.A10 B11 C12 D13.
4What is 156₁₀ in octal?156₁₀ octal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Remainders 4, 3, 2 read upward → 234₈.ශේෂ 4, 3, 2 ඉහළට → 234₈.
5What is 250₁₀ in hexadecimal?250₁₀ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
250 = 15×16 + 10 → FA.250 = 15×16 + 10 → FA.
6What is 47₁₀ in binary?47₁₀ binary වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
32 + 8 + 4 + 2 + 1 = 47.32 + 8 + 4 + 2 + 1 = 47.
7The place value of the 3rd digit from the right in octal is:Octal හි දකුණේ සිට 3 වන ඉලක්කමේ ස්ථානීය අගය:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
8⁰=1, 8¹=8, 8²=64.8⁰=1, 8¹=8, 8²=64.
8The place value of the 3rd digit from the right in hexadecimal is:Hexadecimal හි දකුණේ සිට 3 වන ඉලක්කමේ ස්ථානීය අගය:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
16² = 256.16² = 256.
9What is 255₁₀ in hexadecimal?255₁₀ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
255 = 15×16 + 15 → FF.255 = 15×16 + 15 → FF.
10What is 64₁₀ in octal?64₁₀ octal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
64 = 1×8² → 100₈.64 = 1×8² → 100₈.
11What is 200₁₀ in hexadecimal?200₁₀ hexadecimal වලින්?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
200 = 12×16 + 8 → C8.200 = 12×16 + 8 → C8.
12When converting to hexadecimal, a remainder of 11 is written as:Hexadecimal වලට හැරවීමේදී ශේෂය 11 ලියන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
B = 11.B = 11.
13Which of these is a valid hexadecimal number?වලංගු hexadecimal අංකය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Hex digits are 0–9 and A–F only.Hex ඉලක්කම් 0–9 සහ A–F පමණි.
1416₁₀ written in hexadecimal is:16₁₀ hexadecimal වලින්:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
16 = 1×16 + 0 → 10₁₆.16 = 1×16 + 0 → 10₁₆.
15A web colour #FF0000 uses which number system?#FF0000 web වර්ණය භාවිතා කරන සංඛ්යා පද්ධතිය?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Colour codes are 6 hex digits (RRGGBB).වර්ණ කේත hex ඉලක්කම් 6 (RRGGBB).
MCQ answer keyMCQ පිළිතුරු
- B – Hexa (6) + decimal (10) = 16.Hexa (6) + decimal (10) = 16.
- D – Octal digits are 0–7.Octal ඉලක්කම් 0–7.
- A – A10 B11 C12 D13.A10 B11 C12 D13.
- B – Remainders 4, 3, 2 read upward → 234₈.ශේෂ 4, 3, 2 ඉහළට → 234₈.
- A – 250 = 15×16 + 10 → FA.250 = 15×16 + 10 → FA.
- C – 32 + 8 + 4 + 2 + 1 = 47.32 + 8 + 4 + 2 + 1 = 47.
- A – 8⁰=1, 8¹=8, 8²=64.8⁰=1, 8¹=8, 8²=64.
- D – 16² = 256.16² = 256.
- B – 255 = 15×16 + 15 → FF.255 = 15×16 + 15 → FF.
- A – 64 = 1×8² → 100₈.64 = 1×8² → 100₈.
- C – 200 = 12×16 + 8 → C8.200 = 12×16 + 8 → C8.
- C – B = 11.B = 11.
- B – Hex digits are 0–9 and A–F only.Hex ඉලක්කම් 0–9 සහ A–F පමණි.
- D – 16 = 1×16 + 0 → 10₁₆.16 = 1×16 + 0 → 10₁₆.
- C – Colour codes are 6 hex digits (RRGGBB).වර්ණ කේත hex ඉලක්කම් 6 (RRGGBB).
Structured Questionsව්යුහගත ප්රශ්න
1Copy and complete the table:
System | Base | Digits
Binary | ? | ?
Octal | ? | ?
Hexadecimal | ? | ? (4 marks)වගුව සම්පූර්ණ කරන්න:
පද්ධතිය | පාදය | ඉලක්කම්
Binary | ? | ?
Octal | ? | ?
Hexadecimal | ? | ? (ලකුණු 4) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Octal – 8 – 0 to 7
Hexadecimal – 16 – 0 to 9 and A to FBinary – 2 – 0, 1
Octal – 8 – 0 සිට 7
Hexadecimal – 16 – 0 සිට 9 සහ A සිට F
2Convert 83₁₀ to octal using repeated division. Show working. (3 marks)නැවත නැවත බෙදීමෙන් 83₁₀ octal වලට හරවන්න. ක්රියාවලිය පෙන්වන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Convert 175₁₀ to hexadecimal. Show working. (3 marks)175₁₀ hexadecimal වලට හරවන්න. ක්රියාවලිය පෙන්වන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4Convert 29₁₀ to (i) binary (ii) octal (iii) hexadecimal. (3 marks)29₁₀ (i) binary (ii) octal (iii) hexadecimal වලට හරවන්න. (ලකුණු 3) (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5(i) Write the place values of the first four positions in octal. (2 marks)
(ii) What is the largest single digit in base 8 and base 16? (2 marks)(i) Octal හි පළමු ස්ථාන හතරේ ස්ථානීය අගයන් ලියන්න. (ලකුණු 2)
(ii) පාදය 8 සහ 16 හි විශාලතම තනි ඉලක්කම? (ලකුණු 2) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
6A web designer wants the colour with red = 200, green = 30, blue = 255. Colour codes are written as #RRGGBB in hex. (i) Convert 200, 30 and 255 to hex. (3 marks) (ii) Write the colour code. (1 mark)Web නිර්මාණකරුවෙකුට රතු = 200, කොළ = 30, නිල් = 255 වර්ණය අවශ්යයි. වර්ණ කේත #RRGGBB ලෙස hex වලින් ලියයි. (i) 200, 30, 255 hex වලට හරවන්න. (ලකුණු 3) (ii) වර්ණ කේතය ලියන්න. (ලකුණු 1) (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Four number systems: binary (2), octal (8), decimal (10), hexadecimal (16).සංඛ්යා පද්ධති හතර: binary (2), octal (8), දශම (10), hexadecimal (16).
- The largest digit in a system is base − 1.පද්ධතියක විශාලතම ඉලක්කම = පාදය − 1.
- Hex uses A–F for 10–15.Hex හි 10–15 සඳහා A–F.
- Place values are powers of the base: 1, base, base², base³ …ස්ථානීය අගයන් පාදයේ බල: 1, පාදය, පාදය², පාදය³ …
- Octal place values: 1, 8, 64, 512. Hex: 1, 16, 256, 4096.Octal ස්ථානීය අගයන්: 1, 8, 64, 512. Hex: 1, 16, 256, 4096.
- Decimal → any base: divide by the base repeatedly, read remainders upward.දශම → ඕනෑම පාදයක්: පාදයෙන් නැවත නැවත බෙදා ශේෂ ඉහළට කියවන්න.
- Always check by multiplying digits by place values and adding.ඉලක්කම් ස්ථානීය අගයෙන් ගුණ කර එකතු කර පරීක්ෂා කරන්න.
- Hex is used for colour codes, MAC and IPv6 addresses.Hex වර්ණ කේත, MAC සහ IPv6 ලිපින සඳහා භාවිතා වේ.
