Lecture 5 - Boolean Logic & Circuits

Boolean Algebra and Digital Design

Introduction to Boolean Algebra

  • Boolean algebra is a system of rules and operations used with variables that can only have two values: 00 (false) or 11 (true).

  • It forms the mathematical foundation for digital electronic circuits and computer logic.

Boolean Operations
  • Boolean Multiplication (AND operation): Denoted by ⋅\cdot (or implied by juxtaposition), analogous to logical AND.

    • 0⋅0=00 \cdot 0 = 0

    • 0⋅1=00 \cdot 1 = 0

    • 1⋅0=01 \cdot 0 = 0

    • 1⋅1=11 \cdot 1 = 1

  • Boolean Addition (OR operation): Denoted by ++, analogous to logical OR.

    • 0+0=00 + 0 = 0

    • 0+1=10 + 1 = 1

    • 1+0=11 + 0 = 1

    • 1+1=11 + 1 = 1

  • Boolean Complement (NOT operation): Denoted by a bar symbol (x‾\overline{x}) or a prime symbol (x′x'), analogous to logical NOT.

    • 0‾=1\overline{0} = 1

    • 1‾=0\overline{1} = 0

Examples of Boolean Expression Evaluation
  • Example 1: Evaluate the expression derived from the steps (x⋅y⋅z)′+(w⋅z)′+x(x \cdot y \cdot z)' + (w \cdot z)' + x with x=1,y=1,w=0,z=0x=1, y=1, w=0, z=0

    • Substitute values: (1⋅1⋅0)′+(0⋅0)′+1(1 \cdot 1 \cdot 0)' + (0 \cdot 0)' + 1

    • Perform inner multiplications: (0)′+(0)′+1(0)' + (0)' + 1

    • Perform complements: 1+1+11 + 1 + 1

    • Perform additions: 11

  • Example 2: Evaluate x(y+z)x(y+z) with x=1,y=0,z=1x=1, y=0, z=1

    • Substitute values: 1(0+1)1(0+1)

    • Perform inner addition: 1(1)1(1)

    • Perform multiplication: 11

  • Example 3: Evaluate xy+zxy+z with x=1,y=0,z=1x=1, y=0, z=1

    • Substitute values: 1⋅0+11 \cdot 0 + 1

    • Perform multiplication: 0+10 + 1

    • Perform addition: 11

Boolean Functions

  • A Boolean function maps one or more Boolean input variables (from the set 0,1{0, 1}) to a single Boolean output value (either 00 or 11).

  • Boolean functions can be defined in two ways:

    • Using a Boolean expression: For example, f(x,y,z)=xy+yzf(x, y, z) = xy + yz.

    • Using an input/output table: Similar to a truth table, it lists the output value for every possible combination of input values.

Constructing an Input/Output Table from a Boolean Expression




  • Example: Construct the input/output table for f(x,y,z)=xy+yzf(x, y, z) = xy + yz


    xx

    yy

    zz

    xyxy

    yzyz

    f(x,y,z)=xy+yzf(x,y,z) = xy + yz



    00

    00

    00

    00

    00

    00



    00

    00

    11

    00

    00

    00



    00

    11

    00

    00

    00

    00



    00

    11

    11

    00

    11

    11



    11

    00

    00

    00

    00

    00



    11

    00

    11

    00

    00

    00



    11

    11

    00

    11

    00

    11



    11

    11

    11

    11

    11

    11









    Constructing a Boolean Expression from an Input/Output Table







    • A Boolean expression can be created by summing the minterms of all rows where the function's output is 11.

      • Literal: A variable appearing in an expression in its true form (e.g., xx) or complemented form (e.g., x′x' or x‾\overline{x}).

      • Minterm: A product term consisting of exactly one literal for every input variable of the function. For three variables x,y,zx, y, z, a minterm would be a product like x′yzx'yz or xyz′xyz'.

    • Example: Find the Boolean expression for the function defined by the table (from page 5 for f(x,y,z)=xy+yzf(x,y,z) = xy+yz):

      xx

      yy

      zz

      f(x,y,z)f(x,y,z)

      00

      00

      00

      00

      00

      00

      11

      00

      00

      11

      00

      00

      00

      11

      11

      11

      11

      00

      00

      00

      11

      00

      11

      00

      11

      11

      00

      11

      11

      11

      11

      11

      • Identify rows where f(x,y,z)=1f(x,y,z) = 1:

        • Row 44: x=0,y=1,z=1→x=0, y=1, z=1 \rightarrow Minterm: x′yzx'yz

        • Row 77: x=1,y=1,z=0→x=1, y=1, z=0 \rightarrow Minterm: xyz′xyz'

        • Row 88: x=1,y=1,z=1→x=1, y=1, z=1 \rightarrow Minterm: xyzxyz

      • Sum these minterms to get the expression:
        f(x,y,z)=x′yz+xyz′+xyzf(x, y, z) = x'yz + xyz' + xyz

    Laws of Boolean Algebra

    • These laws are fundamental for manipulating and simplifying Boolean expressions.

    Rule

    Application 1 (OR form)

    Application 2 (AND form)

    Idempotent Laws

    x+x=xx + x = x

    x⋅x=xx \cdot x = x

    Associative Laws

    (x+y)+z=x+(y+z)(x + y) + z = x + (y + z)

    (x⋅y)⋅z=x⋅(y⋅z)(x \cdot y) \cdot z = x \cdot (y \cdot z)

    Commutative Laws

    x+y=y+xx + y = y + x

    x⋅y=y⋅xx \cdot y = y \cdot x

    Distributive Laws

    x+(y⋅z)=(x+y)⋅(x+z)x + (y \cdot z) = (x + y) \cdot (x + z)

    x⋅(y+z)=(x⋅y)+(x⋅z)x \cdot (y + z) = (x \cdot y) + (x \cdot z)

    Identity Laws

    x+0=xx + 0 = x

    x⋅1=xx \cdot 1 = x

    Domination Laws

    x+1=1x + 1 = 1

    x⋅0=0x \cdot 0 = 0

    Double Complement Law

    (x′)′=x(x')' = x


    Complement Laws

    x+x′=1x + x' = 1

    x⋅x′=0x \cdot x' = 0

    De Morgan's Laws

    (x+y)′=x′⋅y′(x + y)' = x' \cdot y'

    (x⋅y)′=x′+y′(x \cdot y)' = x' + y'

    Absorption Laws

    x+(x⋅y)=xx + (x \cdot y) = x

    x⋅(x+y)=xx \cdot (x + y) = x

    Example of Boolean Expression Simplification
    • Simplify: x+x′yx + x'y

      1. x+x′y=(x+x′)(x+y)x + x'y = (x + x')(x + y) (Distributive Law: A+BC=(A+B)(A+C)A+BC = (A+B)(A+C); here A=x,B=x′,C=yA=x, B=x', C=y)

      2. (x+x′)(x+y)=1⋅(x+y)(x + x')(x + y) = 1 \cdot (x + y) (Complement Law: x+x′=1x + x' = 1)

      3. 1⋅(x+y)=x+y1 \cdot (x + y) = x + y (Identity Law: 1⋅A=A1 \cdot A = A)

    • Therefore, x+x′y=x+yx + x'y = x + y

    Logic Gates and Combinational Circuits

    • Gates: Electrical devices that implement Boolean functions. They are the building blocks of digital circuits.

    • Combinational Circuits: Circuits built by combining inverters, OR gates, and AND gates. Their output depends solely on the current inputs.

    Common Logic Gate Symbols
    • AND Gate: Represents Boolean multiplication (xyxy).

      • Symbol: D-shaped, with two inputs (x,yx, y) and one output (xyxy).

    • OR Gate: Represents Boolean addition (x+yx+y).

      • Symbol: Curved front, with two inputs (x,yx, y) and one output (x+yx+y).

    • Inverter (NOT Gate): Represents Boolean complement (x′x').

      • Symbol: Triangle with a small circle (bubble) at the output, one input (xx) and one output (x′x').

    Example of a Combinational Circuit and its Boolean Function
    • Consider a circuit with inputs x,y,zx, y, z:

      1. An inverter acts on xx, producing x′x'.

      2. An OR gate takes x′x' and yy as inputs, producing x′+yx'+y.

      3. An AND gate takes (x′+y)(x'+y) and zz as inputs, producing (x′+y)z(x'+y)z.

    • Thus, the circuit corresponds to the Boolean function f(x,y,z)=(x′+y)zf(x, y, z) = (x'+y)z.

    Digital Design Process

    • Designing digital circuits systematically involves several steps:

      1. English Description: Clearly define the desired circuit behavior in natural language.

      2. Input/Output Table: Translate the English description into a formal table showing outputs for all possible input combinations.

      3. Boolean Expression: Derive a Boolean expression from the input/output table (typically as a sum of minterms).

      4. Minimization: Simplify the Boolean expression using the laws of Boolean algebra (or other minimization techniques) to reduce the complexity of the final circuit.

      5. Digital Circuit: Implement the minimized Boolean expression using logic gates.

    Digital Design Example: Comparing Two One-Bit Numbers
    • English Description: Design a circuit that takes two one-bit binary numbers (xx and yy) as inputs and produces a truetrue output (logical 11) when xx is greater than or equal to yy (x≥yx \ge y), and falsefalse (logical 00) otherwise.

    • Input/Output Table:

      xx

      yy

      f(x,y)f(x,y) (x≥yx \ge y)

      00

      00

      11 (0≥00 \ge 0 is true)

      00

      11

      00 (0≥10 \ge 1 is false)

      11

      00

      11 (1≥01 \ge 0 is true)

      11

      11

      11 (1≥11 \ge 1 is true)

    • Boolean Expression (Sum of Minterms):

      • The rows where f(x,y)=1f(x,y)=1 are:

        • x=0,y=0→x′y′x=0, y=0 \rightarrow x'y'

        • x=1,y=0→xy′x=1, y=0 \rightarrow xy'

        • x=1,y=1→xyx=1, y=1 \rightarrow xy

      • Summing these minterms:
        f(x,y)=x′y′+xy′+xyf(x,y) = x'y' + xy' + xy

    • Minimization:

      • f(x,y)=x′y′+xy′+xyf(x,y) = x'y' + xy' + xy

      • =(x′y′+xy′)+xy= (x'y' + xy') + xy (Associative Law)

      • =(x′+x)y′+xy= (x' + x)y' + xy (Distributive Law: factoring out y′y')

      • =(1)y′+xy= (1)y' + xy (Complement Law: x′+x=1x' + x = 1)

      • =y′+xy= y' + xy (Identity Law: 1⋅A=A1 \cdot A = A)

      • =(y′+x)(y′+y)= (y' + x)(y' + y) (Distributive Law: A+BC=(A+B)(A+C)A + BC = (A+B)(A+C); here A=y′,B=x,C=yA=y', B=x, C=y)

      • =(y′+x)(1)= (y' + x)(1) (Complement Law: y′+y=1y' + y = 1)

      • =y′+x= y' + x (Identity Law: A⋅1=AA \cdot 1 = A)

      • Rearranging: f(x,y)=x+y′f(x,y) = x + y'

    • Digital Circuit:

      • The minimized expression is f(x,y)=x+y′f(x,y) = x + y'. This can be built using one inverter and one OR gate:

        1. An inverter takes yy as input to produce y′y'.

        2. An OR gate takes xx and y′y' as inputs, producing the final output x+y′x + y'.