Mathorio
Answer key
Logic Gates
Show your work for each problem.
- 1.Which gate gives output 1 only when both inputs are 1?
- a)OR
- b)XOR
- c)NOR
- d)AND
Answer: AND
AND gives 1 only for the inputs 1, 1. OR and XOR already give 1 when just one input is 1, and NOR gives 1 only for 0, 0.
- 2.An OR gate has the inputs and . What is the output? (Write 1 or 0.)
Answer: 1
, because input is 1.
- 3.A NOR gate has the inputs and . What is the output? (Write 1 or 0.)
Answer: 1
, and NOT flips it: . NOR gives 1 only when both inputs are 0.
- 4.For the inputs , , , a gate gives the outputs . Which gate is it?
- a)XOR
- b)NAND
- c)AND
- d)OR
Answer: XOR
The output is 1 exactly when the inputs are different, which is XOR. OR would give 1 in the last row as well.
- 5.The inputs are and . Find the output of an AND, an OR and an XOR gate.
Answer: 1, 1, 0
- What is the output of the AND gate? 1
- What is the output of the OR gate? 1
- What is the output of the XOR gate? 0
- 6.goes through a NOT gate, and its output and go into an OR gate: . Find for , .
Answer: 0
- What is the output of the NOT gate, ? 0
- What is with ? 0
- 7.and go into an OR gate, and its output goes through a NOT gate. Which expression describes the circuit?
- a)
- b)
- c)
- d)
Answer:
First OR: . Then NOT on that output: , which is the NOR gate .
- 8.In how many of the 4 input rows does a NAND gate give the output 1?
Answer: 3
AND is 1 only in the row . NAND flips every row, so it is 1 in the other rows.
- 9.and go into an AND gate. and go into an OR gate. Both outputs go into an XOR gate, which gives . Find for , , .
Answer: 1
- What is the output of the AND gate, ? 0
- What is the output of the OR gate, ? 1
- What is ? 1
- 10.A circuit computes . Find for , , .
Answer: 0
- What is ? 0
- What is ? 0
- What is , the OR of the two results? 0
- 11.In gate notation ( = AND, = OR, bar = NOT), find for , , .
Answer: 0
, the bar flips it to , and (OR). So .
- 12.Which inputs make a NOR gate give the output 1?
- a)A = 1, B = 1
- b)A = 1, B = 0
- c)A = 0, B = 0
- d)A = 0, B = 1
Answer: A = 0, B = 0
OR is 0 only for , , so NOR is 1 only for those inputs.
- 13.A half adder gets and . It outputs the sum digit and the carry digit . Find , and the value of the binary number .
Answer: 1
- What is ? 1
- What is ? 0
- The result is in binary. Which ordinary number is that? 1
- 14.A circuit computes . In how many of the 8 input combinations is ?
Answer: 2
- For how many of the 4 pairs is ? 2
- For how many values of is ? 1
- How many of the 8 combinations give Y = 1? 2
- 15.Both inputs of a NAND gate are connected to the same signal . Find the output for and for , and decide how many NAND gates you need to build one AND gate.
Answer: 2
- What is the output for , that is ? 1
- What is the output for , that is ? 0
- AND is a NAND followed by a NOT. How many NAND gates is that? 2
- 16.Which circuit gives the same output as an XOR gate for all inputs?
- a)
- b)
- c)
- d)
Answer:
gives for , the XOR column. The second option gives , the third is NOR and the fourth is just AND.
- 17.Three judges press a button (1) or not (0). A light shows . Find for , , , then count the input combinations with .
Answer: 4
- What is ? 0
- What is ? 1
- What is ? 0
- What is ? 1
- In how many of the 8 combinations is Y = 1? 4
- 18.A circuit computes (bar = NOT, = OR, = AND). In how many of the 4 input rows is ?
Answer: 2
Row : . Rows and : . Row : . So in 2 rows: exactly when the inputs are equal, the opposite of XOR.