Chapterبەش 9 · Lectureوانە 9.1

From Expression to Circuit and Backلە دەربڕینی بوولییەوە بۆ سووڕ و بە پێچەوانەوە

Build the circuit of a Boolean expression, read the expression and truth table of a given circuit, and evaluate a circuit for given inputs — practised on the course's real exam circuits — then see why NAND and NOR alone can build anything.

دروست بکە، و دراو بخوێنەوە و بۆ دیاریکراو هەڵسەنگێنە — لەسەر ڕاستەقینەکانی تاقیکردنەوەکانی کۆرسەکە — پاشان ببینە بۆچی تەنها NAND یان NOR دەتوانن هەموو شتێک دروست بکەن.

20 min read21 خولەک خوێندنەوە · 19 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Draw the logic circuit of a Boolean expression, including bars over groups.
  • Write the expression and truth table of a given circuit.
  • Evaluate a circuit for given inputs and for waveform inputs.
  • Build NOT, AND and OR from NAND gates only or NOR gates only.
  • بکێشیت، لەگەڵ هێڵ لەسەر کۆمەڵەکان.
  • و دراو بنووسیت.
  • بۆ دیاریکراو و بۆ هەڵسەنگێنیت.
  • NOT، AND و OR تەنها لە یان تەنها لە دروست بکەیت.

One circuit, three jobsیەک سووڕی لۆجیکی، سێ کار

A combinational circuit is a network of logic gates whose outputs depend only on the present inputs — it has no memory (see what a gate is). Every such circuit can be written as a Boolean expression, and every expression can be built as a circuit. You will meet three jobs:

تۆڕێکە لە کە تەنها بەندن بە ئێستا — هیچ نییە (بڕوانە گەیت چییە). هەموو وا دەتوانرێت وەک بنووسرێت و هەموو دەتوانرێت وەک دروست بکرێت. سێ جۆر کار دەبینیت:

  • Implementation: expression → circuit. Draw the logic circuit of this expression.
  • Analysis: circuit → expression → truth table. What does this circuit do?
  • Evaluation: inputs → output. What is X when A=1A = 1, B=1B = 1, C=0C = 0, D=0D = 0?
  • جێبەجێکردن: ← . ئەم دەربڕینە بکێشە.
  • شیکردنەوە: ← ← . ئەم چی دەکات؟
  • هەڵسەنگاندن: ← . X چەندە کاتێک A=1A = 1، B=1B = 1، C=0C = 0، D=0D = 0؟

Both exams of this course asked for all three, so this lesson practises them on the real exam questions.

هەردوو تاقیکردنەوەکەی ئەم کۆرسە داوای هەر سێکیان کردبوو، بۆیە ئەم وانەیە لەسەر پرسیارە ڕاستەقینەکانی تاقیکردنەوەکان مەشقیان پێ دەکات.

Recipe and dishڕەچەتە و خواردن

Implementation is cooking from a recipe: the expression says which steps to do, and in which order. Analysis is the reverse: you taste a finished plate of dolma and write its recipe down. Evaluation is eating one plate — one set of inputs, one result.

جێبەجێکردن وەک لێنانی خواردنە بە ڕەچەتەیەک: دەڵێت چ هەنگاوێک بکەیت و بە چ ڕیزبەندییەک. شیکردنەوە پێچەوانەکەیەتی: تامی قاپێک دۆڵمەی ئامادە دەکەیت و ڕەچەتەکەی دەنووسیتەوە. هەڵسەنگاندنیش خواردنی یەک قاپە — یەک کۆمەڵە ، یەک ئەنجام.

Where the analogy stops workingسنووری ئەم نموونەیە

A cook can only guess a recipe from the taste. A circuit hides nothing: following the wires always gives the exact expression.

چێشتلێنەر تەنها دەتوانێت ڕەچەتەکە لە تامەکەوە مەزەندە بکات. هیچ ناشارێتەوە: شوێنکەوتنی وایەرەکان هەمیشە بە وردی دەدات.

Quick checkپشکنینی خێراA circuit gives X=1X = 1 for the inputs 101 today. Tomorrow the same inputs 101 are applied again. What is X? ئەمڕۆ بۆ ⁦101⁩ X=1X = 1 دەدات. سبەینێ دیسان هەمان ⁦101⁩ دەدرێتێ. X چەندە؟

From an expression to a circuitلە دەربڕینی بوولییەوە بۆ سووڕ

Methodڕێگا
  1. Find the step that is done last — usually the outermost + or the long bar. It becomes the output gate.

    ئەو هەنگاوە بدۆزەوە کە لە کۆتاییدا ئەنجام دەدرێت — زۆرجار دەرەوەترین + یان هێڵە درێژەکە. ئەوە دەبێتە .

  2. Work inward: each part that feeds that step is a smaller expression with its own gate on the left.

    بەرەو ناوەوە بڕۆ: هەر بەشێک کە دەچێتە ناو ئەو هەنگاوە بچووکترە و خۆی لە لای چەپ هەیە.

  3. A bar over one letter is a NOT gate (or a bubble on that gate input). A bar over a whole group makes the gate that builds the group a NAND or NOR (or adds a NOT after it).

    هێڵێک لەسەر یەک پیت (یان لەسەر ئەو ). هێڵێک لەسەر کۆمەڵێکی تەواو واتە ئەو کۆمەڵەکە دروست دەکات دەبێتە NAND یان NOR (یان NOTـێکی دوای دادەنرێت).

  4. Write the expression of every wire next to it. Then check one or two input combinations.

    دەربڕینی هەر وایەرێک لە تەنیشتیەوە بنووسە. پاشان یەک یان دوو تێکەڵەی پشکنین بکە.

Quick checkپشکنینی خێراWhich gate is the output gate of X=A+B‾⋅CX = \overline{A + B} \cdot C? بۆ X=A+B‾⋅CX = \overline{A + B} \cdot C کامەیە؟

Drawing a logic circuit from a given boolean expressionComputing and Maths Tuition by Matthew Xuereb · Englishئینگلیزی · 129K viewsبینین · 2K likesلایک

Four short worked examples of drawing a gate circuit from a Boolean expression, one gate for each operation.

چوار نموونەی شیکراوەی کورت بۆ کێشانی لە ، یەک بۆ هەر .

Chapters: 0:21 Example 1, 1:21 Example 2, 2:31 Example 3, 3:03 Example 4.

بەشەکان: ⁦0:21⁩ نموونەی 1، ⁦1:21⁩ نموونەی 2، ⁦2:31⁩ نموونەی 3، ⁦3:03⁩ نموونەی 4.

From an expression to a circuitلە دەربڕینی بوولییەوە بۆ سووڕ

A small example: an AND-OR circuitنموونەیەکی بچووک: سووڕێکی ⁦AND-OR⁩

Example: X=AB‾+BCX = A\overline{B} + BC. The last operation is the +, so the output gate is an OR. Its inputs are AB‾A\overline{B} (an AND of A and NOT B) and BCBC (an AND of B and C). That is one NOT, two ANDs and one OR — an AND-OR circuit, the usual shape of every SOP expression.

نموونە: X=AB‾+BCX = A\overline{B} + BC. کۆتا هەنگاو +ـە، بۆیە ORـە. AB‾A\overline{B}ـن (ANDـی A و ⁦NOT B⁩) و BCBC (ANDـی B و C). کەواتە یەک NOT، دوو AND و یەک OR — ⁦AND-OR⁩، کە شێوەی ئاسایی هەموو SOPـێکە.

