Digital Logic
Digital Logic is the branch of electronics and computer science concerned with the design and analysis of digital circuits.
Digital circuits are made up of basic building blocks called Logic Gates.
Logic gates process binary signals:
- 0
- 1
according to predefined logical rules.
Common logical operations include:
- AND
- OR
- NOT
- NAND
- NOR
- XOR
- XNOR
Digital logic is fundamental to the operation of:
- Digital computers
- Digital electronic devices
- Digital systems
Digital signals are represented using Binary Digits (Bits).
Each bit can exist in one of two states:
0 or 1
Main Components of Digital Logic
The main components of digital logic are:
- Logic Gates
- Combinational Logic
- Sequential Logic
- Boolean Algebra
1. Logic Gates
Logic Gates are the basic building blocks of digital circuits.
They perform logical operations on one or more binary inputs to produce a single binary output.
2. Combinational Logic
Combinational Logic Circuits produce output based only on the current input values.
They do not remember previous inputs.
Examples include:
- Adders
- Multiplexers
- Decoders
3. Sequential Logic
Sequential Logic Circuits contain memory elements such as flip-flops.
These circuits can store information about previous inputs.
Therefore, their output may depend on:
- Current inputs
- Previous inputs
Examples include:
- Registers
- Counters
- Finite State Machines
4. Boolean Algebra
Boolean Algebra is a mathematical system used to analyze and simplify digital logic circuits.
It deals with logical operations such as:
- AND
- OR
- NOT
It also includes laws and theorems such as:
- De Morgan’s Theorem
- Distributive Law
Types of Logic Gates
Logic gates can be classified into:
- Basic Gates
- Exclusive Gates
- Universal Gates
Basic Gates
The basic gates discussed in the notes are:
- AND Gate
- OR Gate
- NOT Gate
1. AND Gate
An AND Gate produces a high output only when all of its inputs are high.
If any input is low, the output becomes low.
AND operation is also referred to as Logical Multiplication.
For two inputs:
A · B
The output is 1 only when:
A = 1 and B = 1
AND Gate Truth Table
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Figure: Add AND Gate symbol here.
2. OR Gate
An OR Gate produces a high output if:
- Any one input is high, or
- All inputs are high
If all inputs are low, the output is low.
OR operation is also referred to as Digital Addition.
For two inputs:
A + B
OR Gate Truth Table
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Figure: Add OR Gate symbol here.
3. NOT Gate
A NOT Gate produces the inverted output of its input.
This means:
- Input 0 → Output 1
- Input 1 → Output 0
It is also known as an Inverter Gate.
The Boolean expression is:
Y = A′
NOT Gate Truth Table
| A | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
Figure: Add NOT Gate symbol here.
Exclusive Gates
There are two exclusive gates:
- XOR Gate
- XNOR Gate
These gates are derived from the OR operation.
1. XOR Gate
XOR stands for Exclusive OR.
An XOR gate has two or more inputs and one output.
The output is high when an odd number of inputs are high.
For two inputs, the output is high when the inputs are different.
Its symbol is:
⊕
The Boolean expression is:
A ⊕ B = (A′ · B) + (A · B′)
XOR Gate Truth Table
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Figure: Add XOR Gate symbol here.
2. XNOR Gate
XNOR stands for Exclusive NOR.
An XNOR gate produces a high output only when both inputs are the same.
This means the output is high when:
- Both inputs are 0
- Both inputs are 1
If the inputs are different, the output is low.
XNOR is the inverted form of XOR.
Its symbol is:
⊙
The Boolean expression is:
A ⊙ B = (A · B) + (A′ · B′)
XNOR Gate Truth Table
| A | B | A ⊙ B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Figure: Add XNOR Gate symbol here.
Universal Gates
Universal Gates are logic gates that can be used to implement other types of logic gates.
The two main universal gates are:
- NAND Gate
- NOR Gate
1. NAND Gate
NAND stands for NOT-AND.
A NAND gate has two or more inputs and one output.
It produces a low output only when all inputs are high.
Otherwise, it produces a high output.
The Boolean expression is:
Y = (A · B)′
NAND Gate Truth Table
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Figure: Add NAND Gate symbol here.
2. NOR Gate
NOR stands for NOT-OR.
A NOR gate produces a high output only when all of its inputs are low.
Otherwise, it produces a low output.
The Boolean expression is:
Y = (A + B)′
NOR Gate Truth Table
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Figure: Add NOR Gate symbol here.
De Morgan’s Law
De Morgan’s Laws are important laws used in Boolean algebra for simplifying logical expressions.
The notes discuss two laws:
- First Law
- Second Law
1. De Morgan’s First Law
According to the provided notes, De Morgan’s First Law states that the complement of the sum of two binary variables is equal to the product of their complements.
It can be represented as:
(A + B)′ = A′ · B′
Truth Table
Figure: Add truth table for De Morgan’s First Law here.
Diagram: Add De Morgan’s First Law logic diagram here.
2. De Morgan’s Second Law
According to the provided notes, De Morgan’s Second Law states that the complement of the product of two binary variables is equal to the sum of their complements.
It can be represented as:
(A · B)′ = A′ + B′
Truth Table
Figure: Add truth table for De Morgan’s Second Law here.
Diagram: Add De Morgan’s Second Law logic diagram here.
Realization of Gates Using NAND Universal Gate
Since NAND is a universal gate, other logic gates can be constructed using only NAND gates.
The notes include the realization of:
- OR Gate using NAND Gate
- NOT Gate using NAND Gate
- AND Gate using NAND Gate
- NOR Gate using NAND Gate
- XOR Gate using NAND Gate
- XNOR Gate using NAND Gate
1. OR Gate Using NAND Gate
An OR gate can be implemented using NAND gates.
Figure: Add OR Gate realization using NAND Gates here.
2. NOT Gate Using NAND Gate
A NOT gate can be implemented by connecting both inputs of a NAND gate together.
Figure: Add NOT Gate realization using NAND Gate here.
3. AND Gate Using NAND Gate
An AND gate can be implemented using multiple NAND gates.
Figure: Add AND Gate realization using NAND Gates here.
4. NOR Gate Using NAND Gate
A NOR gate can also be implemented using only NAND gates.
Figure: Add NOR Gate realization using NAND Gates here.
5. XOR Gate Using NAND Gate
An XOR gate can be constructed using NAND gates.
Figure: Add XOR Gate realization using NAND Gates here.
6. XNOR Gate Using NAND Gate
An XNOR gate can also be constructed using NAND gates.
Figure: Add XNOR Gate realization using NAND Gates here.
Realization of Gates Using NOR Universal Gate
Since NOR is also a universal gate, other gates can be implemented using only NOR gates.
The notes include:
- OR Gate using NOR Gate
- AND Gate using NOR Gate
- NAND Gate using NOR Gate
- NOT Gate using NOR Gate
- XOR Gate using NOR Gate
- XNOR Gate using NOR Gate
1. OR Gate Using NOR Gate
An OR gate can be implemented using NOR gates.
Figure: Add OR Gate realization using NOR Gates here.
2. AND Gate Using NOR Gate
An AND gate can be implemented using only NOR gates.
Figure: Add AND Gate realization using NOR Gates here.
3. NAND Gate Using NOR Gate
A NAND gate can be constructed using NOR gates.
Figure: Add NAND Gate realization using NOR Gates here.
4. NOT Gate Using NOR Gate
A NOT gate can be implemented by connecting the inputs of a NOR gate together.
Figure: Add NOT Gate realization using NOR Gate here.
5. XOR Gate Using NOR Gate
An XOR gate can be implemented using NOR gates.
Figure: Add XOR Gate realization using NOR Gates here.
6. XNOR Gate Using NOR Gate
An XNOR gate can also be implemented using NOR gates.
Figure: Add XNOR Gate realization using NOR Gates here.
Discussion
Share a helpful question, idea, or explanation with other students.