© 2026 schoolict.net (Ruwan Mangala Suraweera)
4.4 Half Adder, Full Adder and Flip-Flops: CPU Blocks and Memory Cellsඅර්ධ එකතුකරන්නා, සම්පූර්ණ එකතුකරන්නා සහ Flip-Flop: CPU කොටස් සහ මතක කොටු
Grade 12 A/L ICT · Lesson 412 ශ්රේණිය A/L ICT · පාඩම 4
In this videoමේ වීඩියෝවේ
- Half adder: S = A ⊕ B, C = A · B (no Cin).අර්ධ එකතුකරන්නා: S = A ⊕ B, C = A · B (Cin නැත).
- Full adder: S = A ⊕ B ⊕ Cin, Cout = majority(A,B,Cin).සම්පූර්ණ එකතුකරන්නා: S = A ⊕ B ⊕ Cin, Cout = බහුතරය.
- Chain full adders to add multi-bit numbers in the ALU.ALU තුළ බහු-බිටු සංඛ්යා එකතු කිරීමට සම්පූර්ණ එකතුකරන්නන් දාමගත කරන්න.
- A flip-flop uses feedback to store one bit.Flip-flop එකක් ප්රතිපෝෂණයෙන් බිටු එකක් ගබඩා කරයි.
- SR: 10 set, 01 reset, 00 hold, 11 forbidden.SR: 10 set, 01 reset, 00 hold, 11 තහනම්.
Notesසටහන්
Syllabus 4.4. The CPU adds numbers with adder circuits, and memory stores bits with flip-flops. In this part you build the truth tables and Boolean expressions for a half adder and a full adder, see how full adders chain into an ALU, and learn how a feedback loop in a flip-flop remembers one bit – the building block of registers and RAM.විෂය නිර්දේශය 4.4. CPU එක සංඛ්යා එකතු කරන්නේ එකතුකරන්නා පරිපථ මගිනි, මතකය බිටු ගබඩා කරන්නේ flip-flop මගිනි. මෙම කොටසින් අර්ධ එකතුකරන්නා සහ සම්පූර්ණ එකතුකරන්නා සඳහා සත්යතා වගු සහ බූලියානු ප්රකාශන සාදා, සම්පූර්ණ එකතුකරන්නන් ALU එකට දාමගත වන ආකාරය දකින අතර flip-flop එකක ප්රතිපෝෂණ වළල්ලක් බිටු එකක් මතක තබා ගන්නා ආකාරය – රෙජිස්තර සහ RAM හි ගොඩනැගිලි කොටස – ඉගෙන ගනී.
1. Building blocks of the CPU1. CPU හි ගොඩනැගිලි කොටස්
Arithmetic in the ALU starts with adding two bits. A half adder adds two bits and makes a sum and a carry. A full adder also takes a carry-in from the previous column, so you can chain eight full adders to add two 8-bit numbers.ALU තුළ අංක ගණිතය බිටු දෙකක් එකතු කිරීමෙන් අරඹයි. අර්ධ එකතුකරන්නා බිටු දෙකක් එකතු කර එකතුවක් සහ carry එකක් සාදයි. සම්පූර්ණ එකතුකරන්නා පෙර තීරුවෙන් carry-in ද ගනී, එබැවින් බිටු 8 ක සංඛ්යා දෙකක් එකතු කිරීමට සම්පූර්ණ එකතුකරන්නන් අටක් දාමගත කළ හැක.
2. Half adder2. අර්ධ එකතුකරන්නා
Inputs: A, B. Outputs: Sum S and Carry C. Looking at binary addition: 0+0=00, 0+1=01, 1+0=01, 1+1=10. So S is 1 when the inputs differ → S = A ⊕ B. C is 1 only when both are 1 → C = A · B.ආදාන: A, B. ප්රතිදාන: එකතු S සහ Carry C. ද්වීමය එකතු කිරීම: 0+0=00, 0+1=01, 1+0=01, 1+1=10. එබැවින් ආදාන වෙනස් වූ විට S 1 වේ → S = A ⊕ B. දෙකම 1 වූ විට පමණක් C 1 වේ → C = A · B.
| AA | BB | Sum Sඑකතු S | Carry CCarry C |
|---|---|---|---|
| 00 | 00 | 00 | 00 |
| 00 | 11 | 11 | 00 |
| 11 | 00 | 11 | 00 |
| 11 | 11 | 00 | 11 |
S = 1 ⊕ 1 = 0. C = 1 · 1 = 1. (Binary 1 + 1 = 10₂.)S = 1 ⊕ 1 = 0. C = 1 · 1 = 1. (ද්වීමය 1 + 1 = 10₂.)
3. Full adder3. සම්පූර්ණ එකතුකරන්නා
Inputs: A, B, Cin. Outputs: Sum S and Cout. S is 1 when an odd number of the three inputs is 1 → S = A ⊕ B ⊕ Cin. Cout is 1 when at least two inputs are 1 → Cout = A·B + B·Cin + A·Cin (the majority function from 4.3).ආදාන: A, B, Cin. ප්රතිදාන: එකතු S සහ Cout. ආදාන තුනෙන් ඔත්තේ ගණනක් 1 වූ විට S 1 වේ → S = A ⊕ B ⊕ Cin. අවම වශයෙන් දෙකක් 1 වූ විට Cout 1 වේ → Cout = A·B + B·Cin + A·Cin (4.3 හි බහුතර ශ්රිතය).
| AA | BB | CinCin | Sum Sඑකතු S | CoutCout |
|---|---|---|---|---|
| 00 | 00 | 00 | 00 | 00 |
| 00 | 00 | 11 | 11 | 00 |
| 00 | 11 | 00 | 11 | 00 |
| 00 | 11 | 11 | 00 | 11 |
| 11 | 00 | 00 | 11 | 00 |
| 11 | 00 | 11 | 00 | 11 |
| 11 | 11 | 00 | 00 | 11 |
| 11 | 11 | 11 | 11 | 11 |
S = 1 ⊕ 0 ⊕ 1 = 0. Cout = majority = 1. (1+0+1 = 10₂.)S = 1 ⊕ 0 ⊕ 1 = 0. Cout = බහුතරය = 1.
S = 1 ⊕ 1 ⊕ 1 = 1. Cout = 1. (1+1+1 = 11₂.)S = 1 ⊕ 1 ⊕ 1 = 1. Cout = 1.
You can build a full adder from two half adders plus an OR: first HA adds A and B → S1, C1; second HA adds S1 and Cin → S, C2; then Cout = C1 + C2.සම්පූර්ණ එකතුකරන්නා අර්ධ එකතුකරන්නන් දෙදෙනෙකු සහ OR එකකින් සෑදිය හැක: පළමු HA A සහ B එකතු කරයි → S1, C1; දෙවන HA S1 සහ Cin එකතු කරයි → S, C2; පසුව Cout = C1 + C2.
4. Storing bits – feedback and flip-flops4. බිටු ගබඩා කිරීම – ප්රතිපෝෂණ සහ flip-flop
A combinational circuit’s output depends only on the current inputs. To remember a bit you need a feedback loop: feed the output back to an input so the circuit can hold its state. A flip-flop is the basic memory cell that stores one bit.සංයෝජන පරිපථයක ප්රතිදානය රඳා පවතින්නේ වත්මන් ආදාන මත පමණි. බිටුවක් මතක තබා ගැනීමට ප්රතිපෝෂණ වළල්ලක් අවශ්යයි: ප්රතිදානය ආදානයකට ආපසු යවා පරිපථයට තම තත්ත්වය තබා ගත හැකි වේ. Flip-flop යනු බිටු එකක් ගබඩා කරන මූලික මතක කොටුවයි.
The simple SR (Set-Reset) flip-flop has inputs S and R and outputs Q and Q′:සරල SR (Set-Reset) flip-flop එකට ආදාන S සහ R සහ ප්රතිදාන Q සහ Q′ ඇත:
- S = 1, R = 0 → Set: Q becomes 1.S = 1, R = 0 → Set: Q 1 වේ.
- S = 0, R = 1 → Reset: Q becomes 0.S = 0, R = 1 → Reset: Q 0 වේ.
- S = 0, R = 0 → Hold: Q stays as it was (memory!).S = 0, R = 0 → Hold: Q තිබුණා විදිහටම තිබේ (මතකය!).
- S = 1, R = 1 → Forbidden in a basic SR latch (both outputs fight).S = 1, R = 1 → මූලික SR latch එකක තහනම් (ප්රතිදාන දෙකම ගැටෙයි).
(a) S = 1, R = 0 (set). (b) S = 0, R = 0 (hold) – or actively reset with S = 0, R = 1.(a) S = 1, R = 0 (set). (b) S = 0, R = 0 (hold) – නැත්නම් S = 0, R = 1 මගින් reset.
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1Write the Boolean expressions for a half adder.අර්ධ එකතුකරන්නා සඳහා බූලියානු ප්රකාශන ලියන්න.
2Why does a multi-bit adder need full adders, not only half adders?බහු-බිටු එකතුකරන්නාකට අර්ධ එකතුකරන්නන් පමණක් නොව සම්පූර්ණ එකතුකරන්නන් අවශ්ය වන්නේ ඇයි?
3Write S and Cout for a full adder.සම්පූර්ණ එකතුකරන්නා සඳහා S සහ Cout ලියන්න.
4What does a flip-flop store?Flip-flop එකක් ගබඩා කරන්නේ කුමක්ද?
5In an SR flip-flop, what do S = 1, R = 0 and S = R = 0 do?SR flip-flop එකක S = 1, R = 0 සහ S = R = 0 කරන්නේ කුමක්ද?
6How can you build a full adder from half adders?අර්ධ එකතුකරන්නන්ගෙන් සම්පූර්ණ එකතුකරන්නාක් සෑදීමේ ආකාරය කුමක්ද?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1Half-adder Sum equalsඅර්ධ එකතුකරන්නාගේ එකතුව සමාන වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
XOR of the two bits.බිටු දෙකේ XOR.
2Half-adder Carry equalsඅර්ධ එකතුකරන්නාගේ Carry සමාන වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
AND of the two bits.බිටු දෙකේ AND.
3A full adder has how many inputs?සම්පූර්ණ එකතුකරන්නාකට ආදාන කීයක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
A, B and carry-in.A, B සහ carry-in.
4Full-adder Sum equalsසම්පූර්ණ එකතුකරන්නාගේ එකතුව සමාන වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
XOR of all three.තුනේම XOR.
5Full-adder Cout equalsසම්පූර්ණ එකතුකරන්නාගේ Cout සමාන වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
AB + BCin + ACin.AB + BCin + ACin.
6For A=1,B=1 on a half adder, S and C areඅර්ධ එකතුකරන්නා මත A=1,B=1 සඳහා S සහ C
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
1+1 = 10₂.1+1 = 10₂.
7A flip-flop storesFlip-flop එකක් ගබඩා කරන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Basic memory cell = 1 bit.මූලික මතක කොටුව = බිටු 1.
8Feedback in a flip-flop is used toFlip-flop එකක ප්රතිපෝෂණය භාවිත වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Output fed back keeps Q.ප්රතිදානය ආපසු යැවීමෙන් Q තබයි.
9SR flip-flop: S=1, R=0 meansSR flip-flop: S=1, R=0 යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Set input active.Set ආදානය සක්රියයි.
10SR flip-flop: S=R=0 meansSR flip-flop: S=R=0 යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Memory / hold state.මතක / hold තත්ත්වය.
11Which is forbidden in a basic SR latch?මූලික SR latch එකක තහනම් වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Both set and reset at once.එකවර set සහ reset.
12An 8-bit adder needs how many full adders (roughly)?බිටු 8 එකතුකරන්නාකට සම්පූර්ණ එකතුකරන්නන් කීයක් (ආසන්න වශයෙන්)ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
One per bit column.බිටු තීරුවකට එකක්.
13Which term means: “Adds two bits: S = A ⊕ B, C = A · B. No Cin”?“බිටු දෙකක් එකතු කරයි: S = A ⊕ B, C = A · B. Cin නැත” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Half adder – Adds two bits: S = A ⊕ B, C = A · B. No Cin.අර්ධ එකතුකරන්නා – බිටු දෙකක් එකතු කරයි: S = A ⊕ B, C = A · B. Cin නැත.
14Which term means: “Adds A, B and Cin: S = A⊕B⊕Cin, Cout = majority”?“A, B සහ Cin එකතු කරයි: S = A⊕B⊕Cin, Cout = බහුතරය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Full adder – Adds A, B and Cin: S = A⊕B⊕Cin, Cout = majority.සම්පූර්ණ එකතුකරන්නා – A, B සහ Cin එකතු කරයි: S = A⊕B⊕Cin, Cout = බහුතරය.
15Which term means: “The result bit of an adder column (XOR of the inputs)”?“එකතුකරන්නා තීරුවක ප්රතිඵල බිටුව (ආදානවල XOR)” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Sum bit – The result bit of an adder column (XOR of the inputs).එකතු බිටුව – එකතුකරන්නා තීරුවක ප්රතිඵල බිටුව (ආදානවල XOR).
16Which term means: “The extra bit that goes to the next column when the sum ≥ 2”?“එකතුව ≥ 2 වූ විට ඊළඟ තීරුවට යන අමතර බිටුව” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Carry – The extra bit that goes to the next column when the sum ≥ 2.Carry – එකතුව ≥ 2 වූ විට ඊළඟ තීරුවට යන අමතර බිටුව.
17Which term means: “Carry in from the previous column; carry out to the next”?“පෙර තීරුවෙන් carry ඇතුළු වීම; ඊළඟට carry පිටවීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Cin / Cout – Carry in from the previous column; carry out to the next.Cin / Cout – පෙර තීරුවෙන් carry ඇතුළු වීම; ඊළඟට carry පිටවීම.
18Which term means: “A memory cell that stores one bit using feedback”?“ප්රතිපෝෂණයෙන් බිටු එකක් ගබඩා කරන මතක කොටුවකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Flip-flop – A memory cell that stores one bit using feedback.Flip-flop – ප්රතිපෝෂණයෙන් බිටු එකක් ගබඩා කරන මතක කොටුවකි.
19Which term means: “Wiring an output back to an input so the circuit can hold state”?“පරිපථයට තත්ත්වය තබා ගත හැකි වන සේ ප්රතිදානය ආදානයකට ආපසු සම්බන්ධ කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Feedback loop – Wiring an output back to an input so the circuit can hold state.ප්රතිපෝෂණ වළල්ල – පරිපථයට තත්ත්වය තබා ගත හැකි වන සේ ප්රතිදානය ආදානයකට ආපසු සම්බන්ධ කිරීම.
20Which term means: “Set-Reset latch: S sets Q=1, R resets Q=0, 00 holds”?“Set-Reset latch: S මගින් Q=1, R මගින් Q=0, 00 තබා ගනී” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
SR flip-flop – Set-Reset latch: S sets Q=1, R resets Q=0, 00 holds.SR flip-flop – Set-Reset latch: S මගින් Q=1, R මගින් Q=0, 00 තබා ගනී.
MCQ answer keyMCQ පිළිතුරු
- C – XOR of the two bits.බිටු දෙකේ XOR.
- A – AND of the two bits.බිටු දෙකේ AND.
- E – A, B and carry-in.A, B සහ carry-in.
- B – XOR of all three.තුනේම XOR.
- C – AB + BCin + ACin.AB + BCin + ACin.
- D – 1+1 = 10₂.1+1 = 10₂.
- D – Basic memory cell = 1 bit.මූලික මතක කොටුව = බිටු 1.
- B – Output fed back keeps Q.ප්රතිදානය ආපසු යැවීමෙන් Q තබයි.
- E – Set input active.Set ආදානය සක්රියයි.
- A – Memory / hold state.මතක / hold තත්ත්වය.
- B – Both set and reset at once.එකවර set සහ reset.
- C – One per bit column.බිටු තීරුවකට එකක්.
- E – Half adder – Adds two bits: S = A ⊕ B, C = A · B. No Cin.අර්ධ එකතුකරන්නා – බිටු දෙකක් එකතු කරයි: S = A ⊕ B, C = A · B. Cin නැත.
- A – Full adder – Adds A, B and Cin: S = A⊕B⊕Cin, Cout = majority.සම්පූර්ණ එකතුකරන්නා – A, B සහ Cin එකතු කරයි: S = A⊕B⊕Cin, Cout = බහුතරය.
- D – Sum bit – The result bit of an adder column (XOR of the inputs).එකතු බිටුව – එකතුකරන්නා තීරුවක ප්රතිඵල බිටුව (ආදානවල XOR).
- D – Carry – The extra bit that goes to the next column when the sum ≥ 2.Carry – එකතුව ≥ 2 වූ විට ඊළඟ තීරුවට යන අමතර බිටුව.
- E – Cin / Cout – Carry in from the previous column; carry out to the next.Cin / Cout – පෙර තීරුවෙන් carry ඇතුළු වීම; ඊළඟට carry පිටවීම.
- B – Flip-flop – A memory cell that stores one bit using feedback.Flip-flop – ප්රතිපෝෂණයෙන් බිටු එකක් ගබඩා කරන මතක කොටුවකි.
- C – Feedback loop – Wiring an output back to an input so the circuit can hold state.ප්රතිපෝෂණ වළල්ල – පරිපථයට තත්ත්වය තබා ගත හැකි වන සේ ප්රතිදානය ආදානයකට ආපසු සම්බන්ධ කිරීම.
- A – SR flip-flop – Set-Reset latch: S sets Q=1, R resets Q=0, 00 holds.SR flip-flop – Set-Reset latch: S මගින් Q=1, R මගින් Q=0, 00 තබා ගනී.
Structured Questionsව්යුහගත ප්රශ්න
1Draw the truth table of a half adder and write S and C as Boolean expressions.අර්ධ එකතුකරන්නාගේ සත්යතා වගුව අඳින්න සහ S සහ C බූලියානු ප්රකාශන ලෙස ලියන්න. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Explain why a full adder is needed for bits above the LSB.LSB ට ඉහළ බිටු සඳහා සම්පූර්ණ එකතුකරන්නාක් අවශ්ය වන්නේ ඇයිදැයි පැහැදිලි කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3For A=1, B=1, Cin=0 find S and Cout of a full adder. Show working.A=1, B=1, Cin=0 සඳහා සම්පූර්ණ එකතුකරන්නාගේ S සහ Cout සොයන්න. ක්රියාවලිය පෙන්වන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4Describe how a flip-flop stores a bit and what S=R=0 means in an SR flip-flop.Flip-flop එකක් බිටුවක් ගබඩා කරන ආකාරය සහ SR flip-flop එකක S=R=0 අදහස් කරන්නේ කුමක්දැයි විස්තර කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5State the four SR input combinations and their effects.SR ආදාන සංයෝජන හතර සහ ඒවායේ බලපෑම් ප්රකාශ කරන්න. (4 marksලකුණු 4)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Half adder: S = A ⊕ B, C = A · B (no Cin).අර්ධ එකතුකරන්නා: S = A ⊕ B, C = A · B (Cin නැත).
- Full adder: S = A ⊕ B ⊕ Cin, Cout = majority(A,B,Cin).සම්පූර්ණ එකතුකරන්නා: S = A ⊕ B ⊕ Cin, Cout = බහුතරය.
- Chain full adders to add multi-bit numbers in the ALU.ALU තුළ බහු-බිටු සංඛ්යා එකතු කිරීමට සම්පූර්ණ එකතුකරන්නන් දාමගත කරන්න.
- A flip-flop uses feedback to store one bit.Flip-flop එකක් ප්රතිපෝෂණයෙන් බිටු එකක් ගබඩා කරයි.
- SR: 10 set, 01 reset, 00 hold, 11 forbidden.SR: 10 set, 01 reset, 00 hold, 11 තහනම්.
Downloadsබාගත කිරීම්
Full Lesson 4 PDFසම්පූර්ණ පාඩම 4 PDF: English · සිංහල
Next: Lesson 4 A/L Exam Practiceඊළඟට: පාඩම 4 A/L විභාග පුහුණුව →
