Digital Logic · Unit 2
Boolean Algebra and Logic Gates
Exam-focused notes for Boolean Algebra and Logic Gates (Digital Logic, BIT103): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.
Boolean Algebra and Logic Gates in short
Boolean algebra is the mathematics of digital circuits. Every logic circuit can be written as a Boolean expression, and simplifying the expression gives a cheaper circuit with fewer gates.
What this unit covers
- Boolean theorems and De Morgan's laws
- Logic gates and universal gates
- NAND and NOR gate realization
- Exclusive-OR and exclusive-NOR gates
- Boolean function simplification
NAND and NOR gate realization
2080 · 5 marks
Why NAND and NOR gates are called Universal logic gates? Realize NOR as Universal logic gates. [5]
Boolean theorems and De Morgan's laws
Exclusive-OR and exclusive-NOR gates
2081.2 · 5 marks
Show that the dual of the exclusive-OR is equal to its complement. [5]
0 · 5 marks
Show that the dual of the exclusive-OR is equal to its complement. [5]
Logic gates and universal gates
2081.2 · 5 marks
Write short notes on (a) Universal gate. (b) Status register. [2.5+2.5]
Show solved answerHide answer
Short Notes
(a) Universal Gate
A universal gate is a logic gate that can be used to implement any Boolean function or any other logic gate (AND, OR, NOT, etc.) without needing any other type of gate.
The two universal gates are:
- NAND Gate
- NOR Gate
Why are they called Universal?
Because all basic gates can be realized using only NAND (or only NOR) gates:
Implementing Basic Gates using NAND:
| Gate | NAND Implementation |
|---|---|
| NOT A | A NAND A = $\overline{A}$ |
| A AND B | (A NAND B) NAND (A NAND B) |
| A OR B | (A NAND A) NAND (B NAND B) |
Implementing Basic Gates using NOR:
| Gate | NOR Implementation |
|---|---|
| NOT A | A NOR A = $\overline{A}$ |
| A OR B | (A NOR B) NOR (A NOR B) |
| A AND B | (A NOR A) NOR (B NOR B) |
Significance:
- Reduces the number of different gate types needed in circuit design.
- Simplifies manufacturing and reduces cost.
- NAND gates are widely used in digital IC design (e.g., TTL and CMOS families).
(b) Status Register (Flag Register)
A status register (also called a flag register or condition code register) is a special-purpose register in the CPU that holds individual flag bits reflecting the outcome of the most recently executed arithmetic or logical operation.
Common Flag Bits:
| Flag | Name | Description |
|---|---|---|
| Z | Zero Flag | Set to 1 if the result of an operation is zero |
| C | Carry Flag | Set to 1 if there is a carry out from the MSB (unsigned overflow) |
| S / N | Sign / Negative Flag | Set to 1 if the result is negative (MSB = 1) |
| V / OV | Overflow Flag | Set to 1 if signed arithmetic overflow occurs |
| P | Parity Flag | Set to 1 if the result has even parity |
| AC / H | Auxiliary Carry | Set if carry occurs from lower nibble to upper nibble (used in BCD) |
Importance:
- Used by conditional branch/jump instructions to make decisions (e.g.,
JZ,JC,JNZ). - Enables the CPU to perform conditional execution and loop control.
- It is automatically updated after arithmetic and logical operations.
Example:
If we compute 5 - 5 = 0:
- Zero flag Z = 1 (result is zero)
- Sign flag S = 0 (result is not negative)
The status register is a key component in program flow control within the CPU.
Make Unit 2 stick
Practice BIT103 with flashcards & quizzes