Chapter 2.10 - Hardware Abstractions & Logic Gates
Time Estimate: 45 minutes
2.10.1. Introduction and Goals
In this lesson, we will look at some additional examples of how the Big Idea of abstraction is used in computing. We will focus on low-level hardware abstractions, in particular, on logic gates, the fundamental computational building blocks of electronic circuits. We'll take a first look "under the hood," so to speak, to see how computers process binary information.
Learning Objectives: I will learn to
Write expressions using logical operators
Evaluate expressions that use logic operators
Language Objectives: I will be able to
Describe varying levels of abstractions in hardware, including logic gates and flip-flops, using target vocabulary, supporting details, and examples
Explain logic gates using key vocabulary such as OR gate, AND gate, NOT gate, Boolean, and flip flop, out loud and in writing, with the support of vocabulary notes from this lesson
2.10.2. Learning Activities
Lecture
Hardware Abstractions with Logic Gates Activity: 2.10.2.1 YouTube (JGMtLwfxozU)
Logicly Activity
Logicly provides an engaging, hands-on learning environment for teaching logic gates and circuits. It provides some free online demos of simple logic gates. To help solidify your understanding of the basic gates, click on the links below. In each case, review the truth table definitions and then play with the Live Example circuit to verify that it behaves as defined by the truth table.
NOTE: To create your own circuits, you need to go into Edit mode by clicking on the little widget on the bottom left of the Live Example frame, as shown in the picture. Then you can drag together components and put them together. If you do not see the Live Example, first click on the Adobe Flash Player link and then click on Allow Run Flash.
In an AND gate, the output is TRUE (the light is ON) when both of its inputs are TRUE (or ON).
In an OR gate, the output is TRUE (the light is ON) when either or both of its inputs are TRUE (or ON).
In a NOT gate, the output is TRUE (or ON) when its single input is FALSE (or OFF).
POGIL Activity for the Classroom (20 minutes)
Break into POGIL teams of 4 and assign each team member one of the following roles. Record your answers using this worksheet.
Role
Responsibility
Facilitator
Uses the Logicly tool to implement the solutions agreed on by the team.
Spokesperson
Reports the teams results.
Quality Control
Records the teams solutions.
Process Analyst
Keeps track of the teams progress and assesses its performance.
Designing a Computational Circuit: Critical Thinking Exercises
The word OR has a different meaning in the following two sentences; which meaning corresponds to the Boolean OR gate?
Choose either soup OR salad with your entree.
Insurance benefits will be paid in case of accident OR illness.
Define 2 truth tables, one for each of the two meanings of OR that you discussed above. Your truth table should consist of 4 rows that together provide all possible values for inputs A and B, and what the result Z would be. For example, A is "soup" and B is "salad" and Z is "soup or salad" for one of the meanings of or above.
A
B
Z
False
False
False
True
True
False
True
True
(Portfolio) The first sense of OR (soup or salad) is known as Exclusive OR and the second sense (accident or illness) is known as Inclusive-OR. Inclusive-OR is the same as Boolean OR. Exclusive-OR can be defined as: (Either A OR B) AND (NOT (both A AND B)). Use Logicly edit mode to construct the Exclusive-OR circuit. As suggested in the definition, you'll need to combine AND, OR, and NOT gates. The circuit should have 2 inputs and 1 output. Make sure your circuit behaves as defined by the truth table you created in part #2. (Hint: For this circuit, you'll need 2 AND gates, 1 OR gate, and 1 NOT gate. Also, you should use switches, not buttons, for the 2 inputs.)
(Portfolio) Consider these three things: The OR gate (i.e., the physical circuit), the Boolean OR function (as defined by its truth table), and the OR symbol. How would arrange them from most abstract to least abstract? And what criterion would you use to determine their order?
Pictured here is a Logicly version of the flip-flop discussed in the lecture. A flip-flop is a basic memory circuit that stores a single bit -- either a 0 or 1. Implement this circuit in Logicly edit mode. NOTE that NOR gates (not OR gates) are being used in this circuit and that the inputs are Push Buttons (not switches). The light should turn on when you click the bottom button and turn off when you click the top button. Which memory state (a 0 or a 1) is represented by clicking the bottom button as seen in the image below?