Circuit for X = A B-bar + B C. Three vertical input lines A, B and C on the left. B goes through a NOT gate to give B-bar; an AND gate combines A and B-bar; a second AND gate combines B and C; both AND outputs go into an OR gate whose output is X.سووڕی لۆجیکیی X = A B-هێڵدار + B C. سێ هێڵی ستوونیی نێوخستە A، B و C لە لای چەپ. B دەچێتە ناو گەیتێکی NOT و B-هێڵدار دەدات؛ گەیتێکی AND A و B-هێڵدار پێکەوە دەبەستێت؛ گەیتێکی AND تر B و C؛ هەردوو دەرخستەکانی AND دەچنە ناو گەیتێکی OR کە دەرخستەکەی Xـە.
An SOP expression becomes an AND-OR circuit. A dot on a vertical line means the wire is connected; a crossing without a dot is not. دەبێتە ⁦AND-OR⁩. خاڵێک لەسەر هێڵی ستوونی واتە وایەرەکە پەیوەستە؛ یەکتربڕینی بێ خاڵ پەیوەست نییە.CêIT

A circuit can also have several outputs. When two outputs need the same product term, one gate builds it once and its wire feeds both: for X=AB+CX = AB + C and Y=AB+C‾DY = AB + \overline{C}D, a single AND gate makes ABAB for both OR gates — five gates instead of six.

دەتوانێت چەند هەبێت. کاتێک دوو پێویستیان بە هەمان هەیە، یەک یەک جار دروستی دەکات و وایەرەکەی دەچێتە ناو هەردووکیان: بۆ X=AB+CX = AB + C و Y=AB+C‾DY = AB + \overline{C}D، یەک ABAB بۆ هەردوو دروست دەکات — پێنج لە جیاتی شەش.

Quick checkپشکنینی خێراHow many gates does X=(A+B)C‾X = (A + B)\overline{C} need when it is built exactly as written?X=(A+B)C‾X = (A + B)\overline{C} پێویستی بە چەند هەیە ئەگەر ڕێک وەک نووسراوە دروست بکرێت؟

The exam circuit: AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}Cسووڕەکەی تاقیکردنەوە: AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}C

A written exam asked: draw the logic circuit of AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}C. The course author's answer used the method above:

تاقیکردنەوەیەکی نووسراو پرسیبووی: ئەمە بکێشە: AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}C. وەڵامەکەی خاوەنی کۆرسەکە ڕێگاکەی سەرەوەی بەکار هێنا:

  1. The last operation is the middle +, so the output gate is an OR with two inputs.
  2. First input: two ANDs make ABAB and ACAC; the long bar over their sum makes the gate that adds them a NOR: AB+AC‾\overline{AB+AC}.
  3. Second input: a 3-input AND with bubbles on its A and B inputs makes A‾ B‾C\overline{A}\,\overline{B}C — the bubbles do the job of two NOT gates.
  1. کۆتا هەنگاو +ـی ناوەڕاستە، بۆیە ORـێکە بە دوو .
  2. یەکەم: دوو AND ABAB و ACAC دروست دەکەن؛ هێڵە درێژەکە لەسەر کۆکەیان ئەو کۆیان دەکاتەوە دەکات بە NOR: AB+AC‾\overline{AB+AC}.
  3. دووەم: ANDـێکی سێ بە لەسەر A و B A‾ B‾C\overline{A}\,\overline{B}C دروست دەکات — کاری دوو دەکەن.
The exam circuit redrawn. Inputs A, B, C on vertical lines. An AND gate makes AB and a second AND gate makes AC; both feed a NOR gate whose output is the complement of AB + AC. A three-input AND gate with bubbles on its A and B inputs makes A-bar B-bar C. An OR gate combines the NOR output and the AND output into X.سووڕەکەی تاقیکردنەوە دووبارە کێشراوە. نێوخستەکانی A، B، C لەسەر هێڵی ستوونی. گەیتێکی AND AB دروست دەکات و گەیتێکی AND تر AC؛ هەردووکیان دەچنە ناو گەیتێکی NOR کە دەرخستەکەی تەواوکەری AB + ACـە. گەیتێکی AND بە سێ نێوخستە بە بازنەکانی پێچەوانەکردن لەسەر نێوخستەکانی A و B، A-هێڵدار B-هێڵدار C دروست دەکات. گەیتێکی OR دەرخستەی NOR و دەرخستەی AND پێکەوە دەکات بە X.
Five gates, drawn from the expression from the output backwards.پێنج ، لە کێشراون، لە بەرەو دواوە.CêIT
Truth table of the exam circuit, gate by gate تاقیکردنەوە، بە
ABCABCABABACACAB+AC‾\overline{AB+AC}A‾ B‾C\overline{A}\,\overline{B}CXX
00000101
00100111
01000101
01100101
10000101
10101000
11010000
11111000
Quick checkپشکنینی خێراIn this circuit, what is the job of the long bar over AB+ACAB+AC?لەم هێڵە درێژەکە لەسەر AB+ACAB+AC چ کارێک دەکات؟

The exam circuit: AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}Cسووڕەکەی تاقیکردنەوە: AB+AC‾+A‾ B‾C\overline{AB+AC}+\overline{A}\,\overline{B}C

Simplify first, build lessسەرەتا کورتی بکەرەوە، کەمتر دروست بکە

In the same exam the expression was then simplified with Boolean algebra to A‾+B‾ C‾\overline{A}+\overline{B}\,\overline{C}. One more step with De Morgan's theorem gives A‾+B+C‾=A(B+C)‾\overline{A}+\overline{B+C} = \overline{A(B+C)}: just an OR gate and a NAND gate. The truth table is identical (X=0X = 0 only for 101, 110 and 111), but the circuit has 2 gates instead of 5.

لە هەمان تاقیکردنەوەدا بە جەبری بوول کورت کرایەوە بۆ A‾+B‾ C‾\overline{A}+\overline{B}\,\overline{C}. هەنگاوێکی تر بە دەدات A‾+B+C‾=A(B+C)‾\overline{A}+\overline{B+C} = \overline{A(B+C)}: تەنها و . وەک یەکە (X تەنها بۆ ⁦101⁩، ⁦110⁩ و ⁦111⁩ یەکسانە بە ⁦0⁩)، بەڵام 2 هەیە لە جیاتی 5.

The simplified circuit: inputs B and C go into an OR gate; its output B + C and input A go into a NAND gate whose output is X, the complement of A times (B + C), equal to A-bar + B-bar C-bar.سووڕە کورتکراوەکە: نێوخستەکانی B و C دەچنە ناو گەیتێکی OR؛ دەرخستەکەی B + C و نێوخستەی A دەچنە ناو گەیتێکی NAND کە دەرخستەکەی Xـە، تەواوکەری A جارانی (B + C)، یەکسان بە A-هێڵدار + B-هێڵدار C-هێڵدار.
The same function with two gates: fewer chips, less power, a faster answer.هەمان بە دوو : کەمتر، وزەی کەمتر، وەڵامی خێراتر.CêIT

This is the real reason engineers simplify: every gate removed is cheaper, uses less power and makes the signal arrive sooner. Karnaugh maps give the same simplification by drawing instead of algebra.

