# Boolean Minimization, K-Maps, Multiplexers & Sequential Flip-Flop Counters
Exam: GATE Computer Science & Information Technology (GATE CS)
Subject: Digital Logic
Canonical URL: https://gateandnet.com/exams/gate-cs/digital-logic/kmap-combinational-mux-and-flip-flops

> Universal NAND/NOR gate counts, Prime vs Essential Prime Implicants in 4-variable K-Maps, MUX universal logic realization, and JK/D/T Flip-Flop synchronous & ripple counters.

## 1. Universal Gate Counts & Consensus Theorem

The **Consensus Theorem** eliminates redundant terms without drawing a K-Map:

$$
AB + \overline{A}C + BC = AB + \overline{A}C
$$

| Target Gate / Function | Min 2-Input NAND Gates | Min 2-Input NOR Gates |
| :--- | :--- | :--- |
| **NOT ($\overline{A}$)** | 1 | 1 |
| **AND ($AB$)** | 2 | 3 |
| **OR ($A + B$)** | 3 | 2 |
| **XOR ($A \oplus B$)** | **4** | **5** |
| **XNOR ($A \odot B$)** | **5** | **4** |
| **Half Adder** | 5 | 5 |
| **Full Adder** | **9** | **9** |

## 2. K-Map Implicants & Combinational MUX Realization

- **Prime Implicant (PI):** Largest possible power-of-2 group ($1, 2, 4, 8, 16$) of 1s (and optional Don’t Cares `X`) not contained inside any larger valid group.
- **Essential Prime Implicant (EPI):** A PI covering at least one true minterm (`1`, **never** a Don’t Care `X`) that no other PI covers.
- **Universal $2^{n-1} \times 1$ MUX:** Any $n$-variable Boolean function can be implemented using a single $2^{n-1} \times 1$ Multiplexer plus at most one inverter (and zero extra gates if both polarities of the $n$-th variable are available!).

## 3. Flip-Flop Excitation Tables & Counters

| Flip-Flop | Characteristic Equation $Q(t+1)$ | Key Exam Behavior |
| :--- | :--- | :--- |
| **SR** | $S + \overline{R}Q$ (with $SR = 0$) | $S = R = 1$ is invalid/forbidden |
| **JK** | $J\overline{Q} + \overline{K}Q$ | $J = K = 1$ toggles; level-triggered suffers **Race-Around** when $t_p > t_{pd}$, cured by **Master-Slave** or edge triggering |
| **D** | $D$ | Transparent delay element; $Q^+ = D$ |
| **T** | $T \oplus Q$ | Frequency divider ($f / 2$) when $T = 1$ |

> [!FORMULA]
> **Mod-$N$ Counter:** Requires $n = \lceil \log_2 N \rceil$ flip-flops and divides input clock frequency by $N$ ($f_{\text{out}} = f_{\text{clk}} / N$). Ring counter with $n$ FFs is Mod-$n$; **Johnson (Twisted Ring) counter** with $n$ FFs is **Mod-$2n$**!

## Solved Practice Questions & PYQs

### [GATE CS Digital Logic | MCQ]
What is the **minimum number of 2-input NAND gates** required to implement a 2-input **XOR** function $Y = A \oplus B$ without complemented inputs?
**Correct Answer:** B
**Solution:** Using $G_1 = \overline{A \cdot B}$, $G_2 = \overline{A \cdot G_1}$, $G_3 = \overline{B \cdot G_1}$, and $Y = \overline{G_2 \cdot G_3} = A\overline{B} + \overline{A}B$, exactly **4** two-input NAND gates realize $A \oplus B$ (whereas 2-input NOR requires 5 gates).

### [GATE CS Digital Logic | MCQ]
A **4-bit Johnson (Twisted-Ring) Counter** is driven by a $24\text{ MHz}$ clock signal. What is the output frequency at any flip-flop output $Q_i$?
**Correct Answer:** B
**Solution:** An $n$-bit **Johnson Counter** cycles through $2n$ distinct states (Mod-$2n$). For $n = 4$, modulus $= 2 \times 4 = 8$, so $f_{\text{out}} = \frac{24\text{ MHz}}{8} = \mathbf{3\text{ MHz}}$.

### [GATE CS Digital Logic | MCQ]
Simplify the Boolean expression $F(A, B, C) = AB + \overline{A}C + BC$ to its minimal Sum-of-Products (SOP) form:
**Correct Answer:** B
**Solution:** By the **Consensus Theorem**, $BC = B C (A + \overline{A}) = ABC + \overline{A}BC$ is completely absorbed by $AB$ and $\overline{A}C$, simplifying directly to **$AB + \overline{A}C$**.
