Computer ScienceChapter 1: Computer Systems
1.3 Digital Logic and Logic Gates
Logic gates are the building blocks of digital circuits.
Explanation level
Digital logic is fundamental in creating electronic devices such as calculators, computers, and digital watches. It is used to create digital circuits, which consist of a large number of logic gates.
Main Idea
Logic gates are the building blocks of digital circuits. A logic gate performs a particular logical function. It has two or more logic inputs (LOW or HIGH) and produces a single output which may be LOW (0) or HIGH (1), determined by the logic levels present at the inputs.
Core Concept
What is Digital Logic? Digital logic is fundamental in creating electronic devices such as calculators, computers, and digital watches. It is used to create digital circuits. Digital circuits consist of a large number of logic gates. What is a Logic Gate? Logic gates are the building blocks of digital circuits. A logic gate performs a particular logical function. A logic gate has two or more logic inputs (LOW or HIGH). It produces a single output which may be LOW (0) or HIGH (1). The output is determined by the logic levels present at the inputs.
Detailed Explanation
Commonly Used Logic Gates The commonly used logic gates are: AND1. OR2. NAND3. NOR4. NOT5. Exclusive-OR6. Exclusive-NOR7. 1.3.1 Logic Gates and their Truth Tables AND Gate The AND gate operates such that the output will be at level 1 (HIGH) only when all inputs are 1 (HIGH). The mathematical expression for the two-input AND gate is written as F = xy. For a three-input gate, it would be F = xyz, and so on for more inputs. Truth Table for AND Gate (two variables): x y F 0 0 0 0 1 0
1 0 0 1 1 1 OR Gate The OR gate produces a 1 output when any input is 1. Its mathematical expression is F = x + y, where the + stands for the OR operation and not normal addition. For a three-input OR gate, it would be F = x + y + z, and so on. Truth Table for OR Gate (two variables): x y F 0 0 0 0 1 1 1 0 1 1 1 1 NAND Gate
NAND gate combines the AND and NOT gates, such that the output will be 0 only when all the inputs are 1. Its logic expression is F = x̄ ȳ (x AND y, then inverted). Inputs x and y are first ANDed and then the result is inverted. Inversion is indicated by a bar . A NAND gate always produces an output that is the inverse (opposite) of an AND gate. Truth Table for NAND Gate (two variables): x y F 0 0 1 0 1 1 1 0 1 1 1 0 NOR Gate NOR gate combines the OR and NOT gates, such that the output will be 0 when any input is 1. Its logic expression is F = x̄ +ȳ (x OR y, then inverted). Inputs x and y are first ORed and then the result is inverted. Inversion is indicated by a bar . A NOR gate always gives an output that is the inverse of an OR gate.
Truth Table for NOR Gate (two variables): x y F 0 0 1 0 1 0 1 0 0 1 1 0 NOT Gate NOT gate is a single input gate. It converts LOW to HIGH and vice versa. Therefore, it is commonly known as an inverter . Its logic expression is F = x̄ . The bar in the expression indicates the inversion operation. In the output of the graphical symbol, the small circle indicates inversion. Truth Table for NOT Gate: x F
0 1 1 0
Important Points
- Digital logic is fundamental in creating electronic devices like calculators, computers, and digital watches.
- Logic gates are the building blocks of digital circuits.
- A logic gate has two or more inputs and a single output.
- Inputs and outputs are LOW (0) or HIGH (1).
- AND gate: output is 1 only when all inputs are 1. Expression: F = xy.
- OR gate: output is 1 when any input is 1. Expression: F = x + y.
- NAND gate: output is 0 only when all inputs are 1. It is the inverse of AND. Expression: F = x̄ ȳ.
- NOR gate: output is 0 when any input is 1. It is the inverse of OR. Expression: F = x̄ +ȳ.
- NOT gate: single input gate, inverts the input. Also called an inverter . Expression: F = x̄ .
Remember
- AND all inputs 1 output 1.
- OR any input 1 output 1.
- NAND all inputs 1 output 0 (inverse of AND).
- NOR any input 1 output 0 (inverse of OR).
- NOT inverts the input (LOW to HIGH and vice versa).
- NOT is a single-input gate; all others discussed here have two or more inputs.
- The small circle at the output of a gate symbol indicates inversion.
Common Mistakes
- Confusing the + in OR gate expression with normal addition. In Boolean algebra, + stands for the OR operation.
- Forgetting that NAND is the inverse of AND, not the same as AND.
- Forgetting that NOR is the inverse of OR, not the same as OR.
- Thinking NOT gate has two inputs. NOT gate is a single input gate.
- Missing the inversion bar in NAND and NOR expressions.
- Mixing up NAND and NOR truth tables: NAND outputs 0 only when all inputs are 1; NOR outputs 0 when any input is 1.
Quick Revision
Digital logic is fundamental in creating electronic devices such as calculators, computers, and digital watches. It is used to create digital circuits, which consist of a large number of logic gates. Logic gates are the building blocks of digital circuits. A logic gate performs a particular logical function and has two or more logic inputs (LOW or HIGH) and produces a single output which may be LOW (0) or HIGH (1), determined by the logic levels present at the inputs. The commonly used logic gates are AND, OR, NAND, NOR, NOT, Exclusive-OR, and Exclusive-NOR. The AND gate outputs 1 only when all inputs are 1 (F = xy). The OR gate outputs 1 when any input is 1 (F = x + y). The NAND gate is the inverse of AND and outputs 0 only when all inputs are 1 (F = x̄ ȳ). The NOR gate is the inverse of OR and outputs 0 when any input is 1 (F = x̄ +ȳ). The NOT gate is a single input gate that inverts the input (F = x̄ ) and is commonly known as an inverter .
60-Second Revision
Digital logic digital circuits logic gates.
Logic gate: 2+ inputs, 1 output, LOW (0) or HIGH (1). AND: F = xy; output 1 only if all inputs 1. OR: F = x + y; output 1 if any input 1. NAND: inverse of AND; output 0 only if all inputs 1. NOR: inverse of OR; output 0 if any input 1. NOT: single input; inverts input; F = x̄ ; called inverter . Warning: + in Boolean expressions means OR, not addition. agla topic bta o
Did you understand this topic?
Your answer is saved with your learning record. It does not mark the topic as mastered.
Quick revision
Revision Zone
Review the key facts, formulas and checks before you move on.1.3 Digital Logic and Logic Gates
Sticky Notes · Quick Revision
Key Point 1
- Logic gates = building blocks of digital circuits.
Key Point 2
- Gate: 2+ inputs, 1 output; LOW (0) or HIGH (1).
Key Point 3
- AND: F = xy; output 1 only if all inputs 1.
Key Point 4
- OR: F = x + y; output 1 if any input 1.
Key Point 5
- NAND: F = x̄ ȳ; inverse of AND.
Key Point 6
- NOR: F = x̄ +ȳ; inverse of OR.
Key Point 7
- NOT: F = x̄ ; single input; also called inverter .
Key Point 8
- Bar over a variable or expression = inversion.
Key Point 9
- Small circle at output of symbol = inversion.
Same supplied content as this Notes page (shared canonical source).