Chapterبەش 7 · Lectureوانە 7.1
Boolean Expressions and Lawsدەربڕینە بوولییەکان و یاساکانی جەبری بوول
The language of Boolean algebra — variables, complements, literals, sum and product terms, and why + means OR — and its first three laws: commutative, associative and distributive (with factoring), each proved by a truth table and drawn as gates. The same laws hold for sets and for propositional logic.
زمانی — ، ، ، و و بۆچی + واتە OR — و سێ یاسای یەکەمی: ، و (لەگەڵ )، هەر یەکەیان بە سەلمێنراوە و وەک کێشراوە. هەمان یاساکان بۆ و بۆ ڕاستن.
What you will learnچی فێر دەبیت
- Name the parts of a Boolean expression: variables, complements, literals, sum terms and product terms.
- Read + as OR and · as AND, and evaluate an expression in the right order.
- State the commutative, associative and distributive laws and draw them as gate circuits.
- Prove a law (or find a counterexample) with a truth table.
- Factor an expression to save gates.
- بەشەکانی ناو ببەیت: ، ، ، و .
- + وەک OR و · وەک AND بخوێنیتەوە و بە ڕیزبەندیی دروست هەڵبسەنگێنیت.
- ، و بڵێیت و وەک سووڕی بیانکێشیت.
- یاسایەک بە بسەلمێنیت (یان نموونەیەکی پێچەوانە بدۆزیتەوە).
- شیتەڵ بکەیت بۆ کەمکردنەوەی .
An algebra for circuitsجەبرێک بۆ سووڕەکان
In 1847 and 1854 the English mathematician George Boole wrote the rules of logic as algebra, with only two values. In 1937 Claude Shannon showed in his master's thesis that the same algebra describes circuits of switches and relays. Since then engineers write a circuit as an expression, change the expression with a few fixed laws, and get a smaller circuit that behaves exactly the same.
لە ساڵانی 1847 و 1854ـدا بیرکاریزانی ئینگلیز جۆرج بوول یاساکانی لۆجیکی وەک جەبر نووسی، تەنها بە دوو نرخ. لە ساڵی 1937ـدا کلۆد شانۆن لە نامەی ماستەرەکەیدا پیشانی دا کە هەمان جەبر وەسفی سووڕی و ڕیلەکان دەکات. لەو کاتەوە ئەندازیاران سووڕێک وەک دەنووسن، بە چەند یاسایەکی جێگیر دەگۆڕن و سووڕێکی بچووکتر وەردەگرن کە ڕێک هەمان کار دەکات.
The algebra of the two values 0 and 1 with the operations AND (·), OR (+) and NOT (a bar). George Boole created it in 1854; Claude Shannon used it in 1937 to design switching circuits.
جەبری دوو نرخی 0 و 1ـە لەگەڵ کارەکانی AND (·)، OR (+) و NOT (هێڵی سەرەوە). جۆرج بوول لە ساڵی 1854دا دایهێنا و کلۆد شانۆن لە 1937دا بۆ دیزاینی بەکاری هێنا.
This lesson builds the vocabulary of Boolean expressions and the first three laws: commutative, associative and distributive. The next lesson adds twelve shorter rules.
ئەم وانەیە وشەکانی و سێ یاسای یەکەم فێر دەکات: ، و . وانەی داهاتوو دوازدە یاسای کورتتر زیاد دەکات.
Variables, complements and literalsگۆڕاوە بوولییەکان، تەواوکەرەکان و لیتەراڵەکان
A letter, such as A, B or X, that stands for a logic value that can only be 0 or 1. It often names an input or output of a circuit.
پیتێکە، وەک A، B یان X، کە جێگەی نرخێکی لۆجیکی دەگرێتەوە کە تەنها دەتوانێت 0 یان 1 بێت. زۆرجار ناوی یان سووڕێکە.
A is a letter such as A, B or X that can only be 0 or 1. It usually names a wire: an input or the output of a circuit. The of a variable is its opposite value, written with a bar, (“A bar”), or with a prime, . A is a variable or its complement.
پیتێکە وەک A، B یان X کە تەنها دەتوانێت 0 یان 1 بێت. بە زۆری ناوی وایەرێکە: یان سووڕێک. نرخە پێچەوانەکەیەتی و بە هێڵێک لەسەریەوە دەنووسرێت، («A بار»)، یان بە پرایم، . بریتییە لە یان .
Example: has three input variables (A, B and C) and four literals (, B, A and C). A and count as two different literals.
نموونە: سێ هەیە (A، B و C کە ) و چوار (، B، A و C). A و وەک دوو جیاواز دەژمێردرێن.
Variables, complements and literalsگۆڕاوە بوولییەکان، تەواوکەرەکان و لیتەراڵەکان
+ means OR, · means AND+ واتە OR، · واتە AND
Boolean algebra borrows two signs from arithmetic but gives them logic meanings. Boolean addition () is the OR operation, and Boolean multiplication (, or nothing at all: ) is the AND operation. In Boolean algebra applied to circuits, “addition” and “OR” are the same thing.
دوو نیشانە لە ژمێریاری وەردەگرێت بەڵام واتای لۆجیکییان پێدەدات. کۆکردنەوەی بوولی () هەمان ORـە و لێکدانی بوولی (، یان هیچ نیشانەیەک: ) هەمان ANDـە. لە کاتێک بۆ سووڕەکان بەکار دێت، «کۆکردنەوە» و «OR» یەک شتن.
| A | B | ||
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 |
When an expression mixes the operations, the order is: first the bars (NOT), then AND, then OR — just as multiplication comes before addition. So means . Use brackets to change the order: .
کاتێک لە NOT، AND و OR تێکەڵ دەبن، ڕیزبەندییەکە () بەم شێوەیەیە: سەرەتا هێڵەکان (NOT)، پاشان AND، پاشان OR — هەروەک لێکدان پێش کۆکردنەوە دێت. بۆیە واتە . بۆ گۆڕینی ڕیزبەندییەکە کەوانە بەکار بهێنە: .
Variables, complements and literalsگۆڕاوە بوولییەکان، تەواوکەرەکان و لیتەراڵەکان
Sum terms and product termsبڕەکانی کۆ و بڕەکانی لێکدان
A is literals joined by OR, such as . It is 0 in one case only: when every literal in it is 0 — here , , . A is literals joined by AND, such as . It is 1 in one case only: when every literal is 1 — here , , .
بریتییە لە چەند کە بە OR بەیەکەوە بەستراون، وەک . تەنها لە یەک حاڵەتدا 0ـە: کاتێک هەموو 0 بن — لێرەدا ، ، . بریتییە لە چەند کە بە AND بەیەکەوە بەستراون، وەک . تەنها لە یەک حاڵەتدا 1ـە: کاتێک هەموو 1 بن — لێرەدا ، ، .
An OR gate makes a sum term and an AND gate makes a product term. Later in the course, whole circuits are written as sums of product terms and products of sum terms.
دروست دەکات و . دواتر لە کۆرسەکەدا سووڕە تەواوەکان وەک کۆی و لێکدانی دەنووسرێن.
How to prove a law: try every rowچۆن یاسایەک دەسەلمێنیت: هەموو ڕیزەکان تاقی بکەرەوە
In school algebra a variable can take endless values, so we cannot test them all. A Boolean variable has only two values. An equation with n variables therefore has only cases, and we can check every one of them in a truth table. This is called perfect induction.
لە جەبری قوتابخانەدا دەتوانێت بێکۆتا نرخ وەربگرێت، بۆیە ناتوانین هەموویان تاقی بکەینەوە. تەنها دوو نرخی هەیە. کەواتە یەکسانییەک بە n تەنها حاڵەتی هەیە و دەتوانین هەموویان لە بپشکنین. ئەمە پێی دەوترێت تەواو.
Write all input rows, counting in binary.
هەموو ڕیزی بنووسە، بە ژماردن بە .
Work out the left side in one column (use helper columns for its parts).
لای چەپ لە ستوونێکدا بدۆزەرەوە (بۆ بەشەکانی ستوونی یارمەتیدەر بەکار بهێنە).
Work out the right side in another column.
لای ڕاست لە ستوونێکی تردا بدۆزەرەوە.
If the two columns agree in every row, the law is true. One row that disagrees (a counterexample) proves it false.
ئەگەر دوو ستوونەکە لە هەموو ڕیزێکدا وەک یەک بن، یاساکە ڕاستە. یەک ڕیز کە جیاواز بێت (نموونەیەکی پێچەوانە) پیشان دەدات کە هەڵەیە.
Commutative lawsیاساکانی ئاڵوگۆڕ
The order in which variables are ORed or ANDed makes no difference. For a gate, this means you may swap its input wires and the output stays the same.
ئەو ڕیزبەندییەی کە پێی OR یان AND دەکرێن هیچ جیاوازییەک دروست ناکات. بۆ ئەمە واتای ئەوەیە کە دەتوانیت وایەرەکانی بگۆڕیتەوە و وەک خۆی دەمێنێتەوە.
| A | B | ||||
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 |
Associative lawsیاساکانی یەکتربەستن
When you OR (or AND) three or more variables, the grouping does not matter: the result is the same whichever pair you combine first. This is why we can simply write and , and why a 3-input gate can be built from two 2-input gates.
کاتێک سێ یان زیاتر بە OR (یان بە AND) پێکەوە دەبەستیت، کۆمەڵکردنەکە گرنگ نییە: ئەنجامەکە هەمان شتە هەر جووتێک سەرەتا تێکەڵ بکەیت. بۆیە دەتوانین بە سادەیی بنووسین و . هەر بۆیەشە سێ دەتوانرێت لە دوو دوو دروست بکرێت.
| A | B | C | ||||
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The distributive lawیاسای بەشینەوە
ORing two variables and then ANDing the result with A gives the same as ANDing A with each variable and then ORing the two products. As circuits: “one OR, then one AND” equals “two ANDs, then one OR”.
OR کردنی دوو و پاشان AND کردنی ئەنجامەکە لەگەڵ A هەمان شتە وەک AND کردنی A لەگەڵ هەر و پاشان OR کردنی هەردوو لێکدراوەکە. وەک سووڕ: «یەک OR، پاشان یەک AND» یەکسانە بە «دوو AND، پاشان یەک OR».
The distributive lawیاسای بەشینەوە
Proving it row by rowسەلماندن ڕیز بە ڕیز
Three variables give rows. The animation feeds every row into both circuits; the table below holds the same check with all the helper columns.
سێ ڕیز دەدەن. ئەنیمەیشنەکە هەموو ڕیزێک دەداتە هەردوو سووڕەکە؛ خشتەکەی خوارەوە هەمان پشکنین بە هەموو ستوونە یارمەتیدەرەکانەوە پیشان دەدات.


