© 2026 schoolict.net (Ruwan Mangala Suraweera)
3.1 Number Systems and Signed Numbers: Binary, Octal, Hex and 2’s Complementසංඛ්යා පද්ධති සහ ලකුණු සහිත සංඛ්යා: ද්වීමය, අෂ්ටමය, ෂඩ්දශමය සහ 2 හි අනුපූරකය
Grade 12 A/L ICT · Lesson 312 ශ්රේණිය A/L ICT · පාඩම 3
In this videoමේ වීඩියෝවේ
- Computers use two states (0 and 1) because they are easy, reliable and match logic.පහසු, විශ්වාසදායක සහ තර්කයට ගැළපෙන නිසා පරිගණක අවස්ථා දෙකක් (0 සහ 1) භාවිත කරයි.
- Bases: decimal 10, binary 2, octal 8, hexadecimal 16 (A–F = 10–15).පාද: දශමය 10, ද්වීමය 2, අෂ්ටමය 8, ෂඩ්දශමය 16 (A–F = 10–15).
- Decimal → base: divide and read remainders bottom to top. Base → decimal: multiply by place values and add.දශමය → පාදය: බෙදා ශේෂ පහළ සිට ඉහළට කියවන්න. පාදය → දශමය: ස්ථානීය අගයෙන් ගුණ කර එකතු කරන්න.
- Binary ↔ octal: groups of 3 bits; binary ↔ hex: groups of 4 bits, from the right.ද්වීමය ↔ අෂ්ටමය: බිටු 3 කාණ්ඩ; ද්වීමය ↔ ෂඩ්දශමය: බිටු 4 කාණ්ඩ, දකුණේ සිට.
- Signed numbers use the MSB as the sign bit: sign-magnitude, 1’s complement (flip), 2’s complement (flip + 1).ලකුණු සහිත සංඛ්යා MSB ලකුණු බිටුව ලෙස යොදයි: ලකුණු-විශාලත්වය, 1 හි අනුපූරකය (පෙරළීම), 2 හි අනුපූරකය (පෙරළීම + 1).
Notesසටහන්
Syllabus 3.1. A computer stores everything as 0s and 1s. In this part you learn why only two states are used, the four number systems (decimal, binary, octal, hexadecimal), how to convert between them step by step, and how a computer stores negative numbers using sign-magnitude, 1’s complement and 2’s complement, where the most significant bit (MSB) is the sign bit.විෂය නිර්දේශය 3.1. පරිගණකය සියල්ල 0 සහ 1 ලෙස ගබඩා කරයි. මෙම කොටසින් අවස්ථා දෙකක් පමණක් භාවිත කරන්නේ ඇයි, සංඛ්යා පද්ධති හතර (දශමය, ද්වීමය, අෂ්ටමය, ෂඩ්දශමය), ඒවා අතර පියවරෙන් පියවර පරිවර්තනය කරන ආකාරය, සහ වැඩිම වෙසෙසි බිටුව (MSB) ලකුණු බිටුව ලෙස යොදා ලකුණු-විශාලත්ව, 1 හි අනුපූරක සහ 2 හි අනුපූරක ක්රම මගින් සෘණ සංඛ්යා ගබඩා කරන ආකාරය ඉගෙන ගනී.
1. Why computers use two states1. පරිගණක අවස්ථා දෙකක් භාවිත කරන්නේ ඇයි
Inside a computer, every circuit is like a switch: it is either ON or OFF. A wire has high voltage or low voltage, a disk spot is magnetised one way or the other, and a CD spot is a pit or a land. We write these two states as 1 and 0. One 0 or 1 is called a bit (binary digit).පරිගණකය තුළ සෑම පරිපථයක්ම ස්විචයක් වැනිය: එය ON හෝ OFF වේ. කම්බියක ඉහළ වෝල්ටීයතාවක් හෝ අඩු වෝල්ටීයතාවක් ඇත, තැටියක ලක්ෂ්යයක් එක් දිශාවකට හෝ අනෙක් දිශාවට චුම්බක වී ඇත, CD එකක ලක්ෂ්යයක් වළක් (pit) හෝ තලයක් (land) වේ. මේ අවස්ථා දෙක අපි 1 සහ 0 ලෙස ලියමු. එක් 0 හෝ 1 ක් බිටුවක් (ද්වීමය ඉලක්කම) ලෙස හැඳින්වේ.
- Two states are easy to make and detect – the circuit only has to tell high from low.අවස්ථා දෙකක් සෑදීමට සහ හඳුනාගැනීමට පහසුයි – පරිපථයට ඉහළ සහ පහළ වෙන්කර හඳුනාගැනීම පමණක් ප්රමාණවත්.
- They are reliable: a small amount of electrical noise does not change a 1 into a 0.ඒවා විශ්වාසදායකයි: සුළු විදුලි ඝෝෂාවක් 1 ක් 0 බවට වෙනස් නොකරයි.
- They match Boolean logic (true/false), so circuits can do arithmetic and decisions.ඒවා බූලියානු තර්කයට (සත්ය/අසත්ය) ගැළපේ, එබැවින් පරිපථවලට අංක ගණිතය සහ තීරණ ගත හැක.
- Groups of bits: 4 bits = nibble, 8 bits = byte. With n bits you get 2ⁿ different patterns.බිටු කාණ්ඩ: බිටු 4 = nibble, බිටු 8 = බයිටය. බිටු n කින් වෙනස් රටා 2ⁿ ක් ලැබේ.
8 bits: 2⁸ = 256 patterns (0 to 255). 16 bits: 2¹⁶ = 65,536 patterns.බිටු 8: 2⁸ = රටා 256 (0 සිට 255). බිටු 16: 2¹⁶ = රටා 65,536.
2. The four number systems2. සංඛ්යා පද්ධති හතර
Every number system has a base (radix) – the number of different digits it uses. The value of a digit depends on its place: each place is worth base × the place on its right.සෑම සංඛ්යා පද්ධතියකටම පාදයක් (radix) ඇත – එය භාවිත කරන වෙනස් ඉලක්කම් ගණන. ඉලක්කමක අගය එහි ස්ථානය මත රඳා පවතී: සෑම ස්ථානයක්ම එහි දකුණු පස ස්ථානය × පාදය අගයක් ගනී.
| Systemපද්ධතිය | Baseපාදය | Digitsඉලක්කම් | Place valuesස්ථානීය අගයන් | Exampleඋදාහරණය |
|---|---|---|---|---|
| Decimalදශමය | 1010 | 0–90–9 | … 1000, 100, 10, 1… 1000, 100, 10, 1 | 156₁₀156₁₀ |
| Binaryද්වීමය | 22 | 0, 10, 1 | … 8, 4, 2, 1… 8, 4, 2, 1 | 10011100₂10011100₂ |
| Octalඅෂ්ටමය | 88 | 0–70–7 | … 512, 64, 8, 1… 512, 64, 8, 1 | 234₈234₈ |
| Hexadecimalෂඩ්දශමය | 1616 | 0–9, A–F (A=10 … F=15)0–9, A–F (A=10 … F=15) | … 4096, 256, 16, 1… 4096, 256, 16, 1 | 9C₁₆9C₁₆ |
| Decimalදශමය | Binary (4 bits)ද්වීමය (බිටු 4) | Octalඅෂ්ටමය | Hexෂඩ්දශමය |
|---|---|---|---|
| 00 | 00000000 | 00 | 00 |
| 11 | 00010001 | 11 | 11 |
| 22 | 00100010 | 22 | 22 |
| 33 | 00110011 | 33 | 33 |
| 44 | 01000100 | 44 | 44 |
| 55 | 01010101 | 55 | 55 |
| 66 | 01100110 | 66 | 66 |
| 77 | 01110111 | 77 | 77 |
| 88 | 10001000 | 1010 | 88 |
| 99 | 10011001 | 1111 | 99 |
| 1010 | 10101010 | 1212 | AA |
| 1111 | 10111011 | 1313 | BB |
| 1212 | 11001100 | 1414 | CC |
| 1313 | 11011101 | 1515 | DD |
| 1414 | 11101110 | 1616 | EE |
| 1515 | 11111111 | 1717 | FF |
3. Decimal to binary, octal and hex – divide and keep the remainders3. දශමයෙන් ද්වීමය, අෂ්ටමය සහ ෂඩ්දශමය – බෙදා ශේෂ තබා ගන්න
Method: divide the decimal number by the new base again and again. Write down each remainder. Stop when the quotient is 0. Read the remainders from the bottom to the top.ක්රමය: දශම සංඛ්යාව නව පාදයෙන් නැවත නැවත බෙදන්න. සෑම ශේෂයක්ම ලියා ගන්න. ලබ්ධිය 0 වූ විට නවත්වන්න. ශේෂ පහළ සිට ඉහළට කියවන්න.
Divide by 2 (table below). Reading the remainders from bottom to top: 156₁₀ = 10011100₂. Check: 128 + 16 + 8 + 4 = 156.2 න් බෙදන්න (පහත වගුව). ශේෂ පහළ සිට ඉහළට කියවූ විට: 156₁₀ = 10011100₂. පරීක්ෂාව: 128 + 16 + 8 + 4 = 156.
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 156 ÷ 2156 ÷ 2 | 7878 | 00 |
| 78 ÷ 278 ÷ 2 | 3939 | 00 |
| 39 ÷ 239 ÷ 2 | 1919 | 11 |
| 19 ÷ 219 ÷ 2 | 99 | 11 |
| 9 ÷ 29 ÷ 2 | 44 | 11 |
| 4 ÷ 24 ÷ 2 | 22 | 00 |
| 2 ÷ 22 ÷ 2 | 11 | 00 |
| 1 ÷ 21 ÷ 2 | 00 | 11 |
Divide by 8: 156 ÷ 8 = 19 r 4, 19 ÷ 8 = 2 r 3, 2 ÷ 8 = 0 r 2. Bottom to top: 234₈. Check: 2×64 + 3×8 + 4 = 156.8 න් බෙදන්න: 156 ÷ 8 = 19 ශේෂ 4, 19 ÷ 8 = 2 ශේෂ 3, 2 ÷ 8 = 0 ශේෂ 2. පහළ සිට ඉහළට: 234₈. පරීක්ෂාව: 2×64 + 3×8 + 4 = 156.
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 156 ÷ 8156 ÷ 8 | 1919 | 44 |
| 19 ÷ 819 ÷ 8 | 22 | 33 |
| 2 ÷ 82 ÷ 8 | 00 | 22 |
Divide by 16. A remainder of 10 to 15 is written as a letter (14 = E). Bottom to top: 2026₁₀ = 7EA₁₆. Check: 7×256 + 14×16 + 10 = 2026.16 න් බෙදන්න. 10 සිට 15 දක්වා ශේෂයක් අකුරකින් ලියයි (14 = E). පහළ සිට ඉහළට: 2026₁₀ = 7EA₁₆. පරීක්ෂාව: 7×256 + 14×16 + 10 = 2026.
| Divisionබෙදීම | Quotientලබ්ධිය | Remainderශේෂය |
|---|---|---|
| 2026 ÷ 162026 ÷ 16 | 126126 | 10 = A10 = A |
| 126 ÷ 16126 ÷ 16 | 77 | 14 = E14 = E |
| 7 ÷ 167 ÷ 16 | 00 | 77 |
4. Binary, octal and hex to decimal – multiply by place values4. ද්වීමය, අෂ්ටමය සහ ෂඩ්දශමයෙන් දශමයට – ස්ථානීය අගයෙන් ගුණ කරන්න
Method: write the place value under each digit (1, base, base², …from the right). Multiply each digit by its place value and add the answers.ක්රමය: සෑම ඉලක්කමක් යටම ස්ථානීය අගය ලියන්න (දකුණේ සිට 1, පාදය, පාදය², …). සෑම ඉලක්කමක්ම එහි ස්ථානීය අගයෙන් ගුණ කර පිළිතුරු එකතු කරන්න.
32 + 0 + 8 + 4 + 0 + 1 = 45₁₀. (Shortcut: just add the place values under the 1s.)32 + 0 + 8 + 4 + 0 + 1 = 45₁₀. (කෙටි ක්රමය: 1 ඇති ස්ථානවල ස්ථානීය අගයන් පමණක් එකතු කරන්න.)
| 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 |
3×64 + 4×8 + 7×1 = 192 + 32 + 7 = 231₁₀.3×64 + 4×8 + 7×1 = 192 + 32 + 7 = 231₁₀.
| Digitඉලක්කම | 33 | 44 | 77 |
|---|---|---|---|
| Place valueස්ථානීය අගය | 8² = 648² = 64 | 8¹ = 88¹ = 8 | 8⁰ = 18⁰ = 1 |
| Digit × place valueඉලක්කම × ස්ථානීය අගය | 3 × 64 = 1923 × 64 = 192 | 4 × 8 = 324 × 8 = 32 | 7 × 1 = 77 × 1 = 7 |
A = 10 and F = 15. 2×256 + 10×16 + 15×1 = 512 + 160 + 15 = 687₁₀.A = 10 සහ F = 15. 2×256 + 10×16 + 15×1 = 512 + 160 + 15 = 687₁₀.
| Digitඉලක්කම | 22 | AA | FF |
|---|---|---|---|
| Place valueස්ථානීය අගය | 16² = 25616² = 256 | 16¹ = 1616¹ = 16 | 16⁰ = 116⁰ = 1 |
| Digit × place valueඉලක්කම × ස්ථානීය අගය | 2 × 256 = 5122 × 256 = 512 | 10 × 16 = 16010 × 16 = 160 | 15 × 1 = 1515 × 1 = 15 |
5. Binary ↔ octal and hex – the grouping shortcut5. ද්වීමය ↔ අෂ්ටමය සහ ෂඩ්දශමය – කාණ්ඩ කිරීමේ කෙටි ක්රමය
Because 8 = 2³ and 16 = 2⁴, one octal digit = 3 bits and one hex digit = 4 bits. Group the bits from the right, add 0s on the left if needed, and change each group to one digit. To go back, change each digit to 3 or 4 bits.8 = 2³ සහ 16 = 2⁴ නිසා එක් අෂ්ටමය ඉලක්කමක් = බිටු 3 සහ එක් ෂඩ්දශමය ඉලක්කමක් = බිටු 4. බිටු දකුණේ සිට කාණ්ඩ කරන්න, අවශ්ය නම් වම් පසට 0 එකතු කරන්න, සහ සෑම කාණ්ඩයක්ම එක් ඉලක්කමකට හරවන්න. ආපසු යාමට සෑම ඉලක්කමක්ම බිටු 3 හෝ 4 කට හරවන්න.
Groups of 3 (pad to 011 010 110): octal 326₈. Groups of 4 (1101 0110): 1101 = D, 0110 = 6, so hex D6₁₆. Both equal 214 in decimal.3 බැගින් කාණ්ඩ (011 010 110 ලෙස පුරවා): අෂ්ටමය 326₈. 4 බැගින් කාණ්ඩ (1101 0110): 1101 = D, 0110 = 6, එබැවින් ෂඩ්දශමය D6₁₆. දෙකම දශමයෙන් 214.
| Groupකාණ්ඩය | 011011 | 010010 | 110110 |
|---|---|---|---|
| Valueඅගය | 33 | 22 | 66 |
| Groupකාණ්ඩය | 11011101 | 01100110 |
|---|---|---|
| Valueඅගය | DD | 66 |
Octal: each digit → 3 bits: 7 = 111, 2 = 010, 5 = 101, so 111010101₂. Hex: each digit → 4 bits: 3 = 0011, C = 1100, 9 = 1001, so 0011 1100 1001₂ (the leading 00 can be dropped).අෂ්ටමය: සෑම ඉලක්කමක්ම → බිටු 3: 7 = 111, 2 = 010, 5 = 101, එබැවින් 111010101₂. ෂඩ්දශමය: සෑම ඉලක්කමක්ම → බිටු 4: 3 = 0011, C = 1100, 9 = 1001, එබැවින් 0011 1100 1001₂ (මුල් 00 ඉවත් කළ හැක).
| Digitඉලක්කම | 77 | 22 | 55 |
|---|---|---|---|
| Bitsබිටු | 111111 | 010010 | 101101 |
| Digitඉලක්කම | 33 | CC | 99 |
|---|---|---|---|
| Bitsබිටු | 00110011 | 11001100 | 10011001 |
Go through binary. 157₈ → 001 101 111 → regroup in 4s: 0110 1111 → 6F₁₆. 2F₁₆ → 0010 1111 → regroup in 3s: 000 101 111 → 57₈.ද්වීමය හරහා යන්න. 157₈ → 001 101 111 → 4 බැගින් නැවත කාණ්ඩ: 0110 1111 → 6F₁₆. 2F₁₆ → 0010 1111 → 3 බැගින් නැවත කාණ්ඩ: 000 101 111 → 57₈.
6. Unsigned and signed integers6. ලකුණු රහිත සහ ලකුණු සහිත නිඛිල
An unsigned integer uses all its bits for the size, so it can only be 0 or positive. 8 bits give 0 to 255. A signed integer must also show + or −. The computer uses the leftmost bit, the most significant bit (MSB), as the sign bit: 0 = positive, 1 = negative.ලකුණු රහිත නිඛිලයක් සියලු බිටු විශාලත්වය සඳහා භාවිත කරයි, එබැවින් එය 0 හෝ ධන විය හැකිය. බිටු 8 කින් 0 සිට 255 ලැබේ. ලකුණු සහිත නිඛිලයක් + හෝ − ද පෙන්විය යුතුය. පරිගණකය වම්කෙළවරේ බිටුව, වැඩිම වෙසෙසි බිටුව (MSB) ලකුණු බිටුව ලෙස භාවිත කරයි: 0 = ධන, 1 = සෘණ.
+45 = 0010 1101 in all three (positive numbers look the same). −45: sign-magnitude 1010 1101, 1’s complement 1101 0010, 2’s complement 1101 0011.+45 = තුනේම 0010 1101 (ධන සංඛ්යා එක හා සමානයි). −45: ලකුණු-විශාලත්ව 1010 1101, 1 හි අනුපූරක 1101 0010, 2 හි අනුපූරක 1101 0011.
| Stepපියවර | Bitsබිටු |
|---|---|
| 1. Write +45 in 8 bits1. +45 බිටු 8 කින් ලියන්න | 0010 11010010 1101 |
| 2. Flip every bit (1’s complement)2. සෑම බිටුවක්ම පෙරළන්න (1 හි අනුපූරකය) | 1101 00101101 0010 |
| 3. Add 1 (2’s complement)3. 1 එකතු කරන්න (2 හි අනුපූරකය) | 1101 00111101 0011 |
MSB is 1, so it is negative. Flip: 0001 0011, add 1: 0001 0100 = 20. So the answer is −20. (Or: the MSB is worth −128, so −128 + 64 + 32 + 8 + 4 = −20.)MSB 1 නිසා එය සෘණයි. පෙරළන්න: 0001 0011, 1 එකතු කරන්න: 0001 0100 = 20. එබැවින් පිළිතුර −20. (නැත්නම්: MSB අගය −128, එබැවින් −128 + 64 + 32 + 8 + 4 = −20.)
| 8-bit methodබිටු 8 ක්රමය | Smallestකුඩාම | Largestවිශාලතම | Zerosශුන්ය | Formula (n bits)සූත්රය (බිටු n) |
|---|---|---|---|---|
| Unsignedලකුණු රහිත | 00 | 255255 | 11 | 0 to 2ⁿ − 10 to 2ⁿ − 1 |
| Sign-magnitudeලකුණු-විශාලත්වය | −127−127 | +127+127 | two (+0, −0)දෙකක් (+0, −0) | −(2ⁿ⁻¹ − 1) to 2ⁿ⁻¹ − 1−(2ⁿ⁻¹ − 1) to 2ⁿ⁻¹ − 1 |
| 1’s complement1 හි අනුපූරකය | −127−127 | +127+127 | two (+0, −0)දෙකක් (+0, −0) | −(2ⁿ⁻¹ − 1) to 2ⁿ⁻¹ − 1−(2ⁿ⁻¹ − 1) to 2ⁿ⁻¹ − 1 |
| 2’s complement2 හි අනුපූරකය | −128−128 | +127+127 | oneඑකක් | −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1−2ⁿ⁻¹ to 2ⁿ⁻¹ − 1 |
Why 2’s complement wins: it has only one zero, it gives one extra negative number (−128), and the same adder circuit can add and subtract (you will see this in 3.3). That is why almost every processor uses it.2 හි අනුපූරකය ජය ගන්නේ ඇයි: එයට ඇත්තේ එක් ශුන්යයක් පමණි, එය අමතර සෘණ සංඛ්යාවක් (−128) ලබා දෙයි, සහ එකම එකතු කිරීමේ පරිපථයට එකතු කිරීම සහ අඩු කිරීම කළ හැක (3.3 හි දකිනු ඇත). එබැවින් බොහෝ සෑම සකසනයක්ම එය භාවිත කරයි.
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1Why do computers use the binary system?පරිගණක ද්වීමය පද්ධතිය භාවිත කරන්නේ ඇයි?
2Convert 156₁₀ to binary, octal and hexadecimal.156₁₀ ද්වීමය, අෂ්ටමය සහ ෂඩ්දශමයට පරිවර්තනය කරන්න.
3Why is hexadecimal used by programmers?ක්රමලේඛකයින් ෂඩ්දශමය භාවිත කරන්නේ ඇයි?
4What is the MSB and what does it show in a signed number?MSB යනු කුමක්ද සහ ලකුණු සහිත සංඛ්යාවක එය පෙන්වන්නේ කුමක්ද?
5Write −20 in 8-bit 2’s complement.−20 බිටු 8 2 හි අනුපූරකයෙන් ලියන්න.
6Give two disadvantages of sign-magnitude.ලකුණු-විශාලත්වයේ අවාසි දෙකක් දෙන්න.
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1Why do computers use binary?පරිගණක ද්වීමය භාවිත කරන්නේ ඇයි?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
On/off states are easy to make and detect.On/off අවස්ථා සෑදීමට සහ හඳුනාගැනීමට පහසුයි.
2What is 156₁₀ in binary?156₁₀ ද්වීමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
156 = 128 + 16 + 8 + 4.156 = 128 + 16 + 8 + 4.
3What is 101101₂ in decimal?101101₂ දශමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
32 + 8 + 4 + 1 = 45.32 + 8 + 4 + 1 = 45.
4What is 2AF₁₆ in decimal?2AF₁₆ දශමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
2×256 + 10×16 + 15 = 687.2×256 + 10×16 + 15 = 687.
5What is 11010110₂ in hexadecimal?11010110₂ ෂඩ්දශමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
1101 = D, 0110 = 6.1101 = D, 0110 = 6.
6What is 11010110₂ in octal?11010110₂ අෂ්ටමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
011 010 110 = 3 2 6.011 010 110 = 3 2 6.
7What is 3C9₁₆ in binary?3C9₁₆ ද්වීමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
3 = 0011, C = 1100, 9 = 1001.3 = 0011, C = 1100, 9 = 1001.
8What is 157₈ in hexadecimal?157₈ ෂඩ්දශමයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
001 101 111 → 0110 1111 = 6F.001 101 111 → 0110 1111 = 6F.
9How many bits does one hexadecimal digit stand for?එක් ෂඩ්දශම ඉලක්කමක් බිටු කීයක් නියෝජනය කරයිද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
16 = 2⁴.16 = 2⁴.
10What is −45 in 8-bit 2’s complement?−45 බිටු 8 2 හි අනුපූරකයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Flip 00101101 → 11010010, add 1 → 11010011.00101101 පෙරළා → 11010010, 1 එකතු → 11010011.
11What is −45 in 8-bit sign-magnitude?−45 බිටු 8 ලකුණු-විශාලත්වයෙන් කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Sign 1 then 45 in 7 bits.ලකුණ 1 සහ බිටු 7 කින් 45.
12The 8-bit 2’s complement value 11101100 equals:බිටු 8 2 හි අනුපූරක අගය 11101100 සමාන වන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
−128 + 64 + 32 + 8 + 4 = −20.−128 + 64 + 32 + 8 + 4 = −20.
13What is the range of an 8-bit 2’s complement integer?බිටු 8 2 හි අනුපූරක නිඛිලයක පරාසය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
−2⁷ to 2⁷ − 1.−2⁷ සිට 2⁷ − 1.
14Which method has only one representation of zero?ශුන්යය සඳහා එක් නිරූපණයක් පමණක් ඇති ක්රමය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
SM and 1’s complement have +0 and −0.SM සහ 1 හි අනුපූරකයට +0 සහ −0 ඇත.
15What is the largest unsigned number in 8 bits?බිටු 8 ක විශාලතම ලකුණු රහිත සංඛ්යාව කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
2⁸ − 1 = 255.2⁸ − 1 = 255.
16In a signed binary number the MSB with value 1 means:ලකුණු සහිත ද්වීමය සංඛ්යාවක 1 අගය ඇති MSB යන්නෙන් අදහස් වන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
MSB is the sign bit.MSB ලකුණු බිටුවයි.
17Which term means: “The smallest unit of data: a single 0 or 1”?“දත්තවල කුඩාම ඒකකය: තනි 0 ක් හෝ 1 ක්” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Bit – The smallest unit of data: a single 0 or 1.බිටුව – දත්තවල කුඩාම ඒකකය: තනි 0 ක් හෝ 1 ක්.
18Which term means: “A group of 8 bits”?“බිටු 8 ක කාණ්ඩයක්” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Byte – A group of 8 bits.බයිටය – බිටු 8 ක කාණ්ඩයක්.
19Which term means: “A group of 4 bits, equal to one hex digit”?“බිටු 4 ක කාණ්ඩයක්, එක් ෂඩ්දශම ඉලක්කමකට සමානයි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Nibble – A group of 4 bits, equal to one hex digit.නිබලය (Nibble) – බිටු 4 ක කාණ්ඩයක්, එක් ෂඩ්දශම ඉලක්කමකට සමානයි.
20Which term means: “The number of different digits a number system uses”?“සංඛ්යා පද්ධතියක් භාවිත කරන වෙනස් ඉලක්කම් ගණන” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Base (radix) – The number of different digits a number system uses.පාදය (Radix) – සංඛ්යා පද්ධතියක් භාවිත කරන වෙනස් ඉලක්කම් ගණන.
MCQ answer keyMCQ පිළිතුරු
- C – On/off states are easy to make and detect.On/off අවස්ථා සෑදීමට සහ හඳුනාගැනීමට පහසුයි.
- E – 156 = 128 + 16 + 8 + 4.156 = 128 + 16 + 8 + 4.
- A – 32 + 8 + 4 + 1 = 45.32 + 8 + 4 + 1 = 45.
- D – 2×256 + 10×16 + 15 = 687.2×256 + 10×16 + 15 = 687.
- C – 1101 = D, 0110 = 6.1101 = D, 0110 = 6.
- B – 011 010 110 = 3 2 6.011 010 110 = 3 2 6.
- A – 3 = 0011, C = 1100, 9 = 1001.3 = 0011, C = 1100, 9 = 1001.
- C – 001 101 111 → 0110 1111 = 6F.001 101 111 → 0110 1111 = 6F.
- E – 16 = 2⁴.16 = 2⁴.
- B – Flip 00101101 → 11010010, add 1 → 11010011.00101101 පෙරළා → 11010010, 1 එකතු → 11010011.
- E – Sign 1 then 45 in 7 bits.ලකුණ 1 සහ බිටු 7 කින් 45.
- D – −128 + 64 + 32 + 8 + 4 = −20.−128 + 64 + 32 + 8 + 4 = −20.
- D – −2⁷ to 2⁷ − 1.−2⁷ සිට 2⁷ − 1.
- A – SM and 1’s complement have +0 and −0.SM සහ 1 හි අනුපූරකයට +0 සහ −0 ඇත.
- A – 2⁸ − 1 = 255.2⁸ − 1 = 255.
- E – MSB is the sign bit.MSB ලකුණු බිටුවයි.
- B – Bit – The smallest unit of data: a single 0 or 1.බිටුව – දත්තවල කුඩාම ඒකකය: තනි 0 ක් හෝ 1 ක්.
- C – Byte – A group of 8 bits.බයිටය – බිටු 8 ක කාණ්ඩයක්.
- B – Nibble – A group of 4 bits, equal to one hex digit.නිබලය (Nibble) – බිටු 4 ක කාණ්ඩයක්, එක් ෂඩ්දශම ඉලක්කමකට සමානයි.
- D – Base (radix) – The number of different digits a number system uses.පාදය (Radix) – සංඛ්යා පද්ධතියක් භාවිත කරන වෙනස් ඉලක්කම් ගණන.
Structured Questionsව්යුහගත ප්රශ්න
1(a) Convert 2026₁₀ to binary showing the division. (b) Convert your answer to octal and hexadecimal by grouping.(a) බෙදීම පෙන්වමින් 2026₁₀ ද්වීමයට පරිවර්තනය කරන්න. (b) කාණ්ඩ කිරීමෙන් පිළිතුර අෂ්ටමය සහ ෂඩ්දශමයට හරවන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Convert to decimal showing place values: (a) 101101₂ (b) 347₈ (c) 2AF₁₆.ස්ථානීය අගයන් පෙන්වමින් දශමයට හරවන්න: (a) 101101₂ (b) 347₈ (c) 2AF₁₆. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Represent −45 in 8 bits using (a) sign-magnitude (b) 1’s complement (c) 2’s complement.−45 බිටු 8 කින් නිරූපණය කරන්න (a) ලකුණු-විශාලත්වය (b) 1 හි අනුපූරකය (c) 2 හි අනුපූරකය. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4(a) Give the range of 8-bit unsigned and 8-bit 2’s complement integers. (b) Give two reasons why 2’s complement is preferred.(a) බිටු 8 ලකුණු රහිත සහ බිටු 8 2 හි අනුපූරක නිඛිලවල පරාසය දෙන්න. (b) 2 හි අනුපූරකයට වැඩි කැමැත්තක් දක්වන හේතු දෙකක් දෙන්න. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5(a) Find the decimal value of the 8-bit 2’s complement number 11101100. (b) Convert 2F₁₆ to octal.(a) බිටු 8 2 හි අනුපූරක සංඛ්යාව 11101100 හි දශම අගය සොයන්න. (b) 2F₁₆ අෂ්ටමයට හරවන්න. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Computers use two states (0 and 1) because they are easy, reliable and match logic.පහසු, විශ්වාසදායක සහ තර්කයට ගැළපෙන නිසා පරිගණක අවස්ථා දෙකක් (0 සහ 1) භාවිත කරයි.
- Bases: decimal 10, binary 2, octal 8, hexadecimal 16 (A–F = 10–15).පාද: දශමය 10, ද්වීමය 2, අෂ්ටමය 8, ෂඩ්දශමය 16 (A–F = 10–15).
- Decimal → base: divide and read remainders bottom to top. Base → decimal: multiply by place values and add.දශමය → පාදය: බෙදා ශේෂ පහළ සිට ඉහළට කියවන්න. පාදය → දශමය: ස්ථානීය අගයෙන් ගුණ කර එකතු කරන්න.
- Binary ↔ octal: groups of 3 bits; binary ↔ hex: groups of 4 bits, from the right.ද්වීමය ↔ අෂ්ටමය: බිටු 3 කාණ්ඩ; ද්වීමය ↔ ෂඩ්දශමය: බිටු 4 කාණ්ඩ, දකුණේ සිට.
- Signed numbers use the MSB as the sign bit: sign-magnitude, 1’s complement (flip), 2’s complement (flip + 1).ලකුණු සහිත සංඛ්යා MSB ලකුණු බිටුව ලෙස යොදයි: ලකුණු-විශාලත්වය, 1 හි අනුපූරකය (පෙරළීම), 2 හි අනුපූරකය (පෙරළීම + 1).
- 8-bit 2’s complement range is −128 to +127 with only one zero, so CPUs use it.බිටු 8 2 හි අනුපූරක පරාසය −128 සිට +127, එක් ශුන්යයක් පමණි, එබැවින් CPU එය භාවිත කරයි.