ئەمە هۆکاری ڕاستەقینەی کورتکردنەوەیە لای ئەندازیاران: هەر لاببرێت هەرزانترە، وزەی کەمتر بەکار دەهێنێت و زووتر دەگات. نەخشەکانی کارنۆ هەمان کورتکردنەوە بە کێشان دەدەن لە جیاتی جەبر.

Quick checkپشکنینی خێراTwo circuits have the same truth table. One has 5 gates, the other 2. What is true?دوو هەمان هەیە. یەکێکیان 5 هەیە و ئەوی تر 2. چی ڕاستە؟

From a circuit to an expressionلە سووڕەوە بۆ دەربڕینی بوولی

Methodڕێگا
  1. Give every gate output a name or number, from left to right.

    بە هەر ناوێک یان ژمارەیەک بدە، لە چەپەوە بۆ ڕاست.

  2. Write each gate's output from its inputs — never skip a gate.

    هەر لە بنووسە — هیچ بەجێ مەهێڵە.

  3. The last gate gives the expression of X. Simplify it if you can.

    کۆتا X دەدات. ئەگەر توانیت کورتی بکەرەوە.

  4. Build the truth table, with a column for every named wire, to see what the circuit does.

    دروست بکە، بە ستوونێک بۆ هەر وایەرێکی ناونراو، بۆ ئەوەی ببینیت چی دەکات.

A circuit to analyse: inputs A and B on vertical lines. B goes through a NOT gate (output 1) and A through another NOT gate (output 2). One AND gate takes A and output 1 (its output is 3); another AND gate takes output 2 and B (its output is 4). Outputs 3 and 4 go into an OR gate whose output is X.سووڕێک بۆ شیکردنەوە: نێوخستەکانی A و B لەسەر هێڵی ستوونی. B دەچێتە ناو یەکەم گەیتی NOT (دەرخستەی 1) و A دەچێتە ناو دووەم گەیتی NOT (دەرخستەی 2). گەیتێکی AND A و دەرخستەی 1 وەردەگرێت (دەرخستەکەی 3ـە)؛ گەیتێکی AND تر دەرخستەی 2 و B وەردەگرێت (دەرخستەکەی 4ـە). دەرخستەکانی 3 و 4 دەچنە ناو گەیتێکی OR کە دەرخستەکەی Xـە.
Name the outputs ① to ④, then write them one by one. ناو بنێ ① تا ④، پاشان یەک بە یەک بیاننووسە.CêIT
①=B‾②=A‾③=AB‾④=A‾BX=③+④=AB‾+A‾B\begin{aligned} ① &= \overline{B} \qquad ② = \overline{A} \\ ③ &= A\overline{B} \qquad ④ = \overline{A}B \\ X &= ③ + ④ = A\overline{B} + \overline{A}B \end{aligned}
Truth table of the analysed circuit شیکراوەکە
ABAB① B‾①\ \overline{B}② A‾②\ \overline{A}③ AB‾③\ A\overline{B}④ A‾B④\ \overline{A}BXX
0011000
0101011
1010101
1100000

X is 1 exactly when A and B are different: this circuit is an XOR gate built from NOT, AND and OR gates, A⊕B=AB‾+A‾BA \oplus B = A\overline{B}+\overline{A}B (see XOR and XNOR). Analysis often reveals a familiar function hidden in a bigger circuit.

X ڕێک کاتێک 1ـە کە A و B جیاواز بن: ئەم کە لە NOT، AND و OR دروست کراوە، A⊕B=AB‾+A‾BA \oplus B = A\overline{B}+\overline{A}B (بڕوانە XOR و XNOR). شیکردنەوە زۆرجار ناسراو دەدۆزێتەوە کە لە ناو گەورەتردا شاردراوەتەوە.

Quick checkپشکنینی خێراIn the analysed circuit, what does wire ③ carry when A=1A = 1 and B=0B = 0?لە شیکراوەکەدا وایەری ③ چی هەڵدەگرێت کاتێک A=1A = 1 و B=0B = 0؟

The lab exam: design a bigger circuitتاقیکردنەوەی تاقیگە: دیزاینی سووڕێکی گەورەتر

The practical (lab) exam asked: design the logic circuit that represents

تاقیکردنەوەی تاقیگەکە پرسیبووی: دیزاین بکە کە ئەمە نیشان بدات:

X=[(AB‾+C)D]⊕[(CD‾+B)‾+A]‾X = \overline{\left[(\overline{AB}+C)D\right] \oplus \left[\overline{(C\overline{D}+B)}+A\right]}

Read the bars before you draw. The long bar over the whole XOR turns the output gate into an XNOR. Left part: the short bar over ABAB is a NAND; then an OR with C; then an AND with D. Right part: D‾\overline{D} is a bubble on one input of an AND with C; the bar over CD‾+BC\overline{D}+B makes the next gate a NOR; then an OR with A. The course author's circuit, which received full marks, is exactly this:

پێش کێشان هێڵەکان بخوێنەوە. هێڵە درێژەکە لەسەر هەموو XORـەکە دەکات بە XNOR. بەشی چەپ: هێڵە کورتەکە لەسەر ABAB NANDـە؛ پاشان ORـێک لەگەڵ C؛ پاشان ANDـێک لەگەڵ D. بەشی ڕاست: D‾\overline{D} لەسەر یەکێک لە ANDـێک لەگەڵ C؛ هێڵەکە لەسەر CD‾+BC\overline{D}+B دواتر دەکات بە NOR؛ پاشان ORـێک لەگەڵ A. خاوەنی کۆرسەکە کە نمرەی تەواوی وەرگرت ڕێک ئەمەیە:

The lab-exam circuit redrawn. Four vertical input lines A, B, C, D. Top branch: a NAND of A and B, then an OR with C, then an AND with D, giving (NOT AB + C) D. Bottom branch: an AND of C and D with a bubble on the D input, giving C D-bar; a NOR of that and B; then an OR with A. The two branches meet in an XNOR gate whose output is X.سووڕەکەی تاقیکردنەوەی تاقیگە دووبارە کێشراوە. چوار هێڵی ستوونیی نێوخستە: A، B، C، D. لقی سەرەوە: NANDـی A و B، پاشان OR لەگەڵ C، پاشان AND لەگەڵ D، کە (NOT AB + C) D دەدات. لقی خوارەوە: ANDـی C و D بە بازنەیەکی پێچەوانەکردن لەسەر نێوخستەی D، کە C D-هێڵدار دەدات؛ NORـی ئەوە و B؛ پاشان OR لەگەڵ A. هەردوو لقەکە دەچنە ناو گەیتێکی XNOR کە دەرخستەکەی Xـە.
Seven gates: NAND, OR, AND on top; AND (with a bubble), NOR, OR below; XNOR at the output.حەوت : NAND، OR، AND لە سەرەوە؛ AND (بە )، NOR، OR لە خوارەوە؛ XNOR لە .CêIT
Quick checkپشکنینی خێراWhich gate produces the bar over (CD‾+B)(C\overline{D}+B)?کام هێڵەکەی سەر (CD‾+B)(C\overline{D}+B) دروست دەکات؟

Evaluating a circuit for given inputsهەڵسەنگاندنی سووڕێک بۆ نێوخستەکانی دیاریکراو

Part B of the lab exam asked for the output in two cases. The method: write the input values on the input lines, then work gate by gate from left to right, writing each output on its wire, until you reach X.

