Use the following logic gate symbols: NOT, AND, OR, NAND, NOR, XOR

Resources | Subject Notes | Computer Science

3.2 Logic Gates and Logic Circuits

Introduction

Logic gates are fundamental building blocks of digital circuits. They perform basic logical operations on one or more binary inputs (0 or 1) to produce a single binary output (0 or 1). These gates are essential for creating more complex digital systems, such as adders, decoders, and microprocessors.

Basic Logic Gates

Here's a detailed explanation of the common logic gates:

NOT Gate

The NOT gate, also known as the inverter, performs the logical inverse of its input. If the input is 0, the output is 1, and vice versa.

Suggested diagram: NOT gate symbol and truth table.
Input (A) Output (Q)
0 1
1 0

AND Gate

The AND gate produces a 1 output only if both of its inputs are 1. If either or both inputs are 0, the output is 0.

Suggested diagram: AND gate symbol and truth table.
Input A Input B Output (Q)
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate

The OR gate produces a 1 output if at least one of its inputs is 1. The output is 0 only if both inputs are 0.

Suggested diagram: OR gate symbol and truth table.
Input A Input B Output (Q)
0 0 0
0 1 1
1 0 1
1 1 1

NAND Gate

The NAND gate is the inverse of the AND gate. It produces a 0 output only if both of its inputs are 1. Otherwise, the output is 1.

Suggested diagram: NAND gate symbol and truth table.
Input A Input B Output (Q)
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate

The NOR gate is the inverse of the OR gate. It produces a 1 output only if both of its inputs are 0. Otherwise, the output is 0.

Suggested diagram: NOR gate symbol and truth table.
Input A Input B Output (Q)
0 0 1
0 1 0
1 0 0
1 1 0

XOR Gate

The XOR (exclusive OR) gate produces a 1 output if its inputs are different (one is 0 and the other is 1). It produces a 0 output if its inputs are the same (both 0 or both 1).

Suggested diagram: XOR gate symbol and truth table.
Input A Input B Output (Q)
0 0 0
0 1 1
1 0 1
1 1 0

Logic Circuits

Logic gates are combined to create more complex logic circuits. Here are some examples:

Half Adder

A half adder is a combinational circuit that adds two single-bit binary numbers. It has two inputs (A and B) and two outputs (Sum and Carry).

Suggested diagram: Half adder circuit diagram.

The Boolean equations for a half adder are:

$$ \begin{aligned} \text{Sum} &= A \oplus B \\ \text{Carry} &= A \land B \end{aligned} $$

Full Adder

A full adder is a combinational circuit that adds three single-bit binary numbers: two inputs (A and B) and a carry-in (Cin). It has two outputs: a sum (Sum) and a carry-out (Cout).

Suggested diagram: Full adder circuit diagram.

The Boolean equations for a full adder are:

$$ \begin{aligned} \text{Sum} &= A \oplus B \oplus Cin \\ \text{Carry} &= (A \land B) \lor (A \land Cin) \lor (B \land Cin) \end{aligned} $$

Truth Tables

Truth tables are used to define the behavior of logic gates and circuits. They list all possible combinations of input values and the corresponding output values.

Applications

Logic gates and circuits are used in a wide variety of applications, including:

  • Arithmetic operations in computers
  • Memory circuits
  • Control systems
  • Digital communication

Key Concepts

  • Binary logic
  • Boolean algebra
  • Truth tables
  • Logic expressions
  • Circuit diagrams