Fiveable

๐Ÿ’พIntro to Computer Architecture Unit 2 Review

QR code for Intro to Computer Architecture practice questions

2.2 Boolean algebra and logic gates

๐Ÿ’พIntro to Computer Architecture
Unit 2 Review

2.2 Boolean algebra and logic gates

Written by the Fiveable Content Team โ€ข Last updated September 2025
Written by the Fiveable Content Team โ€ข Last updated September 2025
๐Ÿ’พIntro to Computer Architecture
Unit & Topic Study Guides

Boolean algebra and logic gates are the building blocks of digital systems. They allow us to manipulate and simplify complex logical expressions, turning them into efficient circuits. This topic is crucial for understanding how computers process information at the most basic level.

By mastering Boolean algebra and logic gates, you'll be able to design and analyze digital circuits. These skills are fundamental for creating everything from simple logic circuits to complex computer processors, forming the foundation of modern digital technology.

Simplifying Logic Expressions

Boolean Algebra Fundamentals

  • Boolean algebra manipulates and simplifies expressions involving binary variables using logical operators
  • The three basic Boolean operators include AND (โˆ™), OR (+), and NOT (ยฌ or overbar)
    • These operators follow specific rules and properties (commutative, associative, and distributive laws)
  • Boolean identities simplify Boolean expressions
    • Identity, null, idempotent, complement, and absorption laws are commonly used identities
  • De Morgan's laws simplify expressions involving the NOT operator
    • ยฌ(A โˆ™ B) = ยฌA + ยฌB and ยฌ(A + B) = ยฌA โˆ™ ยฌB
  • The consensus theorem eliminates redundant terms in Boolean expressions
    • (A โˆ™ B) + (ยฌA โˆ™ C) + (B โˆ™ C) = (A โˆ™ B) + (ยฌA โˆ™ C)

Karnaugh Maps for Simplification

  • Karnaugh maps (K-maps) provide a graphical method for simplifying Boolean expressions
    • K-maps group together adjacent cells containing 1s in the map
  • The number of cells in a K-map is determined by 2^n, where n is the number of input variables
  • Each cell in the K-map represents a unique combination of input values
  • Simplification involves identifying the largest groups of adjacent 1s and combining them into simplified terms
  • The simplified terms are then combined using Boolean OR operations to obtain the final simplified expression

Logic Gate Functions

Basic Logic Gates

  • Logic gates are electronic circuits that perform logical operations on binary inputs to produce a binary output
  • The AND gate outputs a 1 only when all of its inputs are 1; otherwise, it outputs a 0
    • Represents the Boolean AND operation (A โˆ™ B)
  • The OR gate outputs a 1 when at least one of its inputs is 1; otherwise, it outputs a 0
    • Represents the Boolean OR operation (A + B)
  • The NOT gate (inverter) outputs the complement of its single input
    • Represents the Boolean NOT operation (ยฌA)
  • The XOR (exclusive OR) gate outputs a 1 when exactly one of its inputs is 1; otherwise, it outputs a 0
    • Represents the Boolean XOR operation (A โŠ• B)

Universal Gates

  • NAND (NOT-AND) and NOR (NOT-OR) gates are universal gates
    • They can be used to implement any Boolean function
  • The NAND gate outputs a 0 only when all of its inputs are 1; otherwise, it outputs a 1
    • Represents the Boolean NAND operation (ยฌ(A โˆ™ B))
  • The NOR gate outputs a 1 only when all of its inputs are 0; otherwise, it outputs a 0
    • Represents the Boolean NOR operation (ยฌ(A + B))
  • Any logic circuit can be constructed using only NAND or NOR gates
    • This property makes them essential for digital circuit design

Truth Tables for Logic

Constructing Truth Tables

  • A truth table is a tabular representation of all possible input combinations and their corresponding output values
  • The number of rows in a truth table is determined by 2^n, where n is the number of input variables
    • For example, a truth table with 2 input variables (A and B) will have 2^2 = 4 rows
  • Each row in the truth table represents a unique combination of input values
    • The output value is determined by the logic expression or circuit
  • To construct a truth table for a logic expression, evaluate the expression for each combination of input values using Boolean algebra rules
    • Example: For the expression A โˆ™ B, the output is 1 only when both A and B are 1

Truth Tables for Logic Circuits

  • For logic circuits, the truth table is constructed by determining the output of each gate based on its input values
  • The signals are then propagated through the circuit until the final output is obtained
  • Start by determining the output of the gates connected directly to the input variables
    • Use the truth tables of the individual gates (AND, OR, NOT, etc.) to determine their outputs
  • Proceed to the next level of gates, using the outputs from the previous level as inputs
  • Continue this process until the final output of the circuit is determined for each combination of input values

Combinational Circuit Design

Analyzing Combinational Logic Circuits

  • Combinational logic circuits are circuits whose outputs depend solely on the current input values, without any memory of previous states
  • To analyze a combinational logic circuit, create a truth table that shows the output values for all possible input combinations
    • Determine the output of each gate based on its inputs and propagate the signals through the circuit
  • The behavior of a combinational logic circuit can be described using a Boolean expression derived from the truth table
    • Use Boolean algebra techniques to simplify the expression if necessary

Designing Combinational Logic Circuits

  • When designing a combinational logic circuit, start by creating a truth table that defines the desired output for each input combination
  • Obtain a Boolean expression from the truth table
    • Use a sum-of-products (SOP) or product-of-sums (POS) approach to write the expression
  • Simplify the Boolean expression using Boolean algebra techniques or Karnaugh maps to minimize the number of gates required
    • Identify common terms, apply identities, or use other simplification methods
  • Implement the simplified Boolean expression using the appropriate logic gates (AND, OR, NOT, NAND, NOR, XOR)
    • Connect the gates according to the simplified expression
  • Verify the designed circuit by comparing its truth table with the original truth table
    • Ensure that the circuit produces the desired outputs for all input combinations