بەشی Bـی تاقیکردنەوەی تاقیگە داوای دوو حاڵەتی کردبوو. ڕێگاکە: نرخی لەسەر هێڵەکانی بنووسە، پاشان بە لە چەپەوە بۆ ڕاست کار بکە و هەر یەکێکیان لەسەر وایەرەکەی بنووسە تا دەگەیتە X.

Animation of the lab-exam circuit with A = 1, B = 1, C = 0, D = 0. Value badges appear on the wires stage by stage: first the NAND gives 0 and the lower AND gives 0; then the OR gives 0 and the NOR gives 0; then the AND with D gives 0 and the OR with A gives 1; finally the XNOR receives 0 and 1, which differ, so X = 0.
Animation of the lab-exam circuit with A = 1, B = 1, C = 0, D = 0. Value badges appear on the wires stage by stage: first the NAND gives 0 and the lower AND gives 0; then the OR gives 0 and the NOR gives 0; then the AND with D gives 0 and the OR with A gives 1; finally the XNOR receives 0 and 1, which differ, so X = 0.
Case 1, left to right: the two branches give 0 and 1, so the XNOR outputs 0.حاڵەتی 1، لە چەپەوە بۆ ڕاست: دوو لقەکە 0 و 1 دەدەن، بۆیە ⁦XNOR 0⁩ دەدات.CêIT
Both exam casesهەردوو حاڵەتی تاقیکردنەوەکە
  1. Case 1: A=1, B=1, C=0, D=0A=1,\ B=1,\ C=0,\ D=0

    حاڵەتی 1: A=1, B=1, C=0, D=0A=1,\ B=1,\ C=0,\ D=0

    left=(1⋅1‾+0)⋅0=(0+0)⋅0=0right=0⋅0‾+1‾+1=1‾+1=1X=0⊕1‾=1‾=0\begin{aligned} \text{left} &= (\overline{1\cdot 1}+0)\cdot 0 = (0+0)\cdot 0 = 0 \\ \text{right} &= \overline{0\cdot\overline{0}+1}+1 = \overline{1}+1 = 1 \\ X &= \overline{0 \oplus 1} = \overline{1} = 0 \end{aligned}
  2. Case 2: A=0, B=1, C=0, D=1A=0,\ B=1,\ C=0,\ D=1

    حاڵەتی 2: A=0, B=1, C=0, D=1A=0,\ B=1,\ C=0,\ D=1

    left=(0⋅1‾+0)⋅1=(1+0)⋅1=1right=0⋅1‾+1‾+0=1‾+0=0X=1⊕0‾=1‾=0\begin{aligned} \text{left} &= (\overline{0\cdot 1}+0)\cdot 1 = (1+0)\cdot 1 = 1 \\ \text{right} &= \overline{0\cdot\overline{1}+1}+0 = \overline{1}+0 = 0 \\ X &= \overline{1 \oplus 0} = \overline{1} = 0 \end{aligned}

Both answers are 0, as the course author wrote. Do not conclude that the circuit always gives 0: an XNOR is 1 whenever its two inputs are equal. For example, A=0, B=0, C=0, D=1A=0,\ B=0,\ C=0,\ D=1 makes both branches 1, so X=1X = 1. The full truth table is one of the exercises below.

هەردوو وەڵامەکە 0ن، وەک خاوەنی کۆرسەکە نووسیبووی. ئەوە دەرمەهێنە کە هەمیشە 0 دەدات: XNOR هەر کاتێک 1ـە کە دوو یەکسان بن. بۆ نموونە A=0, B=0, C=0, D=1A=0,\ B=0,\ C=0,\ D=1 هەردوو لقەکە دەکات بە 1، بۆیە X=1X = 1. تەواو یەکێکە لە ڕاهێنانەکانی خوارەوە.

Quick checkپشکنینی خێراIn case 2 the left branch is 1 and the right branch is 0. Why is X=0X = 0?لە حاڵەتی 2دا لقی چەپ 1ـە و لقی ڕاست 0. بۆچی X=0X = 0؟

When the inputs are waveformsکاتێک نێوخستەکان شێوەی شەپۆلن

In a real machine the inputs change over time, so they are drawn as waveforms in a timing diagram. A combinational circuit is handled the same way as a single gate: cut the time axis into intervals where no input changes, and evaluate the circuit once per interval.

لە ئامێرێکی ڕاستەقینەدا بە درێژایی کات دەگۆڕێن، بۆیە وەک لە هێڵکاریی کاتبەندیدا دەکێشرێن. وەک یەک مامەڵەی لەگەڵ دەکرێت: هێڵی کات بکە بە چەند ماوەیەک کە تێیاندا هیچ ناگۆڕێت و بۆ هەر ماوەیەک یەک جار هەڵسەنگێنە.

X=AB+C‾X = AB + \overline{C} over six intervalsX=AB+C‾X = AB + \overline{C} لە شەش ماوەدا
Signalt1t2t3t4t5t6
A110101
B011100
C111001
ABAB010100
C‾\overline{C}000110
X=AB+C‾X = AB+\overline{C}010110
Quick checkپشکنینی خێراIn interval t5 all inputs are 0. Why is X=1X = 1 there?لە ماوەی ⁦t5⁩دا هەموو 0ن. بۆچی X لەوێ 1ـە؟

NAND and NOR: the universal gatesNAND و NOR: گەیتە گشتگیرەکان

Definitionپێناسە

A gate type from which any logic circuit can be built, using only gates of that one type. NAND and NOR are universal gates.

جۆرە کە دەتوانرێت هەر تەنها بەو جۆرە گەیتە دروست بکرێت. NAND و NOR گەیتی گشتگیرن.

Universal means that one kind of gate is enough to build any logic circuit. The reason: every circuit can be written with NOT, AND and OR (as an SOP, for example), so if NAND gates alone can make NOT, AND and OR, they can make anything. The NAND lesson showed the first trick; here is the full set. Each basic gate needs one, two or three NANDs:

گشتگیر واتە یەک جۆر بەسە بۆ دروستکردنی هەر . هۆکارەکەی: هەموو دەتوانرێت بە NOT، AND و OR بنووسرێت (بۆ نموونە وەک SOP)، بۆیە ئەگەر بە تەنها بتوانن NOT، AND و OR دروست بکەن، هەموو شتێک دروست دەکەن. وانەی NAND یەکەم فێڵی نیشان دا؛ ئەمە هەموویەتی. هەر بنەڕەتی پێویستی بە یەک، دوو یان سێ NANDـە:

  • NOT (1 gate): join both inputs: A⋅A‾=A‾\overline{A \cdot A} = \overline{A}.
  • AND (2 gates): a NAND followed by a NAND used as NOT removes the bar: AB‾‾=AB\overline{\overline{AB}} = AB.
  • OR (3 gates): invert A and B first, then NAND them — De Morgan: A‾⋅B‾‾=A+B\overline{\overline{A}\cdot\overline{B}} = A + B. It is the negative-OR form of NAND read backwards.
  • ⁦NOT (1⁩ ): هەردوو پێکەوە ببەستە: A⋅A‾=A‾\overline{A \cdot A} = \overline{A}.
  • ⁦AND (2⁩ ): NANDـێک و دوای ئەو NANDـێک وەک NOT هێڵەکە لادەبات: AB‾‾=AB\overline{\overline{AB}} = AB.
  • ⁦OR (3⁩ ): سەرەتا A و B پێچەوانە بکەرەوە، پاشان NANDـیان بکە — دی مۆرگان: A‾⋅B‾‾=A+B\overline{\overline{A}\cdot\overline{B}} = A + B. ئەمە شێوەی ⁦Negative-OR⁩ـی NANDـە بە پێچەوانەوە خوێندراوەتەوە.
