XOR Gate — Truth Table, Symbol & Boolean Expression
XOR ද්වාරය — සත්යතා වගුව, සංකේතය සහ බූලීය ප්රකාශනය
An XOR gate (exclusive OR) is a digital logic gate that outputs 1 when its inputs are DIFFERENT, and 0 when they are the same.
It answers the question “are these two bits unequal?” — which is why XOR sits at the heart of comparators, adders and parity checks.
XOR ද්වාරයක් (Exclusive OR) යනු ආදාන දෙක එකිනෙකට වෙනස් වූ විට පමණක් ප්රතිදානය 1 ලබා දෙන ද්වාරයකි. ආදාන දෙකම සමාන වූ විට ප්රතිදානය 0 වේ.
ද්විමය අංක ගණිත එකතු කිරීම් (Half Adders), සංසන්දක සහ සමතාව (Parity) පරීක්ෂා කිරීමේදී XOR ද්වාරය ප්රධාන කාර්යභාරයක් ඉටු කරයි.
ANSI Symbol
Boolean Expression
Q = A ⊕ B
The circled plus is the exclusive-OR operator. In AND/OR form: Q = A·B̅ + Ā·B.
රවුම් කළ ධන ලකුණ ⊕ මඟින් Exclusive-OR දැක්වේ. AND/OR ආකෘතියෙන්: Q = A·B̅ + Ā·B වේ.
XOR Gate Truth TableXOR ද්වාරය සත්යතා වගුව
Computed by the same engine that powers the live sandbox — what you read here is exactly what you will measure.
සජීවී Sandbox පරිපථය ක්රියාත්මක වන එන්ජිමෙන්ම ගණනය කරන ලදී — මෙහි ඇති අගයන් සිමියුලේටරයේ ක්රියාකාරිත්වයට 100% සමාන වේ.
| A | B | Q (Output)Q (ප්රතිදානය) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
How the XOR Gate WorksXOR ද්වාරය ක්රියාත්මක වන ආකාරය
- Rows 01 and 10 produce 1; the matching rows 00 and 11 produce 0.
- XOR adds two bits and keeps only the sum digit — the “sum” half of a half-adder.
- Applying XOR twice with the same bit cancels out, which is why XOR is used in simple encryption and parity.
- 01 සහ 10 පේළිවලදී ප්රතිදානය 1 වේ; සමාන ආදාන වන 00 සහ 11 හිදී 0 වේ.
- බිටු 2ක් එකතු කිරීමේදී ඓක්යය (Sum) ලබා ගැනීමට XOR ද්වාරය භාවිත වේ.
- දත්ත ගුප්තකේතනය (Encryption) සහ දෝෂ හඳුනාගැනීම සඳහා XOR භාවිත කෙරේ.
Exam-style exampleවිභාග මට්ටමේ ප්රායෝගික උදාහරණය
A two-way stairway light has switches at both ends; flicking EITHER switch (but not both together) changes the lamp state. That toggle behaviour is exactly XOR.
පඩිපෙළක දෙකෙළවර ඇති ස්විච 2ක් මඟින් බල්බයක් පාලනය කිරීමේදී (Two-way switch), ඕනෑම එක් ස්විචයක් ක්රියාත්මක කළ විට බල්බය දැල්වේ — මෙය XOR හැසිරීමකි.
Build It Yourself in 3 Stepsපියවර 3කින් ඔබම සාදන්න
- Build it. Wire two switches into an XOR gate and on to a bulb in the sandbox.
- Find the pattern. Step through the combinations and watch the bulb light only on the mismatched pairs.
- Confirm in the table. Generate the truth table — 1 appears only in rows 01 and 10.
- පරිපථය සාදන්න. ස්විච 2ක් XOR ද්වාරයට සහ බල්බයට සම්බන්ධ කරන්න.
- හැසිරීම බලන්න. ආදාන වෙනස් වන 01 සහ 10 අවස්ථාවල පමණක් බල්බය දැල්වෙන අයුරු නිරීක්ෂණය කරන්න.
- සත්යතා වගුවෙන් තහවුරු කරන්න. සත්යතා වගුව ජනනය කර 01 සහ 10 හිදී පමණක් 1 ලැබෙන බව තහවුරු කරගන්න.
Open this exact circuit in the Sandbox
මෙම පරිපථය සෘජුවම Sandbox එකෙන් විවෘත කරන්න
The XOR Gate test circuit is pre-built and pre-wired — just toggle the switches.
XOR ද්වාරය පරීක්ෂණ පරිපථය සකස් කර වයර් කර ඇත — ස්විච මාරු කර ප්රතිඵලය බලන්න.
XOR Gate — FAQXOR ද්වාරය — නිතර අසන ප්රශ්න
What is another name for XOR?XOR ද්වාරය සඳහා භාවිත වන වෙනත් නම කුමක්ද?
Exclusive OR; some syllabi also call it the “difference” gate because it detects differing inputs.
Exclusive OR හෝ අසමානතා අනාවරකය (Inequality detector) ලෙස හැඳින්වේ.
How is XOR different from OR?XOR ද්වාරය OR ද්වාරයෙන් වෙනස් වන්නේ කෙසේද?
OR also outputs 1 when BOTH inputs are 1; XOR outputs 0 in that case — they differ only in the 11 row.
ආදාන දෙකම 1 වූ විට OR ද්වාරය 1 ලබා දෙන නමුත්, XOR ද්වාරය 0 ලබා දෙයි — වෙනස පවතින්නේ 11 අවස්ථාවේදී පමණි.
Where is XOR used in real electronics?ප්රායෝගික ඉලෙක්ට්රොනික විද්යාවේදී XOR භාවිත වන්නේ කොහේද?
Binary adders, parity generators/checkers, comparators and stream ciphers all rely on XOR.
ද්විමය එකතු කිරීම් (Adders), සමානතා පරික්ෂක (Parity Checkers) සහ ගුප්තකේතනය සඳහා XOR යොදා ගනී.