Skip to main content
@shmVirus

Digital Components

Build architectural storage and selection structures from integrated circuits, decoders, encoders, multiplexers, registers, shift registers, counters, and memory arrays.

Updated

Learning objectives

  • Relate gates, integrated-circuit families, and digital modules
  • Use decoders, encoders, multiplexers, and demultiplexers as selection circuits
  • Explain basic, parallel-load, shift, and bidirectional registers
  • Derive next-state behavior for a universal shift register and binary counter
  • Determine memory capacity and required address and data lines

Prerequisites

  • Computer Organization
  • Boolean functions, truth tables, and flip-flops

Processor datapaths are assembled from reusable digital modules. Gates implement Boolean functions; flip-flops retain one bit; integrated circuits package many such devices; and larger modules—registers, decoders, multiplexers, counters, and memories—give architecture diagrams their familiar building blocks.

Storage versus selection: a register remembers a value across clock cycles. A decoder or multiplexer merely selects a path from current inputs. Confusing state with combinational selection is a common source of timing errors.

Vocabulary for this chapter

TermPrecise meaning
Combinational circuitIts output is a function of current inputs only; it has no remembered state.
Sequential circuitIts next output can depend on stored state as well as current inputs.
WordA fixed-width group of bits treated as one unit, such as a 16-bit register value.
Active clock edgeThe rising or falling transition on which a storage element accepts its next value.
EnableA control input that permits an operation while leaving the shared clock unchanged.

Integrated Circuits and Logic Families

An integrated circuit (IC) is a silicon chip containing interconnected electronic devices. The chip is mounted in a package whose pins provide power, inputs, and outputs. A small package may expose roughly 14 pins; larger packages can expose hundreds or thousands.

Digital circuits were historically grouped by the devices and circuit style used to implement their gates:

FamilyDevice basisCharacteristic emphasis
PMOS/NMOSOne MOS transistor polarityHigh component density; older families had asymmetric behavior
CMOSComplementary MOS transistorsVery low static power and high density; dominant in modern processors
TTLBipolar junction transistorsRobust logic levels and historically common general-purpose ICs
ECLNon-saturating bipolar circuitsVery high speed at the cost of high power

Important comparison quantities are propagation delay, power dissipation, noise margin, fan-in, and fan-out. A “faster” gate family is not automatically the best system choice if its power or interface requirements are unacceptable.

Levels of integration

The traditional labels SSI, MSI, LSI, and VLSI describe increasing numbers of gates or devices on one chip. A decoder may be an MSI component; an entire processor is a VLSI system. The conceptual modules remain valuable even when synthesis tools place all of them inside one chip.

Combinational Selection Components

Theme-styled circuits for a three-to-eight decoder, eight-to-three encoder, four-to-one multiplexer, and one-to-four demultiplexer
Decoder, encoder, multiplexer, and demultiplexer operations are inverse in different senses: code-to-line, line-to-code, many-to-one, and one-to-many.

Decoder

An nn-to-2n2^n decoder activates one output corresponding to an nn-bit input code. For a 2-to-4 active-high decoder with enable EE:

D0=EA1A0,D1=EA1A0,D2=EA1A0,D3=EA1A0.\begin{aligned} D_0&=E\overline{A_1}\overline{A_0},& D_1&=E\overline{A_1}A_0,\\ D_2&=EA_1\overline{A_0},& D_3&=EA_1A_0. \end{aligned}

Decoders select memory words, registers, I/O interfaces, or one control line from an opcode. If an nn-bit code contains unused combinations, the corresponding decoder outputs are unused or assigned safe behavior.

Larger decoders can be expanded from smaller ones. A 3-to-8 decoder can be built with two enabled 2-to-4 decoders: the most-significant input enables one half while the other two inputs select within that half.

Encoder

An encoder produces a code identifying an asserted input. A simple 2n2^n-to-nn encoder assumes exactly one input is active. A priority encoder removes that assumption by choosing the highest-priority active input and usually producing a valid bit.

Multiplexer

A 2n2^n-to-1 multiplexer routes one of 2n2^n data inputs to one output using nn select inputs. For a 4-to-1 multiplexer:

Y=I0S1S0+I1S1S0+I2S1S0+I3S1S0.Y=I_0\overline{S_1}\overline{S_0} +I_1\overline{S_1}S_0 +I_2S_1\overline{S_0} +I_3S_1S_0.

Putting one multiplexer on every bit position creates a common bus selector. Four 4-bit registers require four 4-to-1 multiplexers—one per bus bit—not one multiplexer for the whole word.

Demultiplexer

A demultiplexer routes one data input to one selected output. With the input tied to 1, its behavior resembles a decoder. Demultiplexers distribute an enable pulse or serial data stream to a selected destination.

Registers

A register is a group of flip-flops sharing control signals. An nn-bit register stores an nn-bit word. Registers are faster and more directly connected to processor logic than main memory, so they hold operands and intermediate results.

A four-bit D-flip-flop register with load enable and a four-bit bidirectional shift register with hold, shift-left, shift-right, and parallel-load modes
The left circuit stores a word in parallel. The right circuit places a four-way selector before every flip-flop so one control code can hold, shift in either direction, or load all bits.

Basic register

Four D flip-flops with a common clock form a 4-bit register. If they also share an asynchronous clear, one clear signal forces every stored bit to zero. On the active clock edge,

Qi+=Di,i=0,1,2,3.Q_i^+=D_i,\qquad i=0,1,2,3.

Parallel load

Clock gating can prevent unwanted changes, but directly gating a clock creates skew and glitch risks. A safer design keeps the clock common and selects either the old value or new input:

Di=LIi+LQi.D_i=L I_i+\overline L Q_i.

When L=1L=1, the next edge loads IiI_i; when L=0L=0, feedback reloads QiQ_i, so the register holds.

Shift register

A shift register moves each stored bit to a neighboring stage on each active clock. For the ordering Q0,Q1,Q2,Q3Q_0,Q_1,Q_2,Q_3, the source note’s right-moving example uses

Q0+=SI,Q1+=Q0,Q2+=Q1,Q3+=Q2.Q_0^+=SI,\qquad Q_1^+=Q_0,\qquad Q_2^+=Q_1,\qquad Q_3^+=Q_2.

If SI=1SI=1 and the current word Q0Q1Q2Q3=0110Q_0Q_1Q_2Q_3=0110, the next word is 1011; the old Q3=0Q_3=0 is shifted out. Always define bit ordering before calling a shift “left” or “right.”

Bidirectional shift register with parallel load

S1S0S_1S_0Register operationTypical input selected for stage ii
00HoldQiQ_i
01Shift left/downNeighbor Qi+1Q_{i+1} or serial boundary input
10Shift right/upNeighbor Qi1Q_{i-1} or serial boundary input
11Parallel loadIiI_i

This circuit is often called a universal shift register. A 4-to-1 multiplexer before each flip-flop selects one of the four next-state sources.

Shift types

  • Logical shift: inserts zero; useful for unsigned scaling by powers of two.
  • Arithmetic right shift: repeats the sign bit; preserves a two’s-complement sign.
  • Circular shift/rotate: feeds the bit shifted out at one end back into the other.

Binary Counters

A four-bit synchronous binary counter beside an addressed memory array with address decoder, word lines, and data bus
A synchronous counter changes several bits on one edge. An addressed memory uses the same code-to-one-line idea to select exactly one stored word.

A binary counter is a register whose next state is the current binary value plus or minus one. In a synchronous up-counter with enable EE:

T0=E,T1=EQ0,T2=EQ1Q0,T3=EQ2Q1Q0.\begin{aligned} T_0&=E,\\ T_1&=EQ_0,\\ T_2&=EQ_1Q_0,\\ T_3&=EQ_2Q_1Q_0. \end{aligned}

Each bit toggles only when every less-significant bit is 1. Starting from 0111, one enabled clock produces 1000; the three low bits clear while the high bit sets on the same edge.

A down-counter can track iterations in multiplication or division. A zero detector asserts when