NOT, AND and OR built only from NAND gates. NOT: input A goes to both inputs of one NAND, giving A-bar. AND: a NAND of A and B, then a second NAND with both inputs tied, giving AB. OR: two NANDs with tied inputs make A-bar and B-bar, and a third NAND combines them into A + B.NOT، AND و OR تەنها لە گەیتەکانی NAND دروست کراون. NOT: نێوخستەی A دەچێتە هەردوو نێوخستەی یەک NAND و A-هێڵدار دەدات. AND: NANDـی A و B، پاشان NANDـێکی دووەم کە هەردوو نێوخستەی بەستراون، AB دەدات. OR: دوو NAND بە نێوخستەی بەستراو A-هێڵدار و B-هێڵدار دروست دەکەن و NANDـی سێیەم دەیانکات بە A + B.
Any circuit can be built from NAND gates alone.هەر دەتوانرێت تەنها لە دروست بکرێت.CêIT
Quick checkپشکنینی خێراHow many NAND gates make an OR gate?چەند دروست دەکەن؟

NAND and NOR: the universal gatesNAND و NOR: گەیتە گشتگیرەکان

Trace a NAND-only ORشوێنکەوتنی ORـێکی تەنها-NAND

To trust a NAND-only circuit, trace it. In the OR made of three NANDs, the first two NANDs invert A and B. The last NAND is 0 only when both inverted values are 1 — that is, only when A=B=0A = B = 0, exactly the one row where OR is 0. The NAND lesson animates all four input pairs.

بۆ ئەوەی متمانە بە تەنها-NAND بکەیت، شوێنی بکەوە. لەو ORـەی لە سێ NAND دروست کراوە، دوو NANDـی یەکەم A و B پێچەوانە دەکەنەوە. NANDـی کۆتایی تەنها کاتێک 0ـە کە هەردوو نرخە پێچەوانەکراوەکە 1 بن — واتە تەنها کاتێک A=B=0A = B = 0، ڕێک ئەو یەک ڕیزەی OR تێیدا 0ـە. وانەی NAND هەر چوار جووتە بە ئەنیمەیشن نیشان دەدات.

Three NANDs working as one ORسێ NAND وەک یەک OR کار دەکەن
AABBA‾=A⋅A‾\overline{A} = \overline{A \cdot A}B‾=B⋅B‾\overline{B} = \overline{B \cdot B}X=A‾⋅B‾‾X = \overline{\overline{A}\cdot\overline{B}}A+BA + B
001100
011011
100111
110011
Quick checkپشکنینی خێراIn the NAND-only OR, A=0A = 0 and B=1B = 1. What are the two middle values and X?لە ORـی تەنها-NANDـدا، A=0A = 0 و B=1B = 1. دوو نرخە ناوەڕاستەکە و X چین؟

NAND and NOR: the universal gatesNAND و NOR: گەیتە گشتگیرەکان

Everything from NOR gatesهەموو شتێک لە گەیتەکانی NOR

NOR is universal too, with the roles of AND and OR swapped: NOT needs one NOR, OR needs two (a NOR followed by a NOR used as NOT), and AND needs three (invert both inputs, then NOR them: A‾+B‾‾=AB\overline{\overline{A}+\overline{B}} = AB).

NORـیش گشتگیرە، بەڵام ڕۆڵی AND و OR ئاڵوگۆڕ دەکرێن: NOT پێویستی بە یەک NORـە، OR پێویستی بە دووانە (NORـێک و دوای ئەو NORـێک وەک NOT) و AND پێویستی بە سێیە (هەردوو پێچەوانە بکەرەوە، پاشان NORـیان بکە: A‾+B‾‾=AB\overline{\overline{A}+\overline{B}} = AB).

NOT, OR and AND built only from NOR gates. NOT: one NOR with both inputs tied to A. OR: a NOR of A and B followed by a NOR with tied inputs. AND: two NORs with tied inputs make A-bar and B-bar, and a third NOR gives AB.NOT، OR و AND تەنها لە گەیتەکانی NOR دروست کراون. NOT: یەک NOR کە هەردوو نێوخستەی بە A بەستراون. OR: NORـی A و B و دوای ئەو NORـێک بە نێوخستەی بەستراو. AND: دوو NOR بە نێوخستەی بەستراو A-هێڵدار و B-هێڵدار دروست دەکەن و NORـی سێیەم AB دەدات.
The NOR versions of NOT, OR and AND (1, 2 and 3 gates).وەشانی NORـی NOT، OR و ⁦AND (1⁩، 2 و 3 ).CêIT
Gate counts for the three basic functionsژمارەی بۆ سێ کارە بنەڕەتییەکە
BuildدروستکردنWith NAND gates onlyتەنها بە With NOR gates onlyتەنها بە
NOT1 gate: A⋅A‾\overline{A \cdot A}یەک : A⋅A‾\overline{A \cdot A}1 gate: A+A‾\overline{A + A}یەک : A+A‾\overline{A + A}
AND2 gates: AB‾‾\overline{\overline{AB}}دوو : AB‾‾\overline{\overline{AB}}3 gates: A‾+B‾‾\overline{\overline{A}+\overline{B}}سێ : A‾+B‾‾\overline{\overline{A}+\overline{B}}
OR3 gates: A‾⋅B‾‾\overline{\overline{A}\cdot\overline{B}}سێ : A‾⋅B‾‾\overline{\overline{A}\cdot\overline{B}}2 gates: A+B‾‾\overline{\overline{A+B}}دوو : A+B‾‾\overline{\overline{A+B}}
Quick checkپشکنینی خێراWith NOR gates only, how many gates make an AND?تەنها بە ، چەند ANDـێک دروست دەکەن؟

NOR Gate as Universal GateALL ABOUT ELECTRONICS · Englishئینگلیزی · 82K viewsبینین · 1.3K likesلایک · Partبەشی 0:00–2:52 (ofلە 9:52)

Shows how NOR gates alone make NOT, OR and AND gates, checking each one with its truth table.

پیشان دەدات چۆن تەنها بە NOT، OR و AND دروست دەکرێن، هەر یەکەیان بە دەپشکنرێت.

Plays 0:00–2:52: NOT, OR and AND built from NOR gates only.

لە ⁦0:00⁩ تا ⁦2:52⁩ پەخش دەبێت: NOT، OR و AND تەنها لە دروست دەکرێن.

NAND and NOR: the universal gatesNAND و NOR: گەیتە گشتگیرەکان

Why one gate type is so usefulبۆچی یەک جۆر گەیت ئەوەندە بەسوودە

A factory can make one kind of gate very well and very cheaply, and a designer can build anything from a box of identical chips — the 74HC00, for example, holds four NAND gates (see real chips). The price is a few more gates: an OR costs three NANDs instead of one OR. In today's CMOS chips NAND is usually preferred to NOR (why).

