Writing a logic expression from a logic circuit: several gates

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Writing a logic expression from a logic circuit: several gates

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A circuit has an AND gate (inputs A and B) whose output goes into an OR gate with input C. Which expression is correct?
A X = (A AND B) OR C
B X = A AND (B OR C)
2. When writing an expression for a multi-gate circuit, which gate's operator is the outermost one?
A The final gate, the one that gives output X
B The first gate on the left, next to the inputs
3. In which order do you build up the expression for a circuit?
A Right to left, starting with the gate that gives X
B Left to right, starting with the gates next to the inputs
4. A NOR gate (inputs A and B) feeds one input of an AND gate. The other AND input is C. Which expression is correct?
A X = (A AND B) NOR C
B X = (A NOR B) AND C
5. An OR gate (inputs A and B) feeds an AND gate along with input C. What is the correct expression?
A X = (A OR B) AND C
B X = A OR B AND C

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1X = (A AND B) OR C AThe brackets are missing, so it is unclear which gate comes first. An AND gate feeding an OR gate with C should be written X = (A AND B) OR C.
2X = (A OR B) AND (B NOT C) BAn AND gate takes A and B. Its output goes into an OR gate with C. The OR gate is the final gate that gives X.
3Each earlier gate's expression goes in brackets as an input to the next gate CX = (A OR B) AND C
4The final gate in the circuit is the outermost operator in the expression DNot valid
5X = A AND B OR C Eplaceholder
6X = (A AND B) OR (C NOR A) FX = NOT (A AND B) OR C

Definitions

X = (A AND B) OR C

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
X = (A AND B) __ C
2.
P = A AND B X = _ OR C
3.
X = (A OR B) AND ___ C
4.
X = (A AND B) OR (B AND _)
5.
P = A OR B Q = NOT C X = P ___ Q

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A AND(A,B) then OR with C
B P = A OR B
C X = P OR C
D X = (A AND B) OR C
Question 2
A P = A AND B
B Q = NOT C
C X = P AND Q
D X = (A OR B) AND (NOT C)
Question 3
A G1 = A AND B
B G2 = G1 OR C
C X = A AND B OR C
Question 4
A P = NOT B
B Q = P AND B
C X = (NOT A) AND B
D X = Q
Question 5
A Gate 1: B AND C gives P
B Gate 2: A OR P gives X
C X = (A OR B) AND C

Answer Key

Writing a logic expression from a logic circuit: several gates
Section A: Quick Questions
Q1
A — X = (A AND B) OR C
Q2
A — The final gate, the one that gives output X
Q3
B — Left to right, starting with the gates next to the inputs
Q4
B — X = (A NOR B) AND C
Q5
A — X = (A OR B) AND C
Section B: Match the Pairs
Q1
X = (A AND B) OR C → An AND gate takes A and B. Its output goes into an OR gate with C. The OR gate is the final gate that gives X.
Q2
X = (A OR B) AND (B NOT C) → Not valid
Q3
Each earlier gate's expression goes in brackets as an input to the next gate → X = (A OR B) AND C
Q4
The final gate in the circuit is the outermost operator in the expression → X = NOT (A AND B) OR C
Q5
X = A AND B OR C → The brackets are missing, so it is unclear which gate comes first. An AND gate feeding an OR gate with C should be written X = (A AND B) OR C.
Q6
X = (A AND B) OR (C NOR A) → placeholder
Section C: Definitions
Q1
X = (A AND B) OR C — Write each gate's expression from left to right, putting each earlier gate in brackets as an input to the next gate. The final gate is the outermost operator.
Section D: Fill in the Blanks
Q1
X = (A AND B) OR C
Q2
P = A AND B X = P OR C
Q3
X = (A OR B) AND NOT C
Q4
X = (A AND B) OR (B AND C)
Q5
P = A OR B Q = NOT C X = P AND Q
Section E: Spot the Error
Q1
B — The first gate is an AND gate, so P = A AND B. Writing OR here makes the final expression (A AND B) OR C impossible.
Q2
A — The final expression uses (A OR B), so the first gate must be P = A OR B, not AND.
Q3
C — The first gate's expression must go in brackets as an input to the next gate. It should be X = (A AND B) OR C.
Q4
A — The NOT gate is on input A, so P = NOT A. The final expression (NOT A) AND B shows this.
Q5
C — The AND gate (B AND C) is the earlier gate, so it goes in brackets as an input to the final OR gate. It should be X = A OR (B AND C).