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: 0 (false) or 1 (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 \cdot 0 = 0
0 \cdot 1 = 0
1 \cdot 0 = 0
1 \cdot 1 = 1
Boolean Addition (OR operation): Denoted by +, analogous to logical OR.
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 1
Boolean Complement (NOT operation): Denoted by a bar symbol (\overline{x}) or a prime symbol (x'), analogous to logical NOT.
\overline{0} = 1
\overline{1} = 0
Examples of Boolean Expression Evaluation
Example 1: Evaluate the expression derived from the steps (x \cdot y \cdot z)' + (w \cdot z)' + x with x=1, y=1, w=0, z=0
Substitute values: (1 \cdot 1 \cdot 0)' + (0 \cdot 0)' + 1
Perform inner multiplications: (0)' + (0)' + 1
Perform complements: 1 + 1 + 1
Perform additions: 1
Example 2: Evaluate x(y+z) with x=1, y=0, z=1
Substitute values: 1(0+1)
Perform inner addition: 1(1)
Perform multiplication: 1
Example 3: Evaluate xy+z with x=1, y=0, z=1
Substitute values: 1 \cdot 0 + 1
Perform multiplication: 0 + 1
Perform addition: 1
Boolean Functions
A Boolean function maps one or more Boolean input variables (from the set {0, 1}) to a single Boolean output value (either 0 or 1).
Boolean functions can be defined in two ways:
Using a Boolean expression: For example, f(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 + yz
x
y
z
xy
yz
f(x,y,z) = xy + yz
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
1
0
1
1
1
0
0
0
0
0
1
0
1
0
0
0
1
1
0
1
0
1
1
1
1
1
1
1
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 1.
Literal: A variable appearing in an expression in its true form (e.g., x) or complemented form (e.g., x' or \overline{x}).
Minterm: A product term consisting of exactly one literal for every input variable of the function. For three variables x, y, z, a minterm would be a product like x'yz or xyz'.
Example: Find the Boolean expression for the function defined by the table (from page 5 for f(x,y,z) = xy+yz):
x
y
z
f(x,y,z)
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
1
Identify rows where f(x,y,z) = 1:
Row 4: x=0, y=1, z=1 \rightarrow Minterm: x'yz
Row 7: x=1, y=1, z=0 \rightarrow Minterm: xyz'
Row 8: x=1, y=1, z=1 \rightarrow Minterm: xyz
Sum these minterms to get the expression:
f(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 = x
x \cdot x = x
Associative Laws
(x + y) + z = x + (y + z)
(x \cdot y) \cdot z = x \cdot (y \cdot z)
Commutative Laws
x + y = y + x
x \cdot y = y \cdot x
Distributive Laws
x + (y \cdot z) = (x + y) \cdot (x + z)
x \cdot (y + z) = (x \cdot y) + (x \cdot z)
Identity Laws
x + 0 = x
x \cdot 1 = x
Domination Laws
x + 1 = 1
x \cdot 0 = 0
Double Complement Law
(x')' = x
Complement Laws
x + x' = 1
x \cdot x' = 0
De Morgan's Laws
(x + y)' = x' \cdot y'
(x \cdot y)' = x' + y'
Absorption Laws
x + (x \cdot y) = x
x \cdot (x + y) = x
Example of Boolean Expression Simplification
Simplify: x + x'y
x + x'y = (x + x')(x + y) (Distributive Law: A+BC = (A+B)(A+C); here A=x, B=x', C=y)
(x + x')(x + y) = 1 \cdot (x + y) (Complement Law: x + x' = 1)
1 \cdot (x + y) = x + y (Identity Law: 1 \cdot A = A)
Therefore, x + 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 (xy).
Symbol: D-shaped, with two inputs (x, y) and one output (xy).
OR Gate: Represents Boolean addition (x+y).
Symbol: Curved front, with two inputs (x, y) and one output (x+y).
Inverter (NOT Gate): Represents Boolean complement (x').
Symbol: Triangle with a small circle (bubble) at the output, one input (x) and one output (x').
Example of a Combinational Circuit and its Boolean Function
Consider a circuit with inputs x, y, z:
An inverter acts on x, producing x'.
An OR gate takes x' and y as inputs, producing x'+y.
An AND gate takes (x'+y) and z as inputs, producing (x'+y)z.
Thus, the circuit corresponds to the Boolean function f(x, y, z) = (x'+y)z.
Digital Design Process
Designing digital circuits systematically involves several steps:
English Description: Clearly define the desired circuit behavior in natural language.
Input/Output Table: Translate the English description into a formal table showing outputs for all possible input combinations.
Boolean Expression: Derive a Boolean expression from the input/output table (typically as a sum of minterms).
Minimization: Simplify the Boolean expression using the laws of Boolean algebra (or other minimization techniques) to reduce the complexity of the final circuit.
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 (x and y) as inputs and produces a true output (logical 1) when x is greater than or equal to y (x \ge y), and false (logical 0) otherwise.
Input/Output Table:
x
y
f(x,y) (x \ge y)
0
0
1 (0 \ge 0 is true)
0
1
0 (0 \ge 1 is false)
1
0
1 (1 \ge 0 is true)
1
1
1 (1 \ge 1 is true)
Boolean Expression (Sum of Minterms):
The rows where f(x,y)=1 are:
x=0, y=0 \rightarrow x'y'
x=1, y=0 \rightarrow xy'
x=1, y=1 \rightarrow xy
Summing these minterms:
f(x,y) = x'y' + xy' + xy
Minimization:
f(x,y) = x'y' + xy' + xy
= (x'y' + xy') + xy (Associative Law)
= (x' + x)y' + xy (Distributive Law: factoring out y')
= (1)y' + xy (Complement Law: x' + x = 1)
= y' + xy (Identity Law: 1 \cdot A = A)
= (y' + x)(y' + y) (Distributive Law: A + BC = (A+B)(A+C); here A=y', B=x, C=y)
= (y' + x)(1) (Complement Law: y' + y = 1)
= y' + x (Identity Law: A \cdot 1 = A)
Rearranging: f(x,y) = x + y'
Digital Circuit:
The minimized expression is f(x,y) = x + y'. This can be built using one inverter and one OR gate:
An inverter takes y as input to produce y'.
An OR gate takes x and y' as inputs, producing the final output x + y'.