کارگەیەک دەتوانێت یەک جۆر زۆر باش و هەرزان دروست بکات و دیزاینەرێک دەتوانێت هەموو شتێک لە سندووقێک وەک یەک دروست بکات — بۆ نموونە ⁦74HC00⁩ چوار لەخۆ دەگرێت (بڕوانە چیپە ڕاستەقینەکان). نرخەکەی چەند زیاترە: ORـێک سێ NANDـی دەوێت لە جیاتی یەک OR. لە CMOSـی ئەمڕۆدا زۆرجار NAND لە NOR باشتر دادەنرێت (بۆچی).

The idea is old. Charles S. Peirce found around 1880 that NAND alone, or NOR alone, can express all of logic, but he never published it; Henry M. Sheffer published the result in 1913, and NAND is still called the Sheffer stroke. A famous machine took the NOR road: the Apollo Guidance Computer that flew astronauts to the Moon built its logic from about 2,800 chips, almost all of them holding two 3-input NOR gates.

بیرۆکەکە کۆنە. ⁦Charles S. Peirce⁩ نزیکەی ساڵی ⁦1880⁩ دۆزییەوە کە تەنها NAND، یان تەنها NOR، دەتوانێت هەموو لۆجیک دەرببڕێت، بەڵام هەرگیز بڵاوی نەکردەوە؛ ⁦Henry M. Sheffer⁩ لە ساڵی ⁦1913⁩دا ئەنجامەکەی بڵاو کردەوە و تا ئێستاش بە NAND دەوترێت ⁦Sheffer stroke⁩. ئامێرێکی بەناوبانگ ڕێگای NORـی گرتەبەر: ڕێنمایی Apollo کە ئاسمانەوانەکانی برد بۆ مانگ، لۆجیکەکەی لە نزیکەی ⁦2,800⁩ دروست کرابوو و نزیکەی هەموویان دوو سێ لەخۆ دەگرت.

Quick checkپشکنینی خێراWhat is the main advantage of building a circuit from NAND gates only?سوودی سەرەکیی دروستکردنی تەنها بە چییە؟

NAND and NOR: the universal gatesNAND و NOR: گەیتە گشتگیرەکان

SOP circuits as NAND–NANDکۆی لێکدانەکان وەک ⁦NAND–NAND⁩

Universality is used every day for SOP circuits: in an AND-OR circuit you can replace every gate by a NAND and the function does not change — the bubbles cancel in pairs. The step-by-step proof with De Morgan is in The same circuit from NAND gates only; the POS twin, an OR-AND circuit built as NOR–NOR, is in NOR–NOR. Chip makers also sell AND-OR-Invert (AOI) gates: an AND-OR circuit with a NOT at the end, in one package.

گشتگیری هەموو ڕۆژێک بۆ SOP بەکار دێت: لە ⁦AND-OR⁩ـدا دەتوانیت هەموو بە NAND بگۆڕیت و ناگۆڕێت — دوو بە دوو یەکتر لادەبەن. سەلماندنی هەنگاو بە هەنگاو بە دی مۆرگان لە هەمان سووڕی لۆجیکی تەنها بە گەیتەکانی NANDـدایە؛ جووتەکەی POS، واتە ⁦OR-AND⁩ کە وەک ⁦NOR–NOR⁩ دروست دەکرێت، لە ⁦NOR–NOR⁩ـدایە. دروستکەرانی هەروەها ⁦AND-OR-Invert (AOI)⁩ دەفرۆشن: ⁦AND-OR⁩ بە NOTـێک لە کۆتاییدا، لە یەک پاکێجدا.

Quick checkپشکنینی خێراAn AND-OR circuit has 3 AND gates and 1 OR gate. What do you get if you replace all four by NAND gates?لە ⁦AND-OR⁩ـدا سێ و یەک هەیە. ئەگەر هەر چوارەکە بە NAND بگۆڕیت چی دەبێت؟

Common mistakesهەڵە باوەکان

MistakeهەڵەFixچارەسەر
Treating AB‾\overline{AB} as A‾ B‾\overline{A}\,\overline{B} (two NOTs into an AND).وا دانانی AB‾\overline{AB} وەک A‾ B‾\overline{A}\,\overline{B} (دوو NOT بۆ ناو AND).One long bar is a NAND. AB‾=A‾+B‾\overline{AB} = \overline{A}+\overline{B}, not A‾ B‾\overline{A}\,\overline{B}.یەک هێڵی درێژ NANDـە. AB‾=A‾+B‾\overline{AB} = \overline{A}+\overline{B}، نەک A‾ B‾\overline{A}\,\overline{B}.
Starting to draw from the inputs and getting lost.دەستپێکردنی کێشان لە و ونبوون.Find the last step first; it is the output gate. Then work inward.سەرەتا کۆتا هەنگاو بدۆزەوە؛ ئەوە . پاشان بەرەو ناوەوە بڕۆ.
Making AND from a single NAND.دروستکردنی AND لە یەک NAND.One NAND gives AB‾\overline{AB}. You need a second NAND, with joined inputs, as a NOT: AB‾‾=AB\overline{\overline{AB}} = AB.یەک NAND AB‾\overline{AB} دەدات. پێویستت بە NANDـێکی دووەمە، بە بەستراو بە یەکەوە، کە وەک NOT کار بکات: AB‾‾=AB\overline{\overline{AB}} = AB.
Evaluating gates in a random order.هەڵسەنگاندنی بە ڕیزبەندییەکی هەڕەمەکی.Go left to right: a gate can be evaluated only when all its inputs are known.لە چەپەوە بۆ ڕاست بڕۆ: تەنها کاتێک هەڵدەسەنگێنرێت کە هەموو زانراو بن.
Joining two crossing wires without a dot (or adding a dot where wires only cross).بەستنی دوو وایەری یەکتربڕ بەبێ خاڵ (یان دانانی خاڵ لە شوێنێک کە وایەرەکان تەنها یەکتر دەبڕن).A dot means connected; a plain crossing means not connected.خاڵ واتە پەیوەست؛ یەکتربڕینی ساکار واتە نەپەیوەست.
Thinking an XNOR output of 0 means the circuit is always 0.وا بیرکردنەوە کە 0ـی XNOR واتە هەمیشە 0ـە.Two cases prove nothing about the others; build the whole truth table.دوو حاڵەت هیچ شتێک دەربارەی ئەوانی تر ناسەلمێنن؛ هەموو دروست بکە.

Exercisesڕاهێنانەکان

ExerciseڕاهێنانDraw itبیکێشە

Draw the circuit of X=(A+B)C‾X = (A + B)\overline{C} and give its truth table.

X=(A+B)C‾X = (A + B)\overline{C} بکێشە و بدە.

Show answerوەڵامەکە پیشان بدە

An OR gate makes A+BA + B, a NOT gate makes C‾\overline{C}, and an AND gate (the output gate) multiplies them. X=1X = 1 only for ABC=010ABC = 010, 100 and 110: X=∑m(2,4,6)X = \sum m(2, 4, 6).

A+BA + B دروست دەکات، C‾\overline{C} و ( ) لێکیان دەدات. X تەنها بۆ ABC=010ABC = 010، ⁦100⁩ و ⁦110⁩ یەکسانە بە 1: X=∑m(2,4,6)X = \sum m(2, 4, 6).

ExerciseڕاهێنانRead itبیخوێنەوە

A circuit has a NOR gate with inputs A and B, and an AND gate with inputs A and C. Both outputs go into an OR gate whose output is X. Write X, find where X=1X = 1, and simplify.

