Logic Families, Flip-Flops, Shift Registers, Counters, DAC/ADC, and Digital Memories β the questions that come up most in VLSI, embedded systems, and hardware design interviews.
In a CMOS gate, PMOS and NMOS transistors always work as complementary pairs. In every stable logic state, one transistor of each complementary pair is cut off β there is no DC current path from V_DD to ground. Power is only consumed when switching (P = CΒ·VΒ²Β·f).
In a TTL totem-pole output, Tβ (upper transistor) is actively driving HIGH and Tβ (lower transistor) is actively driving LOW. If two gates with opposite output states are connected:
Solutions:
Propagation delay (t_pd) is measured from when the input crosses 50% of its swing to when the output crosses 50% of its swing. Two parameters:
What it limits: The longest combinational path between two flip-flops (the critical path) determines maximum clock frequency: f_max = 1 / (t_setup + t_pd_FF + t_comb_path). In VLSI, Static Timing Analysis (STA) finds this critical path and reports setup/hold violations.
The ECL gate is a differential amplifier. A reference transistor biased at β1.29V competes with the input transistors. When an input exceeds the reference, current shifts from the reference branch to the input branch. Transistors switch between cutoff and active regions β never entering saturation:
Trade-offs: ~300mW per gate, negative supply (β5.2V), very low noise margin (~0.2V), difficult PCB design (50Ξ© transmission lines needed). Used in mainframes, high-speed networking, and radar where 1ns speed is worth any power cost.
Metastability: When timing is violated, the FF can enter a metastable state β neither a valid 0 nor 1. The output may oscillate or settle to an arbitrary value after an unpredictable time. This is the fundamental problem in clock-domain crossing (CDC) circuits.
The JK flip-flop adds Q and QΜ feedback to the AND gates of the clocked RS latch:
PRESET (PREΜ ) and CLEAR (CLRΜ ) are asynchronous inputs β they operate independently of the clock:
Power-on initialisation: When power is applied, all flip-flop Q outputs are undefined. A brief initialisation pulse on CLRΜ (or PREΜ ) resets every FF to a known state before the system clock begins. This is why every real flip-flop in an FPGA or ASIC has an async reset β RTL designers use it to define the power-on state in the reset block.
JK β D flip-flop: D FF characteristic: Q(n+1) = D. From JK excitation table, we need J=D and K=DΜ. Connect J directly to D, and K through a NOT gate to D. Simple β 1 NOT gate added.
JK β T flip-flop: T FF characteristic: Q(n+1) = TβQ. When T=1, toggle; when T=0, hold. From JK table: toggle when J=K=1, hold when J=K=0. So simply wire J=T and K=T β connect both inputs together. Zero extra gates.
Connect these as AND/NOT gates feeding the JK inputs of the three flip-flops. All FFs share the common clock.
In an asynchronous FIFO, the write pointer runs in the write clock domain; the read pointer comparison must happen in the read clock domain (and vice versa for full/empty detection). Passing a multi-bit binary counter across a clock domain means all changing bits are subject to metastability simultaneously:
This is a fundamental VLSI design rule: always use Gray code counters for FIFO pointers that cross clock domain boundaries. The Gray counter is synthesised as a binary counter with a Gray converter (XOR tree).
For an n-bit weighted resistor DAC, resistors span R to 2^(n-1)Β·R β a range of 512 for 10-bit. Maintaining this ratio accurately across process, voltage, and temperature (PVT) variation is impractical. Resistors at opposite ends of this range are physically very different and drift differently.
R-2R requires only R and 2R. In VLSI, both are laid out as multiples of a unit resistor in a matched array β they track each other through all PVT variations because:
The Nyquist-Shannon sampling theorem: to perfectly reconstruct a continuous-time signal, the sampling rate f_s must be at least 2 Γ f_max (the highest frequency component in the signal).
Aliasing: If f_s < 2Β·f_max, high-frequency components fold back into the baseband and appear as spurious low-frequency signals. Example: a 9 kHz signal sampled at 16 kHz appears as a 7 kHz alias (16 β 9 = 7 kHz).
Solution: Place an anti-aliasing filter (low-pass) before the ADC to band-limit the input to f_s/2. In practice, use f_s = 2.5 to 3Γ f_max to allow for a realizable filter roll-off.
The memory hierarchy exploits two types of locality in typical programs:
Hierarchy (fastest/smallest to slowest/largest): Registers (~1 cycle) β L1 SRAM cache (3β5 cycles) β L2/L3 SRAM cache (10β40 cycles) β DRAM main memory (~200 cycles) β Flash/SSD (~100,000 cycles) β Hard disk (~10,000,000 cycles).