AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Gates joined together

Week 28 · 4.5 Logic circuits · 3 lessons
3

Three gates, two brackets

Computing 9: Topic 4.5, pp. 341–347
GoalDraw and check circuits that need three gates, including expressions with two brackets, and use a truth table to test a design.
New words
two-bracket expression · an expression with two bracketed parts, each drawn first and then joined by the gate that is outside both bracketstruth table · a table that lists every combination of inputs and the output for each onecombination · one set of values for all the inputs, such as A = 1, B = 0, C = 1
Explanation

Some expressions need three gates. If the expression has one bracket and a NOT in front of a letter, draw the bracket, draw the NOT gate, and join them with the last gate. If it has two brackets, such as (A AND B) OR (NOT C), draw both bracketed parts first, as two separate gates. The gate outside the brackets then takes the two middle outputs, so it needs no new letter. The number of gates equals the number of operators, which gives a quick check for a drawing. To test a design, make a truth table with a column for each middle output and work from left to right. A circuit with three inputs has eight rows, because 2 × 2 × 2 = 8.

ExpressionOperatorsGatesRows in the truth table
(A AND B) OR (NOT C)AND, OR, NOT38
NOT (A OR B)OR, NOT24
Worked examples
GateTypeTakesGives
Gate 1ANDA and BP
Gate 2NOTCQ
Gate 3ORP and QX
Two brackets: X = (A AND B) OR (NOT C). The AND gate and the NOT gate are drawn first. The OR gate is outside both brackets and takes their outputs P and Q.
ABCP = A AND BQ = NOT CX = P OR Q
000011
001000
010011
011000
100011
101000
110111
111101
The truth table for the same circuit has eight rows. X is 0 only when P is 0 and Q is 0, which happens in the three rows where C is 1 and A and B are not both 1.
SituationA dry soilB rainingC buttonX valve opens
dry, no rain, no button1001
dry, raining, no button1100
wet, no rain, no button0000
wet, raining, button pressed0111
A real job for a circuit. An irrigation valve opens when the manual button is pressed (C), or when the soil is dry (A) and it is not raining (B). The rule is X = C OR (A AND (NOT B)). The NOT gate comes first, then the AND gate, then the OR gate. Four situations are checked below.
Class activity

Design a rule (no computer). Work in pairs. Each of you invents a rule with three inputs for a machine in a school, such as a library door or a water fountain. Write it in words, for example “the light comes on when …”. Decide what A, B and C mean. Turn the rule into a Boolean expression that has exactly three gates, and write the wiring list on paper. Swap with your partner. Your partner draws your circuit, counts the gates, and tests two rows of inputs to see whether the machine does what the words say. Talk about any row where it does not.

Practice
1
Complete the wiring list for X = (NOT A) AND (NOT B).
GateTypeTakesGives
Gate 1NOT?P
Gate 2?BQ
Gate 3AND?X
2
Complete the truth table for X = (NOT A) AND (NOT B).
ABP = NOT AQ = NOT BX = P AND Q
00???
01???
10???
11???
3
This wiring list was made for X = (NOT A) OR (B AND C), but it has one mistake. Find it and correct it.
GateTypeTakesGives
Gate 1NOTAP
Gate 2ANDB and CQ
Gate 3ORP and BX
4
Write the Boolean expression for this circuit.
GateTypeTakesGives
Gate 1NOTBP
Gate 2ORA and CQ
Gate 3ANDQ and PX