لە هەیە بە A و B. هەروەها هەیە بە A و C. هەردوو دەچنە ناو کە Xـە. X بنووسە، بدۆزەوە X لە کوێ 1ـە و کورتی بکەرەوە.

Show answerوەڵامەکە پیشان بدە
X=A+B‾+AC=A‾ B‾+ACX = \overline{A+B} + AC = \overline{A}\,\overline{B} + AC

X=1X = 1 for ABC=000ABC = 000, 001, 101 and 111: ∑m(0,1,5,7)\sum m(0, 1, 5, 7). A‾ B‾+AC\overline{A}\,\overline{B} + AC is already as short as it gets.

X بۆ ABC=000ABC = 000، ⁦001⁩، ⁦101⁩ و ⁦111⁩ یەکسانە بە 1: ∑m(0,1,5,7)\sum m(0, 1, 5, 7). A‾ B‾+AC\overline{A}\,\overline{B} + AC پێشتر کورتترین شێوەیە.

ExerciseڕاهێنانThe whole lab-exam truth tableهەموو خشتەی ڕاستیی تاقیکردنەوەی تاقیگە

Complete the 16-row truth table of the lab-exam circuit X=[(AB‾+C)D]⊕[(CD‾+B)‾+A]‾X = \overline{[(\overline{AB}+C)D] \oplus [\overline{(C\overline{D}+B)}+A]}.

⁦16⁩ ڕیزیی تاقیکردنەوەی تاقیگە تەواو بکە: X=[(AB‾+C)D]⊕[(CD‾+B)‾+A]‾X = \overline{[(\overline{AB}+C)D] \oplus [\overline{(C\overline{D}+B)}+A]}.

Hintئاماژە

For each row find the left branch and the right branch; X=1X = 1 when they are equal.

بۆ هەر ڕیزێک لقی چەپ و لقی ڕاست بدۆزەوە؛ X=1X = 1 کاتێک یەکسان بن.

Show answerوەڵامەکە پیشان بدە
ABCDABCDXX
00000
00011
00101
00111
01001
01010
01101
01110
10000
10011
10100
10111
11000
11010
11100
11111

X=1X = 1 for 0001, 0010, 0011, 0100, 0110, 1001, 1011 and 1111: X=∑m(1,2,3,4,6,9,11,15)X = \sum m(1, 2, 3, 4, 6, 9, 11, 15). The Karnaugh-map lesson simplifies it to four short terms.

X بۆ ⁦0001⁩، ⁦0010⁩، ⁦0011⁩، ⁦0100⁩، ⁦0110⁩، ⁦1001⁩، ⁦1011⁩ و ⁦1111⁩ یەکسانە بە 1: X=∑m(1,2,3,4,6,9,11,15)X = \sum m(1, 2, 3, 4, 6, 9, 11, 15). وانەی نەخشەی کارنۆ کورتی دەکاتەوە بۆ چوار بڕی کورت.

ExerciseڕاهێنانMajority voteدەنگی زۆرینە

Three judges A, B and C press a button for "yes". A lamp X lights when at least two say yes. A designer writes X=AB+C(A+B)X = AB + C(A + B). (a) Draw the circuit. (b) Write its truth table. (c) Show that it equals AB+BC+ACAB + BC + AC. (d) Where in this course have you met the same function?

سێ دادوەر A، B و C بۆ «بەڵێ» دوگمەیەک دادەگرن. گڵۆپێکی X کاتێک هەڵدەبێت کە لانیکەم دوو کەسیان بڵێن بەڵێ. دیزاینەرێک دەنووسێت X=AB+C(A+B)X = AB + C(A + B). (أ) بکێشە. (ب) بنووسە. (ج) نیشانی بدە کە یەکسانە بە AB+BC+ACAB + BC + AC. (د) ئەم پێشتر لە کوێی ئەم کۆرسەدا هاتووە؟

Hintئاماژە

Work out the last step first: it is the + between ABAB and C(A+B)C(A + B).

سەرەتا کۆتا هەنگاو بدۆزەوە: +ـی نێوان ABAB و C(A+B)C(A + B)ـە.

Show answerوەڵامەکە پیشان بدە

(a) An AND makes ABAB; an OR makes A+BA + B; a second AND multiplies that by C; an OR joins ABAB and C(A+B)C(A + B) into X — four gates.

(أ) ANDـێک ABAB دروست دەکات؛ ORـێک A+BA + B؛ ANDـێکی دووەم ئەوە لە C دەدات؛ ORـێک ABAB و C(A+B)C(A + B) پێکەوە دەکات بە X — چوار .

ABCABC000001010011100101110111
XX00010111

(b) X=1X = 1 exactly in the rows with two or three 1s; row 100 is 0 because only one judge says yes. (c) C(A+B)=AC+BCC(A + B) = AC + BC, so X=AB+AC+BCX = AB + AC + BC. (d) It is the carry out of the full adder: Cout=AB+ACin+BCinC_{out} = AB + AC_{in} + BC_{in} is 1 when at least two of its three inputs are 1.

(ب) X=1X = 1 ڕێک لەو ڕیزانەدا کە دوو یان سێ 1ـیان تێدایە؛ ڕیزی ⁦100⁩ یەکسانە بە 0 چونکە تەنها یەک دادوەر دەڵێت بەڵێ. (ج) C(A+B)=AC+BCC(A + B) = AC + BC، بۆیە X=AB+AC+BCX = AB + AC + BC. (د) ئەمە دەرچووی کۆکەرەوەی تەواوـە: Cout=AB+ACin+BCinC_{out} = AB + AC_{in} + BC_{in} کاتێک 1ـە کە لانیکەم دوو لە سێ 1 بن.

Exercisesڕاهێنانەکان

Exercises: universal gatesڕاهێنان: گەیتە گشتگیرەکان

ExerciseڕاهێنانBasic gates from NOR onlyگەیتە بنەڕەتییەکان تەنها لە NOR

Using NOR gates only, describe how to build NOT, OR and AND. Check your OR circuit for A=1A = 1, B=0B = 0.

تەنها بە ، ڕوونی بکەرەوە چۆن NOT، OR و AND دروست دەکەیت. ORـەکەت بۆ A=1A = 1 و B=0B = 0 بپشکنە.

Show answerوەڵامەکە پیشان بدە
  • NOT: one NOR with both inputs joined: A+A‾=A‾\overline{A+A} = \overline{A}.
  • OR: a NOR, then a second NOR used as NOT: A+B‾‾=A+B\overline{\overline{A+B}} = A+B.
  • AND: invert A and B with two NORs, then NOR them: A‾+B‾‾=AB\overline{\overline{A}+\overline{B}} = AB.
  • NOT: یەک NOR بە هەردوو بەستراو بە یەکەوە: A+A‾=A‾\overline{A+A} = \overline{A}.
  • ⁦OR: NOR⁩ـێک، پاشان NORـێکی دووەم وەک NOT: A+B‾‾=A+B\overline{\overline{A+B}} = A+B.
  • ⁦AND: A⁩ و B بە دوو NOR پێچەوانە بکەرەوە، پاشان NORـیان بکە: A‾+B‾‾=AB\overline{\overline{A}+\overline{B}} = AB.

Check: the first NOR gives 1+0‾=0\overline{1+0} = 0, the second gives 0+0‾=1\overline{0+0} = 1, and indeed 1+0=11 + 0 = 1.

