Real interview questions on Number Systems, Boolean Algebra, K-Maps, and Combinational Circuits β with model answers written the way you’d actually say them in an interview.
At the physical level, a transistor is a switch β it is either conducting (logic 1) or not conducting (logic 0). Representing decimal would require ten distinguishable voltage levels from a device that naturally wants to snap between two states. Noise, temperature variation, and process variation would make those intermediate levels ambiguous and unreliable. Binary maps perfectly onto transistor physics: high voltage = 1, low voltage = 0, with a large noise margin between them.
1010 1111 = 0xAF.2’s complement represents negative numbers by inverting all bits of the positive value and adding 1. The key advantages:
The repeated-multiplication-by-2 algorithm:
Verify: 0.101β = 1Γ2β»ΒΉ + 0Γ2β»Β² + 1Γ2β»Β³ = 0.5 + 0 + 0.125 = 0.625 β
0.1 + 0.2 == 0.3 can fail.Overflow occurs when two numbers of the same sign are added and the result has the opposite sign. Detection: carry into MSB β carry out of MSB.
Gray code (also called reflected binary code) has the property that adjacent code words differ by exactly one bit. This is critical in two situations:
XS-3 encodes digit d as BCD(d) + 3. The 9’s complement of d is (9βd). In XS-3: the code for (9βd) = BCD(9βd)+3 = (9βd+3) = (12βd). In 4 bits: (15βd) = NOT(d+3)+1… but more elegantly, the 1’s complement (bit-flip) of XS-3(d) equals XS-3(9βd). This means to compute the 9’s complement of a decimal digit in XS-3, you simply invert all bits β no addition circuit needed. This makes BCD subtraction in XS-3 very hardware-efficient.
The Hamming condition for single-error correction: 2^r β₯ r + m + 1, where r = parity bits, m = data bits.
Parity bits are placed at positions 1, 2, 4, 8 (powers of 2). Each covers the set of bit positions where its positional bit is 1 in the binary index.
Practical use: NAND gates are universal. Any AND-OR SOP circuit can be converted to a two-level NAND-NAND circuit using De Morgan’s: replace each AND gate with a NAND, then each OR gate with a NAND (since NAND(Δ,BΜ) = NOT(ΔΒ·BΜ) = A+B by De Morgan). This saves chip area because NAND gates are typically faster and smaller than AND or OR gates in CMOS.
Since AND, OR, and NOT are functionally complete, and all three can be built from NAND alone, NAND is universal. Same argument applies for NOR. This matters in practice because fab processes are optimised for one gate topology β TTL chips used NAND-heavy designs; CMOS uses a mix but NAND is still preferred (fewer transistors than NOR for equivalent logic).
Sum of Products (SOP): F = AB + CD + A’B’C β each term is a minterm or implicant. A 1 in the truth table contributes a term. Maps directly to AND-OR or NAND-NAND two-level logic.
Product of Sums (POS): F = (A+B)(C+D)(A’+B’+C’) β each factor is a maxterm. A 0 in the truth table contributes a factor. Maps to OR-AND or NOR-NOR two-level logic.
When to choose: If the function has more 1s than 0s in the truth table, K-map 0-grouping (POS) gives fewer terms. If more 0s, SOP from 1-grouping wins. In VLSI, NOR-NOR is rarely used because NOR gates in CMOS require P-type transistors in series, which is slower β NAND-NAND (SOP) is almost always preferred.
The Karnaugh map arranges minterms in a 2D grid using Gray code ordering on both axes. Adjacent cells differ in exactly one variable. When you group adjacent 1s, the differing variable cancels out algebraically (A+A’ = 1), giving a simpler product term. The rules:
Don’t-care conditions (marked X or d) arise when certain input combinations are guaranteed never to occur (e.g. illegal BCD codes 1010β1111) or when we truly don’t care about the output. Strategy: treat don’t-cares as 1s where they help form a larger group, and as 0s everywhere else.
The risk: If you assume a combination never occurs but your circuit receives it (due to a fault, power-on transient, or design error), the output is unpredictable. In safety-critical designs, don’t-cares are often explicitly driven to a known safe value rather than left truly undefined.
Quine-McCluskey is a tabular minimisation algorithm that finds all prime implicants systematically. It works by:
K-map vs Q-M: K-map works visually for up to 5β6 variables. Q-M scales to any number of variables and is directly implementable as a computer algorithm β this is what early EDA synthesis tools used. Modern tools use more advanced algorithms (ESPRESSO heuristic), but Q-M is the foundation.
A CPU’s ALU uses a chain of full adders (ripple-carry or carry-lookahead). The LSB stage can be a half adder (Cin = 0) and all subsequent stages are full adders. In practice, VLSI CPUs use carry-lookahead adders (CLA) or Kogge-Stone adders to avoid the O(n) ripple delay.
The circuit uses B XOR SUB for each bit and connects SUB to carry-in (Cβ):
This is the core of every ALU β one adder circuit handles both operations. The XOR gate acts as a programmable inverter: A XOR 0 = A (pass through), A XOR 1 = A' (invert).
A standard 4-bit binary adder can produce results from 0 to 15 (0000 to 1111). BCD only allows 0000 to 1001 (0β9). When the sum falls in the illegal range 1010β1111 (10β15), correction is needed:
Correction detect logic: X = Sβ + SβΒ·Sβ + SβΒ·Sβ, where SβSβSβSβSβ is the 5-bit binary sum. X = 1 means correction is needed.
Connect the n input variables to the select lines. For each of the 2^n combinations, the corresponding data input Xα΅’ is set to the function’s output value for that combination:
Reduced MUX method: Use a 2^(n-1):1 MUX for an n-variable function by assigning the MSB variable to the data inputs (each input can be 0, 1, MSB, or MSB’). This halves the MUX size. In VLSI/FPGAs, this is exactly what a LUT (Look-Up Table) does β a 4-input LUT is a 16:1 MUX with its inputs hardwired to implement any 4-variable function.
The MSB (Aβ) selects which decoder is active:
When Aβ=0: Decoder 1 is enabled and outputs YββYβ based on AβAβAβ. Decoder 2 is disabled (all outputs 0). When Aβ=1: Decoder 2 is enabled and outputs YββYββ . This extends to larger decoders recursively β 5-to-32 from two 4-to-16, etc.
A static-1 hazard occurs when the output should remain at 1 but glitches to 0 momentarily during a transition. It happens when two adjacent K-map groups have a gap β as the circuit switches from one prime implicant to another, neither is momentarily asserting the output.
Fix: Add the consensus term β a redundant prime implicant that bridges the gap between the two groups. This overlapping term keeps the output high during the transition.
Dynamic hazard: Output changes more than once when it should change exactly once. Occurs in multi-level circuits. Fix: reduce to two-level logic.