| A | B | C | |||||
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The distributive lawیاسای بەشینەوە
Factoring: the law read backwardsشیتەڵکردن: یاساکە بە پێچەوانەوە
Read from right to left, the distributive law is : a variable common to several product terms is taken outside a bracket. replaces two ANDs and one OR with one OR and one AND, so the circuit saves a gate and does the same job.
ئەگەر لە ڕاستەوە بۆ چەپ بخوێندرێتەوە، : کە لە چەند هاوبەشە دەبرێتە دەرەوەی کەوانە. لە جیاتی دوو AND و یەک OR، یەک OR و یەک AND دادەنێت، بۆیە سووڕەکە کەم دەکاتەوە و هەمان کار دەکات.
- : three ANDs and an OR become one OR and one AND.
- : complements factor the same way.
- : the law used twice to expand, the opposite direction.
- : سێ AND و OR دەبنە یەک OR و یەک AND.
- : بە هەمان شێوە شیتەڵ دەکرێن.
- : یاساکە دوو جار بۆ کردنەوە بەکار هاتووە، ئاڕاستە پێچەوانەکە.
The same laws in sets and in logicهەمان یاساکان لە کۆمەڵەکاندا و لە لۆجیکدا
You may have met these laws before. In set operations union and intersection obey them, and in propositional logic “or” and “and” do too. They are one algebra in three costumes:
لەوانەیە پێشتر ئەم یاسایانەت بینیبێت. لە کۆمەڵەکاندا، و پەیڕەویان دەکەن. لە لۆجیکی گوزارەیی هەمان شت بۆ «یان» و «و» ڕاستە. یەک جەبرن بە سێ جل:
| Boolean algebra | Sets | Propositional logic |
|---|---|---|
| (OR) | ||
| (AND) | ||
| (NOT) | ||
| 0, 1 | , U | false, trueهەڵە، ڕاست |
There is a bonus rule, the . Take any true law, swap every + with · and every 0 with 1, and you get another true law. The dual of is — the second distributive law above. For sets the swap is ∪ with ∩ and with U.
یاسایەکی زیادەش هەیە: . هەر یاسایەکی ڕاست وەربگرە، هەموو + بکە بە · و هەموو 0 بکە بە 1 (و بە پێچەوانەوە)، یاسایەکی ڕاستی تر وەردەگریت. دووانەی بریتییە لە — دووەمی سەرەوە. بۆ ئاڵوگۆڕەکە ∪ لەگەڵ ∩ و لەگەڵ Uـە.
The commutative, associative and distributive laws compared with ordinary number arithmetic, with circuits and truth tables.
، و بەراورد بە ژمێرکاریی ژمارە ئاساییەکان، لەگەڵ و .
Chapter 'Properties of base 10 numbers' (7:59-12:40): commutative, associative and both distributive laws in ∧/∨ notation, compared with ordinary numbers.
بەشی Properties of base 10 numbers (7:59 تا 12:40): ، و هەردوو بە و ، بەراورد بە ژمارە ئاساییەکان.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | What is rightڕاستەکەی |
|---|---|
| Treating + as arithmetic: or .مامەڵەکردن لەگەڵ + وەک ژمێریاری: یان . | In Boolean algebra + is OR, so .لە + بریتییە لە OR، بۆیە . |
| Dropping brackets: writing as .لابردنی کەوانە: نووسینی وەک . | A multiplies every term inside: . For , the wrong form gives 1 instead of 0.A لە هەموو بڕێکی ناوەوە لێک دەدرێت: . بۆ و شێوە هەڵەکە لە جیاتی 0، 1 دەدات. |
| Ignoring the order of operations: reading as .پشتگوێخستنی : خوێندنەوەی وەک . | AND before OR: .AND پێش OR: . |
| “Cancelling” as in school algebra: from concluding .«لابردن» وەک جەبری قوتابخانە: گەیشتن بە لە یەکسانیی . | Not allowed: with both sides are 1 whatever B and C are.ڕێگەپێدراو نییە: بە هەردوو لا 1ـن، B و C هەرچییەک بن. |
| Counting A and as one literal.ژماردنی A و وەک یەک . | They are two different literals of the same variable.دوو جیاوازن لە هەمان . |
Exercisesڕاهێنانەکان
For each expression, say whether it is a sum term or a product term and list its literals: (a) (b) (c) .
بۆ هەر ، بڵێ یان و بنووسە: (أ) (ب) (ج) .
Show answerوەڵامەکە پیشان بدە
- (a) product term; literals , B, . It is 1 only for , , .
- (b) sum term; literals A, , D. It is 0 only for , , .
- (c) product term; literals and Y. It is 1 only for , .
- (أ) ؛ : ، B، . تەنها بۆ ، ، دەبێتە 1.
- (ب) ؛ : A، ، D. تەنها بۆ ، ، دەبێتە 0.
- (ج) ؛ : و Y. تەنها بۆ ، دەبێتە 1.
Find for (a) , , and (b) , , .
بدۆزەرەوە بۆ (أ) ، ، و (ب) ، ، .
Hintئاماژە
Bars first, then AND, then OR.
سەرەتا هێڵەکان، پاشان AND، پاشان OR.
Show answerوەڵامەکە پیشان بدە
Prove the associative law for AND, , with a truth table.
بۆ AND، ، بە بسەلمێنە.
Show answerوەڵامەکە پیشان بدە
| A | B | C | ||||
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The columns and are equal in all 8 rows (1 only in row 111), so the law holds.
ستوونەکانی و لە هەر 8 ڕیزەکەدا یەکسانن (تەنها لە ڕیزی 111ـدا 1ـن)، بۆیە یاساکە ڕاستە.
Factor (a) and (b) . How many 2-input gates does (a) need before and after?
(أ) و (ب) شیتەڵ بکە. (أ) پێش و دوای ئەوە چەند دوو پێویستە؟
Show answerوەڵامەکە پیشان بدە
- (a) . Before: three ANDs and two ORs (five gates). After: two ORs and one AND (three gates).
- (b) : XY is common to both product terms.
- (أ) . پێش: سێ AND و دوو OR (پێنج ). دوای: دوو OR و یەک AND (سێ ).
- (ب) : XY لە هەردوو هاوبەشە.
Use the distributive law to expand , then check your answer for , , , .
بەکار بهێنە بۆ کردنەوەی ، پاشان وەڵامەکەت بۆ ، ، ، بپشکنە.
Show answerوەڵامەکە پیشان بدە
Check: left ; right . ✓
پشکنین: لای چەپ ؛ لای ڕاست . ✓
Decide whether each is a law. If not, give a counterexample. (a) (b) .
بڕیار بدە ئایا هەر یەکێکیان یاسایە. ئەگەر نا، نموونەیەکی پێچەوانە بدە. (أ) (ب) .
Show answerوەڵامەکە پیشان بدە
- (a) A law: the second distributive law (rule 12). It holds in all 8 rows.
- (b) Not a law: , , gives 0 on the left and 1 on the right.
- (أ) یاسایە: دووەم (یاسای 12). لە هەر 8 ڕیزەکەدا ڕاستە.
- (ب) یاسا نییە: ، ، لای چەپ 0 و لای ڕاست 1 دەدات.
Summaryپوختە
- A literal is a variable or its complement; a sum term ORs literals, a product term ANDs them.
- + is OR and · is AND, so . Order: NOT, then AND, then OR.
- Commutative: , .
- Associative: , .
- Distributive: ; read backwards it is factoring.
- Any law can be proved by checking all rows of a truth table.
- یان ؛ OR دەکات و ANDـیان دەکات.
- + بریتییە لە OR و · لە AND، بۆیە . ڕیزبەندی: NOT، پاشان AND، پاشان OR.
- : ، .
- : ، .
- : ؛ بە پێچەوانەوە خوێندنەوەی .
- هەر یاسایەک دەتوانرێت بە پشکنینی هەموو ڕیزی بسەلمێنرێت.
What is in Boolean algebra?لە جەبری بوولدا چەندە؟
1, because + means OR.
1، چونکە + واتە OR.
Which law lets you build a 3-input OR from two 2-input ORs?کام یاسا ڕێگە دەدات ORـی سێ نێوخستە لە دوو ORـی دوو نێوخستە دروست بکەیت؟
The associative law.
.
What do you get when you factor ?کاتێک شیتەڵ دەکەیت چی وەردەگریت؟
, which needs one gate fewer.
کە کەمتری پێویستە.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
Kurdish (Sorani): commutative, associative and distributive laws with gate drawings, the 12 rules in the lesson's order, then De Morgan's theorems.
بە کوردیی سۆرانی: ، و بە وێنەی ، دوازدە یاساکە بە ڕیزبەندیی وانەکە، پاشان .
0:00-3:30: commutative, associative and distributive laws with gates.
لە 0:00 تا 3:30: ، و بە .
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
The 12 Rules of Boolean Algebraدوازدە یاساکەی جەبری بوول
Related lecturesوانە پەیوەندیدارەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Wikipedia: Boolean algebra (history, laws, duality principle, proof by truth tables)
- Wikipedia: Algebra of sets (the same laws for union, intersection and complement)
- T. L. Floyd, Digital Fundamentals, 11th ed. (the course reference book): sections 4-1 and 4-2, used for topic order only
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.