Logic Gates and Boolean Algebra
By Notes Vandar
2.1. Basic definition of Boolean Algebra
Definition: Boolean algebra is a branch of algebra that deals with variables that have two possible values: true (1) and false (0). It provides a mathematical framework for analyzing and simplifying logical expressions and is fundamental to computer science, digital electronics, and set theory.
Key Concepts:
- Variables:
- In Boolean algebra, variables represent logical values, typically denoted as A,B,C,A, B, C, etc., which can take on the values 0 or 1.
- Operations:
- Boolean algebra primarily involves three basic operations:
- AND (·): The result is true if both operands are true.
- A⋅B=1A \cdot B = 1 if A=1A = 1 and B=1B = 1; otherwise, it is 0.
- OR (+): The result is true if at least one operand is true.
- A+B=1A + B = 1 if A=1A = 1 or B=1B = 1; otherwise, it is 0.
- NOT (¬): The result is the inverse of the operand.
- ¬A=1\neg A = 1 if A=0A = 0 and ¬A=0\neg A = 0 if A=1A = 1.
- AND (·): The result is true if both operands are true.
- Boolean algebra primarily involves three basic operations:
- Laws of Boolean Algebra:
- Several laws govern Boolean operations, including:
- Identity Law: A+0=AA + 0 = A, A⋅1=AA \cdot 1 = A
- Null Law: A+1=1A + 1 = 1, A⋅0=0A \cdot 0 = 0
- Idempotent Law: A+A=AA + A = A, A⋅A=AA \cdot A = A
- Complement Law: A+¬A=1A + \neg A = 1, A⋅¬A=0A \cdot \neg A = 0
- Distributive Law: A⋅(B+C)=(A⋅B)+(A⋅C)A \cdot (B + C) = (A \cdot B) + (A \cdot C)
- Several laws govern Boolean operations, including:
- Truth Tables:
- A truth table is a mathematical table that lists all possible values of the variables and the result of the Boolean expression for each combination.
- Applications:
- Boolean algebra is widely used in digital logic design, computer programming, search algorithms, and circuit design, forming the backbone of modern computing systems.
2.2. Basic Theory of Boolean Algebra, Boolean Functions, Logical operations
Basic Theory of Boolean Algebra
1. Boolean Variables:
- Boolean algebra consists of variables that can take on the values of true (1) or false (0).
2. Boolean Functions:
- A Boolean function is a mathematical expression formed using Boolean variables and logical operations. It produces a Boolean output based on the input values.
3. Representation:
- Boolean functions can be represented in several ways, including:
- Algebraic Form: Using Boolean expressions (e.g., F(A,B)=A⋅B+¬AF(A, B) = A \cdot B + \neg A).
- Truth Tables: A table that lists all possible combinations of input values and the corresponding output values.
Logical Operations
Boolean algebra is defined by three fundamental logical operations:
1. AND Operation (·)
- Symbol: ⋅\cdot or sometimes omitted.
- Definition: The result is true if both operands are true.
- Truth Table:
A | B | A · B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
2. OR Operation (+)
- Symbol: ++
- Definition: The result is true if at least one operand is true.
- Truth Table:
A | B | A + B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
3. NOT Operation (¬)
- Symbol: ¬\neg or an overline (e.g., A‾\overline{A})
- Definition: The result is the inverse of the operand.
- Truth Table:
A | ¬A |
---|---|
0 | 1 |
1 | 0 |
Derived Operations
1. NAND Operation:
- Definition: The result is false only if both operands are true (NOT AND).
- Symbol: A↑BA \uparrow B or (A⋅B)′(A · B)’.
- Truth Table:
A | B | A NAND B |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
2. NOR Operation:
- Definition: The result is true only if both operands are false (NOT OR).
- Symbol: A↓BA \downarrow B or (A+B)′(A + B)’.
- Truth Table:
A | B | A NOR B |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
3. XOR Operation (Exclusive OR):
- Definition: The result is true if exactly one operand is true.
- Symbol: ⊕\oplus.
- Truth Table:
A | B | A XOR B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
2.3. Logic Gates, IC Digital Logic Families. Basic gates (AND, OR, NOT gates)
Logic Gates
Definition: Logic gates are the fundamental building blocks of digital circuits. They perform basic logical functions that are essential for digital computing. Each gate represents a specific Boolean function.
Basic Gates
- AND Gate:
- Symbol:
css
A ----|&|---- Output
B ----| |
- Function: The output is true (1) only if both inputs are true (1).
- Truth Table:
A B Output (A · B) 0 0 0 0 1 0 1 0 0 1 1 1 - Symbol:
- OR Gate:
- Symbol:
css
A ----|≥1|---- Output
B ----| |
- Function: The output is true (1) if at least one input is true (1).
- Truth Table:
A B Output (A + B) 0 0 0 0 1 1 1 0 1 1 1 1 - Symbol:
- NOT Gate:
- Symbol:
css
A ----|¬|---- Output
| |
- Function: The output is the inverse of the input.
- Truth Table:
A Output (¬A) 0 1 1 0 - Symbol:
Integrated Circuit (IC) Digital Logic Families
Definition: IC digital logic families consist of groups of related logic gates packaged in a single integrated circuit. They offer various characteristics such as speed, power consumption, and voltage levels.
Common Logic Families:
- TTL (Transistor-Transistor Logic):
- Characteristics:
- Fast switching speed.
- Moderate power consumption.
- Voltage levels: typically 5V.
- Example ICs: 74xx series (e.g., 7400 for NAND gates).
- Characteristics:
- CMOS (Complementary Metal-Oxide-Semiconductor):
- Characteristics:
- Low power consumption.
- High noise immunity.
- Wide range of supply voltages (typically 3V to 15V).
- Example ICs: 74HCxx series (e.g., 74HC00 for NAND gates).
- Characteristics:
- MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor):
- Characteristics:
- Used in high-speed applications.
- Power-efficient, especially in low-power applications.
- Example ICs: Various series for specific applications.
- Characteristics:
- BiCMOS (Bipolar CMOS):
- Characteristics:
- Combines the strengths of both bipolar and CMOS technologies.
- Higher speed than standard CMOS with lower power than TTL.
- Example ICs: 74BCxx series.
- Characteristics:
2.4. Universal gates (NAND and NOR gates), other gates (XOR, XNOR gates)
Universal Gates
Definition: Universal gates are logic gates that can be used to create any other type of gate or logic circuit. The two primary universal gates are NAND and NOR.
1. NAND Gate
- Symbol:
css
A ----|¬|---- Output
|&|
B ----| |
- Function: The output is false (0) only when both inputs are true (1).
- Truth Table:
A | B | Output (A NAND B) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
- Properties:
- NAND gates can be used to construct any Boolean function, including AND, OR, and NOT gates.
2. NOR Gate
- Symbol:
css
A ----|¬|---- Output
|≥1|
B ----| |
- Function: The output is true (1) only when both inputs are false (0).
- Truth Table:
A | B | Output (A NOR B) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
- Properties:
- NOR gates can also create any Boolean function, including AND, OR, and NOT gates.
Other Gates
1. XOR Gate (Exclusive OR)
- Symbol:
css
A ----|⊕|---- Output
B ----| |
- Function: The output is true (1) if exactly one of the inputs is true (1).
- Truth Table:
A | B | Output (A XOR B) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
2. XNOR Gate (Exclusive NOR)
- Symbol:
css
A ----|≡|---- Output
B ----| |
- Function: The output is true (1) if both inputs are the same (either both true or both false).
- Truth Table:
A | B | Output (A XNOR B) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
2.5. Boolean identities, De Morgan Laws.
Boolean Identities
Boolean identities are fundamental rules that hold true for Boolean algebra and can be used to simplify and manipulate Boolean expressions. Here are some key identities:
- Identity Law:
- A+0=AA + 0 = A
- A⋅1=AA \cdot 1 = A
- Null Law:
- A+1=1A + 1 = 1
- A⋅0=0A \cdot 0 = 0
- Idempotent Law:
- A+A=AA + A = A
- A⋅A=AA \cdot A = A
- Complement Law:
- A+¬A=1A + \neg A = 1
- A⋅¬A=0A \cdot \neg A = 0
- Double Negation Law:
- ¬(¬A)=A\neg(\neg A) = A
- Distributive Law:
- A⋅(B+C)=(A⋅B)+(A⋅C)A \cdot (B + C) = (A \cdot B) + (A \cdot C)
- A+(B⋅C)=(A+B)⋅(A+C)A + (B \cdot C) = (A + B) \cdot (A + C)
- Absorption Law:
- A+(A⋅B)=AA + (A \cdot B) = A
- A⋅(A+B)=AA \cdot (A + B) = A
De Morgan’s Laws
De Morgan’s Laws are two transformation rules that relate conjunctions (AND operations) and disjunctions (OR operations) through negation. They are essential for simplifying Boolean expressions and are stated as follows:
- First Law:
- ¬(A⋅B)=¬A+¬B\neg (A \cdot B) = \neg A + \neg B
- This means that the negation of a conjunction is equivalent to the disjunction of the negations.
- Second Law:
- ¬(A+B)=¬A⋅¬B\neg (A + B) = \neg A \cdot \neg B
- This means that the negation of a disjunction is equivalent to the conjunction of the negations.
Applications of Boolean Identities and De Morgan’s Laws
- Simplification: These laws and identities are used to simplify complex Boolean expressions, making them easier to implement in digital circuits.
- Circuit Design: They help in the design of logic circuits by reducing the number of gates required, leading to more efficient designs.
- Proofs: Boolean identities and De Morgan’s Laws are frequently used in proofs and derivations in digital logic design.