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.
Expression
Operators
Gates
Rows in the truth table
(A AND B) OR (NOT C)
AND, OR, NOT
3
8
NOT (A OR B)
OR, NOT
2
4
Worked examples
Gate
Type
Takes
Gives
Gate 1
AND
A and B
P
Gate 2
NOT
C
Q
Gate 3
OR
P and Q
X
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.
A
B
C
P = A AND B
Q = NOT C
X = P OR Q
0
0
0
0
1
1
0
0
1
0
0
0
0
1
0
0
1
1
0
1
1
0
0
0
1
0
0
0
1
1
1
0
1
0
0
0
1
1
0
1
1
1
1
1
1
1
0
1
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.
Situation
A dry soil
B raining
C button
X valve opens
dry, no rain, no button
1
0
0
1
dry, raining, no button
1
1
0
0
wet, no rain, no button
0
0
0
0
wet, raining, button pressed
0
1
1
1
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).
Gate
Type
Takes
Gives
Gate 1
NOT
?
P
Gate 2
?
B
Q
Gate 3
AND
?
X
Gate 1 is NOT and takes A; it gives P. Gate 2 is NOT and takes B; it gives Q. Gate 3 is AND and takes P and Q; it gives X.
2
Complete the truth table for X = (NOT A) AND (NOT B).
A
B
P = NOT A
Q = NOT B
X = P AND Q
0
0
?
?
?
0
1
?
?
?
1
0
?
?
?
1
1
?
?
?
P: 1, 1, 0, 0. Q: 1, 0, 1, 0. X: 1, 0, 0, 0. X is 1 only when both A and B are 0.
3
This wiring list was made for X = (NOT A) OR (B AND C), but it has one mistake. Find it and correct it.
Gate
Type
Takes
Gives
Gate 1
NOT
A
P
Gate 2
AND
B and C
Q
Gate 3
OR
P and B
X
Gate 3 takes P and B, but it should take P and Q. B is an input of Gate 2, and Q, the output of the AND gate, is never used. The correct row is: Gate 3, OR, takes P and Q, gives X.
4
Write the Boolean expression for this circuit.
Gate
Type
Takes
Gives
Gate 1
NOT
B
P
Gate 2
OR
A and C
Q
Gate 3
AND
Q and P
X
(A OR C) AND (NOT B). Gate 2 gives Q = A OR C, Gate 1 gives P = NOT B, and Gate 3 combines Q and P.