Z=Q3Q2Q1Q0.Z=\overline{Q_3}\,\overline{Q_2}\,\overline{Q_1}\,\overline{Q_0}.

Memory Unit as a Digital Component

A memory is specified as number of words × bits per word. A 1K × 8 memory stores 10241024 words of 8 bits:

  • address inputs: log21024=10\log_2 1024=10;
  • bidirectional data lines: 8;
  • total stored bits: 1024×8=81921024\times8=8192 bits.

The address decoder activates one word line. A read exposes that word on the data bus; a write stores the data-bus value in the selected word when write enable is asserted.

CapacityAddressable locationsAddress bits
256 × 16256 words8
1K × 81024 words10
64K × 3265,536 words16

The number of data lines follows word width, not total capacity. Byte-addressable and word-addressable systems can therefore require different address widths for the same total number of stored bits.

Timing and Reliable State Changes

A logic diagram says which value should be produced; timing determines whether a clocked circuit can actually store that value correctly.

Timing termMeaning
Clock-to-Q delay tcqt_{cq}Time after an active edge before a source flip-flop’s output is valid.
Propagation delay tpdt_{pd}Worst-case time for a change to pass through combinational logic.
Setup time tsetupt_{setup}Minimum time a destination input must be stable before its active edge.
Hold time tholdt_{hold}Minimum time the input must remain stable after the edge.
Clock skew tskewt_{skew}Difference between clock-arrival times at two storage elements.
Critical pathThe longest register-to-register combinational path; it limits clock frequency.

For a conservative single-cycle path,

Tclocktcq+tpd,max+tsetup+tskew.T_{clock}\ge t_{cq}+t_{pd,\max}+t_{setup}+t_{skew}.

If tcq=80t_{cq}=80 ps, the longest decoder/multiplexer path is 620620 ps, setup time is 100100 ps, and allowed skew is 5050 ps, then

Tclock80+620+100+50=850 ps,fmax1850 ps1.18 GHz.T_{clock}\ge80+620+100+50=850\text{ ps}, \qquad f_{max}\le\frac1{850\text{ ps}}\approx1.18\text{ GHz}.

Shortening a noncritical path does not raise fmaxf_{max}; the critical path must be reduced. Hold time is a separate minimum-delay requirement and cannot be repaired merely by choosing a slower clock.

An asynchronous input may change near a clock edge and leave a flip-flop temporarily metastable, neither a reliable zero nor one. A synchronizer—commonly two flip-flops in series—greatly reduces the probability that this uncertainty reaches the rest of a synchronous system. It does not make two unrelated clocks identical; multi-bit transfers still need a handshake or an asynchronous FIFO.

Worked Design: Four-Mode Register

Suppose Q=1010Q=1010, parallel input I=0111I=0111, serial-left input SL=1SL=1, and serial-right input SR=0SR=0.

ControlSelected operationNext QQ
00Hold1010
01Shift toward the most-significant end, insert SLSL at LSB0101 under the stated bit convention
10Shift toward the least-significant end, insert SRSR at MSB0101
11Parallel load0111

The two shifts happen to produce the same word for these particular boundary bits and current pattern. That coincidence is not a circuit equivalence; change SLSL or SRSR and the results diverge.

Self-Check

  1. How many outputs and minterms does a 4-to-16 decoder generate?
  2. Why is a priority encoder necessary when multiple interrupt requests may be high?
  3. A 2K × 16 memory contains how many bits and needs how many address lines?
  4. What control selects parallel load in the universal-register table?
  5. A path has tcq=60t_{cq}=60 ps, tpd=540t_{pd}=540 ps, tsetup=80t_{setup}=80 ps, and tskew=20t_{skew}=20 ps. What clock period and maximum frequency does it permit?
Answers
  1. Sixteen outputs/minterms.
  2. It defines which request wins and produces a deterministic code.
  3. 2048×16=327682048\times16=32768 bits and 11 address lines.
  4. S1S0=11S_1S_0=11.
  5. Tclock700T_{clock}\ge700 ps, so fmax1/(700 ps)1.43f_{max}\le1/(700\text{ ps})\approx1.43 GHz.