AP CSP Pseudocode Logical Operators
In Thunkable and in the AP CSP pseudocode, the logical operators AND, OR, and NOT can be used to combine Boolean expressions in programming, and they behave in the same way that the AND, OR, and NOT logic gates behave in computer hardware. The exam reference sheet provides the definitions for the following logical operators, where the condition can be a single boolean value or a boolean expression made up of other values and operators.
NOT condition: evaluates to true if the condition is false; otherwise, it evaluates to false.
condition1 AND condition2: evaluates to true if both condition1 and condition2 are true; otherwise it evaluates to false.
condition1 OR condition2: evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise it evaluates to false.
2.10.3. Summary
In this lesson, you learned how to:
Learning Objective AAP-2.F.a: For relationships between Boolean values: a. Write expressions using logical operators.
Learning Objective AAP-2.F.b: For relationships between Boolean values: b. Evaluate expressions that use logic operators.
The exam reference sheet provides the logical operators NOT, AND, and OR, which evaluate to a Boolean value.
The exam reference sheet provides the NOT condition, which evaluates to true if the condition is false; otherwise, it evaluates to false.
The exam reference sheet provides condition1 AND condition2, which evaluates to true if both condition1 and condition2 are true; otherwise, it evaluates to false.
The exam reference sheet provides condition1 OR condition2, which evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise, it evaluates to false.
The operand for a logical operator is either a Boolean expression or a single Boolean value.
2.10.4. Still Curious?
Still curious about logic gates? There is much written about logic gates and lots of material available online.
A good place to start might be with this I-Programmer discussion of Boolean logic and its importance in computing.
Here is a description of how transistors are used to build logic gates, a video about how transistors are made, and a video zooming into a chip.
2.10.5. Self-Check
Vocabulary
Here is a table of the technical terms we've introduced in this lesson. Hover over the terms to review the definitions.
transistor
logic gate
integrated circuit
AND gate
OR gate
NOT gate
flip flop
RAM
CPU
Check Your Understanding
Complete the following self-check exercises.
Q-1: An AND gate is an electronic component that takes two inputs, A and B, such that
A. the gate will be TRUE (or ON) when A is TRUE (or ON).
B. the gate will be TRUE (or ON) when both A and B are TRUE (or ON).
C. the gate will be TRUE (or ON) when B is TRUE (or ON).
D. the gate will be TRUE (or ON) when either A or B is TRUE (or ON).
Q-2: An OR gate is an electronic component with two inputs, A and B, such that
A. the gate would be TRUE (or ON) when either or both A and B are TRUE (or ON).
B. both inputs must be FALSE (or OFF) for it to be TRUE (or ON).
C. both inputs must always have the same value for the gate to be TRUE (or ON).
D. both inputs must always be TRUE (or ON) for the gate to be TRUE (or ON).
Q-3: Which of the following lists arranges hardware components from the lowest to the highest abstraction level?
A. Physical circuit, logic gate, RAM chip, motherboard,
B. RAM chip, logic gate, physical circuit, motherboard.
C. RAM chip, motherboard, logic gate, physical circuit
D. Physical circuit, motherboard, logic gate, RAM chip
Q-4: True or False. The symbol for an OR gate is less abstract than the circuit diagram that defines its behavior.
A. False
B. True
Q-5: True or False. The symbol for an AND gate is more abstract than the truth table that defines its behavior.
A. False
B. True
Q-6: In general, which of the following is the most abstract when it comes to talking about chairs?
A. The word 'chair' itself.
B. A picture of a chair.
C. The chair itself.
D. The dictionary definition of the word 'chair'.
Sample AP CSP Exam Questions
Q-7: Refer to the figure below.

A. Input A can be either true or false.
B. Input A must be false.
C. Input A must be true.
D. There is no possible value of Input A that will cause the circuit to have the output true.
Q-8: An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables.

The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?
A. (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)
B. (onFloor1 OR callTo2) AND (onFloor2 OR callTo1)
C. (onFloor1 AND callTo2) AND (onFloor2 AND callTo1)
D. (onFloor1 OR callTo2) OR (onFloor2 OR callTo1)
2.10.6. Reflection: For Your Portfolio
Answer the following portfolio reflection questions as directed by your instructor. Questions are also available in this Google Doc where you may use File > Make a Copy to make your own editable copy.
Last updated