پشکنین: NORـی یەکەم 1+0‾=0\overline{1+0} = 0 دەدات، NORـی دووەم 0+0‾=1\overline{0+0} = 1 دەدات و بەڕاستی 1+0=11 + 0 = 1.

ExerciseڕاهێنانA 3-input OR from NANDsORـی سێ نێوخستە لە NAND

How many NAND gates do you need for X=A+B+CX = A + B + C if you may use one 3-input NAND? Explain why it works.

ئەگەر بتوانیت یەک NANDـی سێ بەکاربهێنیت، چەند پێویستە بۆ X=A+B+CX = A + B + C؟ ڕوونی بکەرەوە بۆچی کار دەکات.

Show answerوەڵامەکە پیشان بدە

Four: three NANDs with joined inputs make A‾\overline{A}, B‾\overline{B} and C‾\overline{C}; one 3-input NAND then gives A‾ B‾ C‾‾\overline{\overline{A}\,\overline{B}\,\overline{C}}. This is 0 only when all three inverted values are 1, that is only when A=B=C=0A = B = C = 0 — exactly the OR table. (It is the 3-input negative-OR of the homework, read backwards.)

چوار: سێ NAND بە بەستراو بە یەکەوە A‾\overline{A}، B‾\overline{B} و C‾\overline{C} دروست دەکەن؛ پاشان یەک NANDـی سێ A‾ B‾ C‾‾\overline{\overline{A}\,\overline{B}\,\overline{C}} دەدات. ئەمە تەنها کاتێک 0ـە کە هەر سێ نرخە پێچەوانەکراوەکە 1 بن، واتە تەنها کاتێک A=B=C=0A = B = C = 0 — ڕێک OR. (ئەمە هەمان ⁦Negative-OR⁩ـی سێ لە ئەرکەکەدا، بە پێچەوانەوە خوێندراوەتەوە.)

ExerciseڕاهێنانNOR from NANDsNOR لە NAND

Using NAND gates only, build a NOR gate. How many gates do you need?

تەنها بە دروست بکە. پێویستت بە چەند دەبێت؟

Show answerوەڵامەکە پیشان بدە

Four: build an OR from three NANDs (A‾⋅B‾‾=A+B\overline{\overline{A}\cdot\overline{B}} = A + B), then add a fourth NAND with tied inputs as a NOT: A+B‾\overline{A + B}.

چوار: ORـێک لە سێ NAND دروست بکە (A‾⋅B‾‾=A+B\overline{\overline{A}\cdot\overline{B}} = A + B)، پاشان NANDـی چوارەم بە بەستراو وەک NOT زیاد بکە: A+B‾\overline{A + B}.

ExerciseڕاهێنانXOR from four NANDsXOR لە چوار NAND

A circuit has four NAND gates: N1=AB‾N_1 = \overline{AB}, N2=AN1‾N_2 = \overline{A N_1}, N3=BN1‾N_3 = \overline{B N_1} and X=N2N3‾X = \overline{N_2 N_3}. Build its truth table. Which gate is it?

لە چوار پێکهاتووە: N1=AB‾N_1 = \overline{AB}، N2=AN1‾N_2 = \overline{A N_1}، N3=BN1‾N_3 = \overline{B N_1} و X=N2N3‾X = \overline{N_2 N_3}. دروست بکە. کام ؟

Show answerوەڵامەکە پیشان بدە
ABABN1N_1N2N_2N3N_3XX
001110
011101
101011
110110

X is 1 when A and B differ: it is an XOR gate built from four NANDs.

X کاتێک 1ـە کە A و B جیاواز بن: ئەمە ـە کە لە چوار NAND دروست کراوە.

Summaryپوختە

  • Implementation: start from the last step (the output gate) and work inward; a bar over one letter is a NOT or an input bubble, a bar over a group gives a NAND or NOR.
  • Analysis: name every gate output left to right, write its expression, then build the truth table — AB‾+A‾BA\overline{B}+\overline{A}B turned out to be XOR.
  • Evaluation: put the input values in and go gate by gate from left to right. Waveform inputs: one evaluation per interval.
  • Simplifying first can shrink a circuit: the exam's 5-gate circuit needs only an OR and a NAND.
  • NAND and NOR are universal: NOT, AND and OR need 1, 2 or 3 of them (NOR swaps AND and OR), and any AND-OR circuit can become NAND-NAND.
  • جێبەجێکردن: لە کۆتا هەنگاوەوە دەست پێ بکە ( ) و بەرەو ناوەوە بڕۆ؛ هێڵ لەسەر یەک پیت NOT یان ، هێڵ لەسەر کۆمەڵێک NAND یان NOR دەدات.
  • شیکردنەوە: هەموو لە چەپەوە بۆ ڕاست ناو بنێ، بنووسە، پاشان دروست بکە — AB‾+A‾BA\overline{B}+\overline{A}B دەرکەوت XORـە.
  • هەڵسەنگاندن: نرخی دابنێ و بە لە چەپەوە بۆ ڕاست بڕۆ. : بۆ هەر ماوەیەک یەک هەڵسەنگاندن.
  • کورتکردنەوە پێشتر دەتوانێت بچووک بکاتەوە: ئەو تاقیکردنەوەکە کە پێنج هەبوو تەنها پێویستی بە OR و NANDـێکە.
  • NAND و NOR گشتگیرن: NOT، AND و OR پێویستیان بە 1، 2 یان 3 دانەیانە (لە NORـدا AND و OR شوێن دەگۆڕنەوە) و هەر ⁦AND-OR⁩ دەتوانێت ببێت بە ⁦NAND-NAND⁩.
Review questionsپرسیارەکانی پێداچوونەوە
Which gate does a long bar over a whole product, like AB‾\overline{AB}, give?هێڵێکی درێژ لەسەر لێکدانێکی تەواو، وەک AB‾\overline{AB}، کام گەیت دەدات؟

A NAND gate.

.

Why are NAND and NOR called universal?بۆچی بە NAND و NOR دەوترێت گشتگیر؟

Because NOT, AND and OR — and so every circuit — can be built from either one alone.

چونکە NOT، AND و OR — و کەواتە هەموو — دەتوانرێن تەنها لە یەکێکیان دروست بکرێن.

A circuit gives 0 for two input combinations. Is it always 0?سووڕێک بۆ دوو تێکەڵەی نێوخستە 0 دەدات. ئایا هەمیشە 0ـە؟

Not necessarily — only the full truth table tells. The lab-exam circuit is 1 for 8 of its 16 rows.

نا بە پێویستی — تەنها تەواو دەیڵێت. تاقیکردنەوەی تاقیگە لە 8 ڕیز لە ⁦16⁩ ڕیزدا 1ـە.

Videoڤیدیۆ

Watch a videoسەیری ڤیدیۆیەک بکە

A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.

گۆڕینی هاوکێشەکان بۆ لۆجیک گەیتەکان یان بە پێچەوانەوەMahamad Abas · Kurdish (Sorani)کوردی (سۆرانی) · 9.5K viewsبینین · 376 likesلایک

In Sorani: how to turn a Boolean expression into a circuit of logic gates, and how to read the expression back from a circuit.

بە سۆرانی: چۆن دەکەیتە لە ، هەروەها چۆن لە دەخوێنیتەوە.

In Sorani: from an expression to a gate circuit and back.

بە سۆرانی: لە بۆ و بە پێچەوانەوە.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Karnaugh Mapsنەخشەکانی کارنۆ

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.