Digital electronics viva and interview questions
These are the questions examiners and interviewers ask most often in digital electronics, with short answers you can say out loud, from number systems and logic gates to flip-flops, counters and memory. Each answer links to a live circuit or tool on this site, so you can check it by clicking the inputs rather than memorising it.
Number systems and codes · Logic gates · Boolean algebra · Combinational circuits · Sequential circuits · Memory and logic families
Number systems and codes
What is the difference between an analog and a digital signal?
An analog signal can take any value in a range and changes smoothly, like a microphone voltage. A digital signal uses a small set of levels, usually two, read as 0 and 1, so small noise does not change its meaning. Live: analog vs digital.
Why do digital systems use binary?
Two levels are the easiest to make and to tell apart reliably: a transistor is either on or off, and a wide noise margin separates a valid 0 from a valid 1. Live: binary numbers.
What is two's complement and why is it used?
To negate a number, invert every bit and add 1. Computers use it because the same adder then handles positive and negative numbers, and there is only one zero. Live: two's complement calculator.
What is BCD?
Binary-coded decimal writes each decimal digit as its own 4-bit binary number: 47 is 0100 0111. It wastes 6 of the 16 patterns per digit but makes decimal display easy. Live: types of binary codes.
What is Gray code and where is it used?
A code in which consecutive values differ in exactly one bit. It is used in rotary encoders and to pass counters between clock domains, so a value caught mid-change is never far wrong. Live: Gray code converter.
What are a bit, a nibble and a byte?
A bit is one binary digit, a nibble is 4 bits and a byte is 8 bits. Live: bit vs byte.
Logic gates
What are universal gates?
NAND and NOR. Each one alone can build NOT, AND and OR, and therefore any logic function. Live: NOT, AND and OR from NAND gates.
Which gate is called a controlled inverter?
XOR: A XOR 0 = A and A XOR 1 = NOT A, so one input decides whether the other is inverted. It is also the sum bit of an adder and the core of parity circuits. Live: XOR gate.
Which gate gives 1 only when its inputs are equal?
XNOR, the equality gate. It is XOR followed by NOT. Live: XNOR gate.
How many NAND gates are needed for an XOR gate?
Four. The first NAND of A and B is shared by the two middle gates, and a last NAND combines them. Live: XOR from four NAND gates.
What are positive and negative logic?
In positive logic the high voltage means 1; in negative logic it means 0. The same circuit can be read either way: a positive-logic AND gate is a negative-logic OR gate. Live: active high vs active low.
Boolean algebra
State De Morgan's theorems.
(A + B)' = A' B' and (A B)' = A' + B'. The complement of a sum is the product of the complements, and the complement of a product is the sum of the complements. Live: De Morgan's theorem.
What is a Karnaugh map and why is it used?
A grid of a function's truth table arranged in Gray code order, so adjacent cells differ in one variable. Grouping adjacent 1s in powers of two gives the minimal sum of products without algebra. Live: Karnaugh map solver.
What are SOP and POS forms?
Sum of products is an OR of AND terms, read from the rows where the function is 1. Product of sums is an AND of OR terms, read from the rows where it is 0. Live: SOP vs POS.
What are minterms and maxterms?
A minterm is an AND of all variables that is 1 for exactly one input row; a maxterm is an OR of all variables that is 0 for exactly one row. Live: truth table to expression converter.
What is a don't-care condition?
An input combination that never occurs or whose output does not matter. In a K-map it can be treated as 0 or 1, whichever gives the larger groups. Live: K-map with don't cares.
Combinational circuits
What is the difference between combinational and sequential circuits?
A combinational circuit's output depends only on its present inputs. A sequential circuit also depends on stored state, so it contains memory, usually flip-flops on a clock. Live: combinational vs sequential.
What is the difference between a half adder and a full adder?
A half adder adds two bits; a full adder adds three, including a carry-in, so full adders can be chained into multi-bit adders. Live: half adder vs full adder.
Why is a multiplexer called a data selector?
Its select lines choose which one of several data inputs is passed to the single output. Live: 4-to-1 multiplexer.
What is the difference between a decoder and a demultiplexer?
A decoder turns an n-bit code into one active output out of 2^n. A demultiplexer sends one data input to the selected output. A decoder with an enable input works as a demultiplexer when the enable carries the data. Live: 1-to-4 demultiplexer.
What is a priority encoder?
An encoder that outputs the number of the highest-priority active input when several are active at once, plus a valid bit for when none is. Live: priority encoder.
Why is a carry look-ahead adder faster than a ripple-carry adder?
A ripple-carry adder waits for each carry to pass through every stage. A look-ahead adder computes all carries at once from generate (AB) and propagate (A XOR B) signals. Live: carry look-ahead adder.
What is a hazard in a logic circuit?
A short unwanted pulse (glitch) at an output while inputs change, caused by unequal path delays. A static-1 hazard is removed by adding the consensus term to the sum of products. Live: hazards.
Sequential circuits
What is the difference between a latch and a flip-flop?
A latch is level-sensitive: its output follows the input while it is enabled. A flip-flop is edge-triggered: it takes the input only at a clock edge. Live: D latch vs D flip-flop.
What is the race-around condition?
In a level-triggered JK latch with J = K = 1, the output keeps toggling for as long as the clock is high. It is avoided with a master-slave or edge-triggered flip-flop. Live: race-around condition.
Why is the JK flip-flop called a universal flip-flop?
With simple input connections it behaves as an SR, D or T flip-flop, and J = K = 1 toggles instead of being forbidden. Live: JK flip-flop.
What is a T flip-flop used for?
Counting and frequency division: with T = 1 it toggles on every clock edge, dividing the clock frequency by two. Live: T flip-flop.
What are setup time and hold time?
Setup time is how long the input must be stable before the clock edge; hold time is how long it must stay stable after it. Violating either can make the flip-flop metastable. Live: timing.
What is metastability?
A state in which a flip-flop's output hangs between 0 and 1 for a while because its input changed too close to the clock edge. Synchronizers of two flip-flops make it unlikely to spread. Live: metastability.
What is the difference between a synchronous and an asynchronous counter?
In a synchronous counter all flip-flops share one clock. In an asynchronous (ripple) counter each flip-flop is clocked by the one before, so the outputs change one after another. Live: ripple counter.
How many flip-flops does a mod-N counter need?
The smallest n with 2^n at least N: a mod-6 or mod-8 counter needs 3, a mod-10 counter needs 4. Live: mod-6 counter from JK flip-flops.
What are the types of shift registers?
Serial in serial out (SISO), serial in parallel out (SIPO), parallel in serial out (PISO) and parallel in parallel out (PIPO), plus bidirectional and universal shift registers. Live: shift register.
What is the difference between a ring counter and a Johnson counter?
A ring counter circulates a single 1 and has n states for n flip-flops. A Johnson counter feeds back the complement of the last stage and has 2n states. Live: ring and Johnson counter.
What is the difference between Moore and Mealy machines?
A Moore machine's outputs depend only on its state; a Mealy machine's outputs depend on its state and its current inputs, so it can react one clock earlier. Live: Moore vs Mealy.
Memory and logic families
What is the difference between RAM and ROM?
RAM can be read and written and loses its contents without power. ROM is read-only (or rarely written) and keeps its contents. Live: ROM vs RAM.
What is the difference between SRAM and DRAM?
SRAM stores each bit in a latch of about six transistors, so it is fast and needs no refresh. DRAM stores each bit as charge on a capacitor with one transistor, so it is denser but must be refreshed. Live: SRAM vs DRAM.
What is the difference between PAL and PLA?
A PLA has a programmable AND array and a programmable OR array. A PAL programs only the AND array and has a fixed OR array. Live: PAL vs PLA.
What is an FPGA?
A chip of look-up tables, flip-flops and programmable routing that is configured with a bitstream to become a custom digital circuit, and can be reconfigured. Live: FPGA vs ASIC.
What is the difference between TTL and CMOS?
TTL is built from bipolar transistors; CMOS from complementary MOSFETs. CMOS draws almost no current when it is not switching, so it uses far less power and dominates modern chips. Live: TTL vs CMOS.
What is a tri-state buffer?
A buffer with a third output state, high impedance, in which it is disconnected. It lets several devices share one bus line. Live: tri-state buffer.
What are fan-out and propagation delay?
Fan-out is how many gate inputs one output can drive while keeping valid logic levels. Propagation delay is the time from an input change to the resulting output change. Live: timing.
Practise
Test yourself with the logic gates practice quiz and the Boolean algebra practice, or build the circuits yourself in the lab, where the course goes from transistors to a working CPU.