Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 1 of 9361. Foundations of Digital Logic and Computer ArchitectureFree lesson

Binary Logic and Fundamental Gates

You will identify the behavior of basic logic gates including AND, OR, NOT, NAND, NOR, XOR, and XNOR using truth tables.

In this lesson, you will learn how basic logic gates act as the "decisions" that power every computer by processing binary inputs.

What is a Logic Gate?

At its simplest level, a logic gate is an electronic component that takes one or more binary inputs (0 or 1) and produces a single output based on a fixed rule. You can think of a 0 as "Off" (or Low voltage) and a 1 as "On" (or High voltage).

The Fundamental Gates

The behavior of these gates is best visualized through a Truth Table, which maps every possible input combination to an output.

  • NOT: Inverts the signal. If input is 0, output is 1.
  • AND: Outputs 1 only if both inputs are 1.
  • OR: Outputs 1 if at least one input is 1.
Input AInput BAND OutputOR Output
0000
0101
1001
1111

Universal and Exclusive Gates

Some gates are combinations of the basics, serving specific architectural needs:

  • NAND & NOR: These are "Not-AND" and "Not-OR." They act exactly like their counterparts, but their output is flipped (e.g., NAND outputs 0 only when both inputs are 1).
  • XOR (Exclusive OR): Outputs 1 only if the inputs are different. If both are 0 or both are 1, it outputs 0.
  • XNOR: The exact inverse of XOR; it outputs 1 only if the inputs are the same.

Visualizing Logic

In computer architecture, we represent these as simple mathematical functions. If we let A and B be our inputs, the XOR gate logic looks like this:

If (A != B) Output = 1
Else        Output = 0

By chaining these gates together, we can perform complex tasks like adding numbers or storing memory. Every processor instruction, from loading data to jumping through code, is ultimately just a result of these gates reacting to bits.

Key Takeaway: Logic gates are the building blocks of computing, using binary rules to transform input states into meaningful output decisions.