Computer Science: Logic Gates
Building and analyzing Boolean logic circuits
Computer Science: Logic Gates
Building and analyzing Boolean logic circuits
Computer Science - Grade 9-12
- 1
Complete the truth table for an AND gate with inputs A and B. List the output for A,B values 00, 01, 10, and 11.
The word AND means both conditions must be true.
The AND gate outputs 0 for 00, 0 for 01, 0 for 10, and 1 for 11. An AND gate only outputs 1 when both inputs are 1. - 2
Complete the truth table for an OR gate with inputs A and B. List the output for A,B values 00, 01, 10, and 11.
The OR gate outputs 0 for 00, 1 for 01, 1 for 10, and 1 for 11. An OR gate outputs 1 when at least one input is 1. - 3
Complete the truth table for a NOT gate with input A. List the output for A values 0 and 1.
A NOT gate is also called an inverter.
The NOT gate outputs 1 when A is 0 and outputs 0 when A is 1. A NOT gate reverses the input. - 4
A circuit has inputs A = 1 and B = 0 connected to an AND gate. What is the output? Explain your answer.
The output is 0 because an AND gate requires both inputs to be 1, and B is 0. - 5
A circuit has inputs A = 1 and B = 0 connected to an OR gate. What is the output? Explain your answer.
For OR, one true input is enough.
The output is 1 because an OR gate outputs 1 when at least one input is 1, and A is 1. - 6
A circuit first sends input A through a NOT gate, then sends the result and input B into an AND gate. If A = 0 and B = 1, what is the final output?
The NOT gate changes A = 0 into 1. Then the AND gate receives 1 and 1, so the final output is 1. - 7
Write the Boolean expression for a circuit where inputs A and B go into an AND gate, and the result is inverted by a NOT gate.
Write the operation inside the circuit first, then apply the final NOT.
The Boolean expression is NOT (A AND B), often written as ¬(A ∧ B) or (A AND B)'. This circuit is a NAND gate. - 8
A NAND gate is the opposite of an AND gate. Complete the NAND output for A,B values 00, 01, 10, and 11.
The NAND gate outputs 1 for 00, 1 for 01, 1 for 10, and 0 for 11. It is only 0 when both inputs are 1. - 9
A NOR gate is the opposite of an OR gate. Complete the NOR output for A,B values 00, 01, 10, and 11.
Find the OR output first, then flip it.
The NOR gate outputs 1 for 00, 0 for 01, 0 for 10, and 0 for 11. It is only 1 when both inputs are 0. - 10
An XOR gate outputs 1 when exactly one input is 1. Complete the XOR output for A,B values 00, 01, 10, and 11.
The XOR gate outputs 0 for 00, 1 for 01, 1 for 10, and 0 for 11. It outputs 1 only when the inputs are different. - 11
A circuit computes (A OR B) AND C. If A = 0, B = 1, and C = 1, what is the output?
Evaluate the expression inside the parentheses first.
First, A OR B equals 1 because B is 1. Then 1 AND C equals 1, so the final output is 1. - 12
A circuit computes A AND (NOT B). If A = 1 and B = 1, what is the output?
NOT B changes B = 1 into 0. Then A AND 0 equals 0, so the final output is 0. - 13
For the expression (A AND B) OR (A AND C), find the output when A = 1, B = 0, and C = 1.
Evaluate each AND part before evaluating the OR.
A AND B equals 0 because B is 0. A AND C equals 1 because both A and C are 1. Then 0 OR 1 equals 1, so the output is 1. - 14
A security light should turn on only when it is night and motion is detected. Let N = 1 mean it is night, and M = 1 mean motion is detected. Which logic gate should be used, and why?
An AND gate should be used because the light should turn on only when both N and M are 1. - 15
A warning buzzer should turn on if a door is open or a window is open. Let D = 1 mean the door is open, and W = 1 mean the window is open. Which logic gate should be used, and why?
The condition says door open or window open.
An OR gate should be used because the buzzer should turn on when either D is 1, W is 1, or both are 1.