© 2026 schoolict.net (Ruwan Mangala Suraweera)
3.3 Binary Arithmetic and Bitwise Logic: Add, Subtract, AND, OR, XOR, NOTද්වීමය අංක ගණිතය සහ බිටු-අනුව තර්කය: එකතු, අඩු, AND, OR, XOR, NOT
Grade 12 A/L ICT · Lesson 312 ශ්රේණිය A/L ICT · පාඩම 3
In this videoමේ වීඩියෝවේ
- Binary addition: 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1; work from the right.ද්වීමය එකතු කිරීම: 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1; දකුණේ සිට කරන්න.
- For many numbers, count the 1s in each column plus the carry.සංඛ්යා බොහොමයක් සඳහා, සෑම තීරුවකම 1 ගණන සහ carry ගණන් කරන්න.
- Subtraction: 0 − 1 borrows 1 (worth 2) from the left column.අඩු කිරීම: 0 − 1 වම් තීරුවෙන් 1 (අගය 2) ණයට ගනී.
- A CPU subtracts by adding the 2’s complement and dropping the extra carry.CPU එක 2 හි අනුපූරකය එකතු කර අමතර carry එක ඉවත් කිරීමෙන් අඩු කරයි.
- Overflow: the true answer is outside the range of the bits (8-bit: −128 to +127).පිටාර ගැලීම: සත්ය පිළිතුර බිටුවල පරාසයෙන් පිටත (බිටු 8: −128 සිට +127).
Notesසටහන්
Syllabus 3.3. The ALU inside the CPU does all its work with bits. In this part you learn binary addition (with carries, even when adding several numbers), binary subtraction (with borrowing, and with 2’s complement), what overflow is, and the bitwise logical operations NOT, AND, OR and XOR.විෂය නිර්දේශය 3.3. CPU තුළ ඇති ALU එක සියලු වැඩ බිටු මගින් කරයි. මෙම කොටසින් ද්වීමය එකතු කිරීම (සංඛ්යා කිහිපයක් එකතු කරන විට පවා රැගෙන යාම් සමඟ), ද්වීමය අඩු කිරීම (ණයට ගැනීම සමඟ, සහ 2 හි අනුපූරකය සමඟ), පිටාර ගැලීම (overflow) යනු කුමක්ද, සහ බිටු-අනුව තාර්කික මෙහෙයුම් NOT, AND, OR සහ XOR ඉගෙන ගනී.
1. The rules of binary addition1. ද්වීමය එකතු කිරීමේ නීති
Binary addition works exactly like decimal addition, column by column from the right. The only difference: in binary, 2 is written as 10, so you write 0 and carry 1 to the next column.ද්වීමය එකතු කිරීම දශම එකතු කිරීම මෙන්ම ක්රියා කරයි, දකුණේ සිට තීරුවෙන් තීරුව. එකම වෙනස: ද්වීමයේ 2 ලියන්නේ 10 ලෙස, එබැවින් 0 ලියා ඊළඟ තීරුවට 1 රැගෙන යන්න (carry).
- 0 + 0 = 00 + 0 = 0
- 0 + 1 = 10 + 1 = 1
- 1 + 1 = 10 → write 0, carry 11 + 1 = 10 → 0 ලියන්න, 1 රැගෙන යන්න
- 1 + 1 + 1 = 11 → write 1, carry 11 + 1 + 1 = 11 → 1 ලියන්න, 1 රැගෙන යන්න
Right column: 1 + 0 = 1. Next: 1 + 1 = 10, write 0 carry 1. Next: 0 + 1 + 1 = 10, write 0 carry 1. Next: 1 + 0 + 1 = 10, write 0 carry 1. Last carry goes down. Answer 10001₂. Check: 11 + 6 = 17 ✔දකුණු තීරුව: 1 + 0 = 1. ඊළඟ: 1 + 1 = 10, 0 ලියා 1 රැගෙන යන්න. ඊළඟ: 0 + 1 + 1 = 10, 0 ලියා 1 රැගෙන යන්න. ඊළඟ: 1 + 0 + 1 = 10, 0 ලියා 1 රැගෙන යන්න. අවසාන carry එක පහළට. පිළිතුර 10001₂. පරීක්ෂාව: 11 + 6 = 17 ✔
| 2⁴2⁴ | 2³2³ | 2²2² | 2¹2¹ | 2⁰2⁰ | |
|---|---|---|---|---|---|
| Carryරැගෙන යාම (carry) | 11 | 11 | 11 | ||
| 00 | 11 | 00 | 11 | 11 | |
| 00 | 00 | 11 | 11 | 00 | |
| Sumඑකතුව | 11 | 00 | 00 | 00 | 11 |
In every column three or four 1s may meet. Count the 1s (plus the carry): 3 = 11, so write 1 and carry 1. Doing this for each column gives 11111₂. Check: 11 + 13 + 7 = 31 ✔සෑම තීරුවකම 1 තුනක් හෝ හතරක් හමු විය හැක. 1 ගණන් කරන්න (carry ද සමඟ): 3 = 11, එබැවින් 1 ලියා 1 රැගෙන යන්න. සෑම තීරුවකටම මෙසේ කළ විට 11111₂. පරීක්ෂාව: 11 + 13 + 7 = 31 ✔
| 2⁴2⁴ | 2³2³ | 2²2² | 2¹2¹ | 2⁰2⁰ | |
|---|---|---|---|---|---|
| Carryරැගෙන යාම (carry) | 11 | 11 | 11 | 11 | |
| 00 | 11 | 00 | 11 | 11 | |
| 00 | 11 | 11 | 00 | 11 | |
| 00 | 00 | 11 | 11 | 11 | |
| Sumඑකතුව | 11 | 11 | 11 | 11 | 11 |
2. Binary subtraction with borrowing2. ණයට ගැනීම සමඟ ද්වීමය අඩු කිරීම
- 0 − 0 = 0, 1 − 0 = 1, 1 − 1 = 00 − 0 = 0, 1 − 0 = 1, 1 − 1 = 0
- 0 − 1: borrow 1 from the next column on the left. The borrowed 1 is worth 2 here, so 2 − 1 = 1.0 − 1: වම් පස ඊළඟ තීරුවෙන් 1 ණයට ගන්න. ණයට ගත් 1 මෙහි අගය 2, එබැවින් 2 − 1 = 1.
- The column that lent the 1 is now one less.1 ණයට දුන් තීරුව දැන් එකකින් අඩුයි.
Right column: 0 − 1, borrow → 2 − 1 = 1. Next: 1 − 1 − 1 (paying back the borrow) is below 0, so borrow again: 2 + 1 − 1 − 1 = 1. Continue the same way; the table shows where each borrow was paid. Answer 01111₂. Check: 26 − 11 = 15 ✔දකුණු තීරුව: 0 − 1, ණයට ගන්න → 2 − 1 = 1. ඊළඟ: 1 − 1 − 1 (ණය ආපසු ගෙවීම) 0 ට අඩු නිසා නැවත ණයට ගන්න: 2 + 1 − 1 − 1 = 1. එලෙසම ඉදිරියට; සෑම ණයක්ම ගෙවූ තැන වගුවේ ඇත. පිළිතුර 01111₂. පරීක්ෂාව: 26 − 11 = 15 ✔
| 2⁴2⁴ | 2³2³ | 2²2² | 2¹2¹ | 2⁰2⁰ | |
|---|---|---|---|---|---|
| Borrow paidණයට ගත් (borrow) | −1−1 | −1−1 | −1−1 | −1−1 | |
| 11 | 11 | 00 | 11 | 00 | |
| −− | 00 | 11 | 00 | 11 | 11 |
| Differenceවෙනස | 00 | 11 | 11 | 11 | 11 |
The right column needs a borrow, but its neighbours are 0, so the borrow travels to the leftmost 1. That 1 becomes 0 and every 0 on the way becomes 1. Answer 01111₂ (16 − 1 = 15).දකුණු තීරුවට ණයක් අවශ්ය නමුත් අසල්වැසි තීරු 0 නිසා ණය වම්කෙළවරේ 1 දක්වා යයි. එම 1, 0 වන අතර මාර්ගයේ සෑම 0 ක්ම 1 වේ. පිළිතුර 01111₂ (16 − 1 = 15).
| 2⁴2⁴ | 2³2³ | 2²2² | 2¹2¹ | 2⁰2⁰ | |
|---|---|---|---|---|---|
| Borrow paidණයට ගත් (borrow) | −1−1 | −1−1 | −1−1 | −1−1 | |
| 11 | 00 | 00 | 00 | 00 | |
| −− | 00 | 00 | 00 | 00 | 11 |
| Differenceවෙනස | 00 | 11 | 11 | 11 | 11 |
3. Subtraction with 2’s complement3. 2 හි අනුපූරකය සමඟ අඩු කිරීම
A CPU does not need a separate subtract circuit. To work out A − B it adds: A + (2’s complement of B). Any carry out of the left end (the 9th bit for 8-bit numbers) is thrown away.CPU එකකට වෙනම අඩු කිරීමේ පරිපථයක් අවශ්ය නැත. A − B සෙවීමට එය එකතු කරයි: A + (B හි 2 හි අනුපූරකය). වම් කෙළවරින් පිටතට යන carry එක (බිටු 8 සංඛ්යා සඳහා 9 වැනි බිටුව) ඉවත දමයි.
+45 = 0010 1101. −20 = 1110 1100 (flip 00010100 and add 1). Add them: 100011001. Throw away the 9th bit → 0001 1001 = 25 ✔+45 = 0010 1101. −20 = 1110 1100 (00010100 පෙරළා 1 එකතු කරන්න). ඒවා එකතු කරන්න: 100011001. 9 වැනි බිටුව ඉවත දමන්න → 0001 1001 = 25 ✔
| 2⁸2⁸ | 2⁷2⁷ | 2⁶2⁶ | 2⁵2⁵ | 2⁴2⁴ | 2³2³ | 2²2² | 2¹2¹ | 2⁰2⁰ | |
|---|---|---|---|---|---|---|---|---|---|
| Carryරැගෙන යාම (carry) | 11 | 11 | 11 | 11 | 11 | ||||
| 00 | 00 | 00 | 11 | 00 | 11 | 11 | 00 | 11 | |
| 00 | 11 | 11 | 11 | 00 | 11 | 11 | 00 | 00 | |
| Sumඑකතුව | 11 | 00 | 00 | 00 | 11 | 11 | 00 | 00 | 11 |
4. Overflow4. පිටාර ගැලීම (Overflow)
An 8-bit 2’s complement number can only hold −128 to +127. If the true answer is outside this range, the result is wrong. This is called overflow. A sign check finds it: adding two positives gives a negative, or adding two negatives gives a positive.බිටු 8 2 හි අනුපූරක සංඛ්යාවකට −128 සිට +127 පමණක් රඳවා ගත හැක. සත්ය පිළිතුර මෙම පරාසයෙන් පිටත නම්, ප්රතිඵලය වැරදියි. මෙය පිටාර ගැලීම ලෙස හැඳින්වේ. ලකුණ පරීක්ෂා කිරීමෙන් එය හමු වේ: ධන දෙකක් එකතු කළ විට සෘණ ලැබීම, හෝ සෘණ දෙකක් එකතු කළ විට ධන ලැබීම.
0110 0100 + 0011 0010 = 1001 0110. The MSB is 1, so the computer reads −106, not 150. Two positives gave a negative: overflow, because 150 > 127.0110 0100 + 0011 0010 = 1001 0110. MSB 1 නිසා පරිගණකය −106 ලෙස කියවයි, 150 නොවේ. ධන දෙකක් සෘණයක් දුන්නේය: පිටාර ගැලීම, 150 > 127 නිසා.
5. Bitwise logical operations5. බිටු-අනුව තාර්කික මෙහෙයුම්
A bitwise operation works on each pair of bits on its own, column by column. There is no carry.බිටු-අනුව (bitwise) මෙහෙයුමක් සෑම බිටු යුගලයක් මතම වෙන වෙනම, තීරුවෙන් තීරුව ක්රියා කරයි. carry එකක් නැත.
| AA | BB | A AND BA AND B | A OR BA OR B | A XOR BA XOR B | NOT ANOT A |
|---|---|---|---|---|---|
| 00 | 00 | 00 | 00 | 00 | 11 |
| 00 | 11 | 00 | 11 | 11 | 11 |
| 11 | 00 | 00 | 11 | 11 | 00 |
| 11 | 11 | 11 | 11 | 00 | 00 |
Work column by column using the truth table: AND = 10001000, OR = 11101110, XOR = 01100110, NOT A = 00110101.සත්යතා වගුව භාවිතයෙන් තීරුවෙන් තීරුව කරන්න: AND = 10001000, OR = 11101110, XOR = 01100110, NOT A = 00110101.
| b7b7 | b6b6 | b5b5 | b4b4 | b3b3 | b2b2 | b1b1 | b0b0 | |
|---|---|---|---|---|---|---|---|---|
| AA | 11 | 11 | 00 | 00 | 11 | 00 | 11 | 00 |
| BB | 11 | 00 | 11 | 00 | 11 | 11 | 00 | 00 |
| A AND BA AND B | 11 | 00 | 00 | 00 | 11 | 00 | 00 | 00 |
| A OR BA OR B | 11 | 11 | 11 | 00 | 11 | 11 | 11 | 00 |
| A XOR BA XOR B | 00 | 11 | 11 | 00 | 00 | 11 | 11 | 00 |
| NOT ANOT A | 00 | 00 | 11 | 11 | 00 | 11 | 00 | 11 |
6. Using bitwise operations (masks)6. බිටු-අනුව මෙහෙයුම් භාවිතය (Masks)
A mask is a bit pattern used to pick out or change certain bits. AND with a mask checks or clears bits, OR sets bits to 1, and XOR toggles (flips) bits.Mask එකක් යනු ඇතැම් බිටු තෝරා ගැනීමට හෝ වෙනස් කිරීමට භාවිත කරන බිටු රටාවකි. Mask එකක් සමඟ AND බිටු පරීක්ෂා කරයි හෝ හිස් කරයි, OR බිටු 1 ට සකසයි, සහ XOR බිටු පෙරළයි.
11001010 AND 00001000 = 00001000. The answer is not 0, so bit 3 is 1.11001010 AND 00001000 = 00001000. පිළිතුර 0 නොවන නිසා 3 වැනි බිටුව 1 කි.
Small letters are 32 more, and 32 = 00100000. 01000001 OR 00100000 = 01100001 = 97 = “a”.සිම්පල් අකුරු 32 කින් වැඩියි, 32 = 00100000. 01000001 OR 00100000 = 01100001 = 97 = “a”.
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1State the four rules of binary addition.ද්වීමය එකතු කිරීමේ නීති හතර සඳහන් කරන්න.
2Add 1011 + 1101 + 0111.1011 + 1101 + 0111 එකතු කරන්න.
3Subtract 11010 − 01011.11010 − 01011 අඩු කරන්න.
4How does a CPU subtract using only an adder?CPU එකක් එකතු කිරීමේ පරිපථයක් පමණක් භාවිතයෙන් අඩු කරන්නේ කෙසේද?
5What is overflow? Give an example.පිටාර ගැලීම යනු කුමක්ද? උදාහරණයක් දෙන්න.
6Find 11001010 XOR 10101100 and say what XOR shows.11001010 XOR 10101100 සොයා XOR පෙන්වන්නේ කුමක්දැයි කියන්න.
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1What is 1011 + 0110?1011 + 0110 කීයද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
11 + 6 = 17 = 10001.11 + 6 = 17 = 10001.
21 + 1 + 1 in binary gives:ද්වීමයෙන් 1 + 1 + 1 ලබා දෙන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
3 = 11.3 = 11.
3What is 1011 + 1101 + 0111?1011 + 1101 + 0111 කීයද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
11 + 13 + 7 = 31.11 + 13 + 7 = 31.
4What is 11010 − 01011?11010 − 01011 කීයද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
26 − 11 = 15.26 − 11 = 15.
5What is 10000 − 00001?10000 − 00001 කීයද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
16 − 1 = 15.16 − 1 = 15.
6In binary subtraction, 0 − 1 needs:ද්වීමය අඩු කිරීමේදී 0 − 1 සඳහා අවශ්ය වන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Borrow 1 (worth 2).1 ණයට ගන්න (අගය 2).
7To find A − B a CPU usually calculates:A − B සෙවීමට CPU එකක් සාමාන්යයෙන් ගණනය කරන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Subtraction becomes addition.අඩු කිරීම එකතු කිරීමක් වේ.
8In 8-bit 2’s complement, 00101101 + 11101100 (after dropping the 9th bit) is:බිටු 8 2 හි අනුපූරකයේ 00101101 + 11101100 (9 වැනි බිටුව ඉවත් කළ පසු):
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
45 + (−20) = 25 = 00011001.45 + (−20) = 25 = 00011001.
9Adding 100 + 50 in 8-bit 2’s complement gives a negative answer. This is:බිටු 8 2 හි අනුපූරකයේ 100 + 50 එකතු කිරීම සෘණ පිළිතුරක් දෙයි. මෙය:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
150 > 127.150 > 127.
1011001010 AND 10101100 = ?11001010 AND 10101100 = ?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
1 only where both are 1.දෙකම 1 තැන්වල පමණක් 1.
1111001010 OR 10101100 = ?11001010 OR 10101100 = ?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
1 wherever at least one is 1.අවම වශයෙන් එකක් 1 තැන්වල 1.
1211001010 XOR 10101100 = ?11001010 XOR 10101100 = ?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
1 where bits differ.බිටු වෙනස් තැන්වල 1.
13NOT 11001010 = ?NOT 11001010 = ?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Flip every bit.සෑම බිටුවක්ම පෙරළන්න.
14Which operation gives 1 only when both bits are 1?බිටු දෙකම 1 වූ විට පමණක් 1 දෙන මෙහෙයුම කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
AND truth table.AND සත්යතා වගුව.
15Which operation with mask 00100000 changes “A” into “a”?Mask 00100000 සමඟ “A” “a” බවට හරවන මෙහෙයුම කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
OR sets bit 5 to 1 (+32).OR මගින් 5 වැනි බිටුව 1 කරයි (+32).
16IP 192.168.1.130 AND mask 255.255.255.0 gives:IP 192.168.1.130 AND mask 255.255.255.0 ලබා දෙන්නේ:
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
130 AND 0 = 0.130 AND 0 = 0.
17Which term means: “The 1 moved to the next column when a column adds up to 2 or more”?“තීරුවක එකතුව 2 හෝ වැඩි වූ විට ඊළඟ තීරුවට ගෙන යන 1” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Carry – The 1 moved to the next column when a column adds up to 2 or more.රැගෙන යාම (Carry) – තීරුවක එකතුව 2 හෝ වැඩි වූ විට ඊළඟ තීරුවට ගෙන යන 1.
18Which term means: “Taking 1 from the next column on the left when 0 − 1 is needed”?“0 − 1 අවශ්ය වූ විට වම් පස ඊළඟ තීරුවෙන් 1 ගැනීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Borrow – Taking 1 from the next column on the left when 0 − 1 is needed.ණයට ගැනීම (Borrow) – 0 − 1 අවශ්ය වූ විට වම් පස ඊළඟ තීරුවෙන් 1 ගැනීම.
19Which term means: “When the true result is too big or too small for the number of bits”?“සත්ය ප්රතිඵලය බිටු ගණනට වඩා විශාල හෝ කුඩා වීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Overflow – When the true result is too big or too small for the number of bits.පිටාර ගැලීම (Overflow) – සත්ය ප්රතිඵලය බිටු ගණනට වඩා විශාල හෝ කුඩා වීම.
20Which term means: “The bit written in a column after adding”?“එකතු කිරීමෙන් පසු තීරුවක ලියන බිටුව” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Sum bit – The bit written in a column after adding.එකතු බිටුව – එකතු කිරීමෙන් පසු තීරුවක ලියන බිටුව.
MCQ answer keyMCQ පිළිතුරු
- B – 11 + 6 = 17 = 10001.11 + 6 = 17 = 10001.
- C – 3 = 11.3 = 11.
- D – 11 + 13 + 7 = 31.11 + 13 + 7 = 31.
- B – 26 − 11 = 15.26 − 11 = 15.
- E – 16 − 1 = 15.16 − 1 = 15.
- E – Borrow 1 (worth 2).1 ණයට ගන්න (අගය 2).
- A – Subtraction becomes addition.අඩු කිරීම එකතු කිරීමක් වේ.
- C – 45 + (−20) = 25 = 00011001.45 + (−20) = 25 = 00011001.
- A – 150 > 127.150 > 127.
- B – 1 only where both are 1.දෙකම 1 තැන්වල පමණක් 1.
- A – 1 wherever at least one is 1.අවම වශයෙන් එකක් 1 තැන්වල 1.
- E – 1 where bits differ.බිටු වෙනස් තැන්වල 1.
- D – Flip every bit.සෑම බිටුවක්ම පෙරළන්න.
- D – AND truth table.AND සත්යතා වගුව.
- C – OR sets bit 5 to 1 (+32).OR මගින් 5 වැනි බිටුව 1 කරයි (+32).
- A – 130 AND 0 = 0.130 AND 0 = 0.
- C – Carry – The 1 moved to the next column when a column adds up to 2 or more.රැගෙන යාම (Carry) – තීරුවක එකතුව 2 හෝ වැඩි වූ විට ඊළඟ තීරුවට ගෙන යන 1.
- D – Borrow – Taking 1 from the next column on the left when 0 − 1 is needed.ණයට ගැනීම (Borrow) – 0 − 1 අවශ්ය වූ විට වම් පස ඊළඟ තීරුවෙන් 1 ගැනීම.
- B – Overflow – When the true result is too big or too small for the number of bits.පිටාර ගැලීම (Overflow) – සත්ය ප්රතිඵලය බිටු ගණනට වඩා විශාල හෝ කුඩා වීම.
- E – Sum bit – The bit written in a column after adding.එකතු බිටුව – එකතු කිරීමෙන් පසු තීරුවක ලියන බිටුව.
Structured Questionsව්යුහගත ප්රශ්න
1(a) Add 1011 + 0110 showing the carries. (b) Check your answer in decimal.(a) carry පෙන්වමින් 1011 + 0110 එකතු කරන්න. (b) දශමයෙන් පිළිතුර පරීක්ෂා කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Add the three binary numbers 1011, 1101, 0111 and give the answer in binary and decimal.ද්වීමය සංඛ්යා තුන 1011, 1101, 0111 එකතු කර පිළිතුර ද්වීමය සහ දශමයෙන් දෙන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3(a) Subtract 11010 − 01011 using borrowing. (b) Do 45 − 20 in 8-bit 2’s complement.(a) ණයට ගැනීමෙන් 11010 − 01011 අඩු කරන්න. (b) බිටු 8 2 හි අනුපූරකයෙන් 45 − 20 කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4(a) What is overflow? (b) Show that 100 + 50 overflows in 8-bit 2’s complement.(a) පිටාර ගැලීම යනු කුමක්ද? (b) බිටු 8 2 හි අනුපූරකයේ 100 + 50 පිටාර ගලන බව පෙන්වන්න. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5A = 11001010, B = 10101100. Find (a) A AND B (b) A OR B (c) A XOR B (d) NOT A (e) one use of AND with a mask.A = 11001010, B = 10101100. සොයන්න (a) A AND B (b) A OR B (c) A XOR B (d) NOT A (e) mask එකක් සමඟ AND හි එක් භාවිතයක්. (5 marksලකුණු 5)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Binary addition: 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1; work from the right.ද්වීමය එකතු කිරීම: 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1; දකුණේ සිට කරන්න.
- For many numbers, count the 1s in each column plus the carry.සංඛ්යා බොහොමයක් සඳහා, සෑම තීරුවකම 1 ගණන සහ carry ගණන් කරන්න.
- Subtraction: 0 − 1 borrows 1 (worth 2) from the left column.අඩු කිරීම: 0 − 1 වම් තීරුවෙන් 1 (අගය 2) ණයට ගනී.
- A CPU subtracts by adding the 2’s complement and dropping the extra carry.CPU එක 2 හි අනුපූරකය එකතු කර අමතර carry එක ඉවත් කිරීමෙන් අඩු කරයි.
- Overflow: the true answer is outside the range of the bits (8-bit: −128 to +127).පිටාර ගැලීම: සත්ය පිළිතුර බිටුවල පරාසයෙන් පිටත (බිටු 8: −128 සිට +127).
- Bitwise: AND both 1, OR any 1, XOR different, NOT flips; masks check, set or toggle bits.බිටු-අනුව: AND දෙකම 1, OR ඕනෑම 1, XOR වෙනස්, NOT පෙරළයි; masks බිටු පරීක්ෂා, සකස් හෝ පෙරළයි.
Downloadsබාගත කිරීම්
Full Lesson 3 PDFසම්පූර්ණ පාඩම 3 PDF: English · සිංහල
Next: Lesson 3 A/L Exam Practiceඊළඟට: පාඩම 3 A/L විභාග පුහුණුව →
