Topic 2a – Logic Gates

The tiniest building blocks that make the computer's decisions possible.

Learning Objectives

By the end of this topic, you should be able to:

Learning Activities

To help you meet the learning objectives, we have prepared a combination of readings, activities, and videos.

Course Readings

These reading were designed to introduce the course topics to an audience of educators. They should be considered "required" and read in order.

Supplemental Readings

Some participants find it helpful to read about a topic from a source written for a slightly more technical audience. These supplemental readings cover similar material as the course readings but may not fully align with the course learning objectives. Use them as an optional complement to your study, not a substitute for the course readings.

Lesson Videos

These videos support the readings above and may present the material with some deeper connections and worked examples.

Exploratory Activity

You might find it easier to understand logic gates — in particular small circuits — if you can get some "hands on" experience. The following activity guides you through working with an online simulator to explore gates and circuits.

Checking for Understanding, Questions

Review the Learning Objectives at the top of this page. You will be asked to demonstrate these skills on this week's competency demo. To check your understanding, try the following questions. Try each one on your own before looking at the answer key. It is completely fine if you need to revisit the readings as you work through these questions.

Individual Gates

  1. For the inputs A = 1 and B = 0, what is the output of an AND gate? An OR gate? An XOR gate?
  2. If A = 0, what is the output of a NOT gate?
  3. Write a truth table for a two-input XOR gate. What patterns do you notice?

Small Circuits

  1. Draw a circuit that represents (NOT A) AND B. Predict its output for all four combinations of A and B.
  2. Given a circuit that performs (A AND B) OR (NOT C), compute the output for at least three different sets of inputs.

Checking for Understanding, Answers

You can begin by comparing your answers to the following answer key.

Show Answer Key

Individual Gates

  1. With A = 1 and B = 0:
    AND gate output: 0 (both inputs must be 1; B is 0, so output is 0).
    OR gate output: 1 (at least one input is 1; A is 1, so output is 1).
    XOR gate output: 1 (exactly one input is 1; inputs differ, so output is 1).
  2. If A = 0, the NOT gate output is 1. NOT always flips the input.
  3. Truth table for a two-input XOR gate:
    A B A XOR B
    0 0 0
    0 1 1
    1 0 1
    1 1 0
    Pattern to notice: XOR outputs 1 when the inputs are different and 0 when they are the same. Unlike OR, it does not output 1 when both inputs are 1.

Small Circuits

  1. Truth table for (NOT A) AND B:
    A B NOT A (NOT A) AND B
    0 0 1 0
    0 1 1 1
    1 0 0 0
    1 1 0 0
    This circuit outputs 1 only when A is 0 and B is 1.
  2. Sample outputs for (A AND B) OR (NOT C):
    A B C A AND B NOT C Result
    1 1 0 1 1 1
    1 0 1 0 0 0
    0 0 0 0 1 1
    1 1 1 1 0 1
    The circuit outputs 0 only when both A AND B is 0 and C is 1. In all other cases, at least one of the two OR inputs is 1.

If you still have questions or concerns you can use the videos below to try and further your understanding.

Extend Your Learning

The following resources go a little deeper on topics we touched on but did not fully explore in the readings. These are entirely optional — none of this material appears on the Competency Demo — but each one is a natural "next question" from something covered this week.

  • NAND, NOR, and XNOR gates
    You studied four gates — AND, OR, XOR, and NOT. There are three more worth knowing: NAND (NOT AND), NOR (NOT OR), and XNOR (NOT XOR). Each is simply the inverse of one you already know, but NAND and NOR have a special property: any logic circuit can be built entirely from NANDs (or entirely from NORs). This Wikipedia article explains why that matters for chip design.
  • The flip-flop: how circuits store state
    All the circuits in this topic are stateless — the output depends only on the current inputs. A flip-flop is a circuit built from logic gates that can remember a single bit. It is the foundational building block of memory cells and registers. This brief explanation introduces the SR flip-flop, the simplest form.
    Flip-flop — Wikipedia