Skip to main content

7.2 Hardwired Control Unit Design & State Machine Synthesis

πŸ“š07Topic 7.2⏱️32 min
🎯High-Yield For:Hardwired control synthesis is the foundation of high-frequency RISC and super-pipelined processors. It demonstrates how complex multi-cycle instruction decoding is mapped directly into minimal Boolean logic gates and finite state machines operating at sub-nanosecond speeds.

πŸ’‘ Core Intuition: Direct Hardwired Silicon Generation​

The Control Unit (CU) is the supervisory nerve center of the central processing unit. Its objective is to coordinate the physical movements of data across internal buses, trigger ALU operations, and manage memory transactions by issuing a complex set of binary control signals at precise clock-cycle intervals.

In a Hardwired Control Unit, every control signal is generated directly by fixed digital logic circuits (AND, OR, NOT gates, decoders, and multiplexers). The silicon layout is wired so that whenever a specific instruction opcode, addressing mode, timing pulse, and ALU condition flag coincide, the corresponding control lines assert instantaneously.

🍳 The Everyday Analogy: The Mechanical Engine Camshaft​

Consider the internal combustion engine of a high-performance sports car:

  • As the crankshaft spins, a specially shaped physical metal rod (the camshaft) rotates synchronously with the pistons.
  • Physical metal lobes ground directly into the camshaft strike and open intake valves, exhaust valves, and spark trigger switches at exact mechanical angles.
  • Speed & Latency: The mechanical camshaft operates with zero interpretive latency. As soon as the lobe reaches its peak, the valve opens immediately at 9,000 RPM.
  • The Trade-Off (Rigidity): If the engine tuner wants to alter valve timing by 2 degrees or change the combustion cycle, they cannot simply upload a software update. They must physically tear down the engine block, mill a brand-new solid steel camshaft, and reassemble the engine.

A hardwired control unit is the digital silicon equivalent of this mechanical camshaft: unmatched raw execution speed, but zero post-silicon flexibility.

Architecture Flow

Hardwired Control Generation Pipeline

How orthogonal instruction, timing, and flag vectors converge on combinational gate matrices

πŸ“₯Input Vectors

Opcode, Timing & Status Flags

IR(14-12), 4-bit SC counter, and ALU condition flags (Z, S, C).

β†’
Binary Inputs
⚑Decoding Stage

Opcode (3x8) & Timing (4x16) Decoders

Generates mutually exclusive active-high pulses (D0-D7 and T0-T15).

β†’
Orthogonal Lines
πŸ”€Gate Matrix

SOP Combinational Logic Matrix

Two-level AND-OR array asserts cycle-exact processor control signals (LD, INR, CLR, MUX).

πŸ’» Bridging to Computer Science​

In formal digital logic design, a hardwired control unit is modeled as a synchronous Finite State Machine (FSM).

Each control output CkC_k is expressed as a Boolean Sum-of-Products (SOP) function of four input vector classes:

Ck=f(D,T,I,S)=βˆ‘m(Diβ‹…Tjβ‹…Ixβ‹…Sy)C_k = f(D, T, I, S) = \sum_{m} \left( D_i \cdot T_j \cdot I^x \cdot S_y \right)

Where:

  • Di∈{D0,D1,…,D7}D_i \in \{D_0, D_1, \dots, D_7\} represents the decoded instruction opcode.
  • Tj∈{T0,T1,…,T15}T_j \in \{T_0, T_1, \dots, T_{15}\} represents the orthogonal timing signal from the Sequence Counter.
  • I∈{0,1}I \in \{0, 1\} represents the addressing mode bit (IR15IR_{15}).
  • SyS_y represents system condition and ALU status flags (Zero ZZ, Sign SS, Carry CC, Overflow VV, Interrupt IENIEN).

Because combinational logic gates propagate electrical signals in fractions of a nanosecond, hardwired controllers provide the lowest possible control-path latency, making them the universal choice for RISC processors and high-frequency execution pipelines.



πŸ—οΈ Architectural Anatomy of a Hardwired Control Unit​

The standard organization of a hardwired control unit consists of two primary decoding modules feeding a central combinational gate array.

Hardwired Control Unit Component Hierarchy

Primary functional modules generating cycle-accurate processor control vectors

πŸ“œ

Instruction Decoder

3 x 8 Decoder
  • Decodes the 3-bit operation code IR(14-12) into 8 active-high outputs D0 to D7.
  • D0 through D6 designate distinct memory-reference instructions.
  • D7 = 1 distinguishes register-reference (I=0) and I/O instructions (I=1).
⏱️

Sequence Counter (SC)

4-Bit Synchronous Counter
  • Synchronous 4-bit binary up-counter advancing on each master clock edge.
  • Equipped with synchronous Increment (INR) and Clear (CLR) inputs.
  • Asserting CLR(SC) resets counter to 0000_2, completing the instruction cycle.
⚑

Timing Decoder

4 x 16 Decoder
  • Translates 4-bit counter states into 16 non-overlapping timing pulses T0 to T15.
  • Guarantees the orthogonality invariant: Ti . Tj = 0 for all i != j.
  • Pulses T0, T1, and T2 form the universal instruction fetch/decode window.
πŸ”€

Control Logic Gates

SOP Gate Matrix
  • Synthesized two-level AND-OR gate array implementing minimal Boolean equations.
  • Directly generates register load (LD), increment (INR), clear (CLR), and bus signals.
  • Delivers sub-nanosecond signal propagation with zero memory lookup overhead.

Signal Interconnect & Functional Flow​

  1. Instruction Latch: At timing pulse T1T_1, an instruction word is fetched into the Instruction Register (IRIR).
  2. Opcode Decoding: Bits 14–1214\text{--}12 of IRIR are routed to the 3Γ—83 \times 8 opcode decoder, immediately asserting one line among D0Β toΒ D7D_0 \text{ to } D_7. Bit 1515 is latched into flip-flop II.
  3. Timing Generation: The Sequence Counter (SCSC) starts at 000020000_2 (T0T_0) and counts upwards with each clock cycle (T1,T2,T3,…T_1, T_2, T_3, \dots).
  4. Control Generation: The outputs D0Β toΒ D7D_0 \text{ to } D_7, T0Β toΒ T15T_0 \text{ to } T_{15}, II, and bits IR(11–0)IR(11\text{--}0) are combined within the control logic gates to assert destination enable lines (LD,INR,CLRLD, INR, CLR), memory read/write strobes, and bus multiplexer select lines (S2S1S0S_2 S_1 S_0).
  5. Instruction Termination: Upon completing the final micro-operation of an instruction, the control logic asserts CLR(SC)CLR(SC), resetting SCSC back to 00 on the next clock edge to fetch the subsequent instruction.

πŸŽ›οΈ State Machine Synthesis Methods​

Engineers employ four classical methodologies to implement the synchronous sequential state machine of a hardwired control unit:

Hardwired State Machine Implementation Strategies

Comparing area-optimized counters against maximum-speed one-hot architectures

Area-Efficient

Sequence Counter + Decoder Method

⏱️
Dominant Architecture / DomainEmbedded Cores & Mano's Basic Architecture
  • β€’Uses a k-bit binary counter and a 2^k decoder to step through states linearly.
  • β€’Requires only ceil(log2 n) flip-flops for n discrete execution timing states.
  • β€’Branches and early cycle terminations are handled by clearing or reloading the counter.
  • β€’Introduces decoder propagation delay before control gate matrices switch.
"Minimizes flip-flop count at the cost of multi-level decoder propagation delay."
Maximum Speed

One-Hot (Delay Element) Method

⚑
Dominant Architecture / DomainGigahertz RISC Execution Pipelines & DSPs
  • β€’Allocates exactly one flip-flop per state (n states = n flip-flops).
  • β€’At any clock instant, exactly one flip-flop holds logic 1; all others hold 0.
  • β€’Completely eliminates decoder propagation delay; state outputs drive control gates directly.
  • β€’Flip-flop excitation equations are the direct Boolean OR of predecessor transition conditions.
"Trades extra flip-flops for zero decoder delay, driving execution gates directly."

1. The One-Hot (Delay Element) Formulation​

In the One-Hot method, if an architecture requires NN distinct execution timing intervals, it instantiates NN separate flip-flops (FF0,FF1,…,FFNβˆ’1FF_0, FF_1, \dots, FF_{N-1}).

  • State Invariant:

    βˆ‘k=0Nβˆ’1Qk=1andQiβ‹…Qj=0(βˆ€iβ‰ j)\sum_{k=0}^{N-1} Q_k = 1 \quad \text{and} \quad Q_i \cdot Q_j = 0 \quad (\forall i \neq j)
  • Excitation Equation for Flip-Flop jj: The D-input of flip-flop jj is the Boolean sum of all possible predecessor state transitions:

    DFFj=βˆ‘allΒ predecessorsΒ i(Qiβ‹…Conditioniβ†’j)D_{FF_j} = \sum_{\text{all predecessors } i} \left( Q_i \cdot \text{Condition}_{i \to j} \right)

Because no decoding logic is required to determine the current state, the maximum clock frequency is bounded solely by:

Tclkβ‰₯tcq+tcomb+tsetupT_{\text{clk}} \ge t_{\text{cq}} + t_{\text{comb}} + t_{\text{setup}}

Where:

  • tcqt_{\text{cq}} is the flip-flop clock-to-Q delay.
  • tcombt_{\text{comb}} is the propagation delay of the combinational control gate matrix.
  • tsetupt_{\text{setup}} is the flip-flop input setup time.

2. State Table & Classical Sequential Circuit Synthesis​

In the classical sequential approach, the control unit is modeled as an arbitrary Mealy or Moore FSM:

  1. Construct the complete State Transition Diagram showing all states (S0,S1,…S_0, S_1, \dots).
  2. Assign binary state encodings using ⌈log⁑2NβŒ‰\lceil \log_2 N \rceil state variables (y2,y1,y0y_2, y_1, y_0).
  3. Derive the FSM Excitation Table utilizing D, J-K, or T flip-flops.
  4. Minimize next-state excitation equations and output equations using Karnaugh Maps or the Quine-McCluskey algorithm.

While theoretically minimizing the total number of transistors, this approach yields irregular, unstructured logic networks with significant routing overhead and hazard vulnerabilities.


πŸ“ Detailed Boolean SOP Synthesis of Control Logic Gates​

To understand how hardwired control signals are synthesized, we derive the exact Boolean equations for the register control inputs and bus drivers in the basic computer datapath.

1. Synthesis of Address Register (ARAR) Control Inputs​

The Address Register (ARAR) has three control inputs: Load (LDLD), Increment (INRINR), and Clear (CLRCLR).

By auditing every micro-operation across the computer instruction set that manipulates ARAR:

Execution PhaseHardware Condition & TimingRegister Transfer Micro-OperationActivated Control Pin
Instruction FetchRβ€²T0R' T_0AR←PCAR \leftarrow PCLD(AR)LD(AR)
Instruction DecodeRβ€²T2R' T_2AR←IR(11–0)AR \leftarrow IR(11\text{--}0)LD(AR)LD(AR)
Indirect ResolutionD7β€²IT3D_7' I T_3AR←M[AR]AR \leftarrow M[AR]LD(AR)LD(AR)
Subroutine Call (BSA)D5T4D_5 T_4AR←AR+1AR \leftarrow AR + 1INR(AR)INR(AR)
Interrupt CycleRT0R T_0AR←0AR \leftarrow 0CLR(AR)CLR(AR)

From these operational conditions, we directly synthesize the minimal SOP Boolean expressions:

LD(AR)=Rβ€²T0+Rβ€²T2+D7β€²IT3\mathbf{LD(AR)} = R' T_0 + R' T_2 + D_7' I T_3 INR(AR)=D5T4\mathbf{INR(AR)} = D_5 T_4 CLR(AR)=RT0\mathbf{CLR(AR)} = R T_0

(Where RR is the hardware Interrupt flip-flop: when R=1R = 1, the computer enters the interrupt cycle rather than instruction fetch).

2. Synthesis of Accumulator (ACAC) Control Inputs​

The Accumulator (ACAC) register has 16 data inputs supplied by the ALU, and three control inputs: LD(AC)LD(AC), INR(AC)INR(AC), and CLR(AC)CLR(AC).

Scanning the entire instruction set for micro-operations that modify ACAC:

  • D0T5:β€…β€ŠAC←AC∧DRD_0 T_5: \; AC \leftarrow AC \land DR (AND instruction)
  • D1T5:β€…β€ŠAC←AC+DRD_1 T_5: \; AC \leftarrow AC + DR (ADD instruction)
  • D2T5:β€…β€ŠAC←DRD_2 T_5: \; AC \leftarrow DR (LDA instruction)
  • rB11:β€…β€ŠAC←0r B_{11}: \; AC \leftarrow 0 (CLA instruction, where r=D7Iβ€²T3r = D_7 I' T_3 and B11=IR11B_{11} = IR_{11})
  • rB9:β€…β€ŠAC←ACβ€Ύr B_9: \; AC \leftarrow \overline{AC} (CMA instruction, where B9=IR9B_9 = IR_9)
  • rB7:β€…β€ŠAC←shrΒ ACr B_7: \; AC \leftarrow \text{shr } AC (CIR circular shift right)
  • rB6:β€…β€ŠAC←shlΒ ACr B_6: \; AC \leftarrow \text{shl } AC (CIL circular shift left)
  • rB5:β€…β€ŠAC←AC+1r B_5: \; AC \leftarrow AC + 1 (INC increment accumulator)
  • pB11:β€…β€ŠAC(7–0)←INPRp B_{11}: \; AC(7\text{--}0) \leftarrow INPR (INP instruction, where p=D7IT3p = D_7 I T_3)

From these statements, the three gate control inputs for ACAC are synthesized directly:

πŸ“Accumulator Control Gate SOP Equationstheorem
LD(AC)=D0T5+D1T5+D2T5+pB11+rB9+rB7+rB6\mathbf{LD(AC)} = D_0 T_5 + D_1 T_5 + D_2 T_5 + p B_{11} + r B_9 + r B_7 + r B_6INR(AC)=rB5\mathbf{INR(AC)} = r B_5CLR(AC)=rB11\mathbf{CLR(AC)} = r B_{11}

These three equations correspond to the physical logic gate array driving the control pins of the Accumulator register.

3. Synthesis of Memory Read (RDRD) & Write (WRWR) Controls​

The central RAM unit accepts active-high ReadRead and WriteWrite control lines:

  • A memory Read occurs during:
    • Instruction fetch: Rβ€²T1R' T_1
    • Indirect address fetch: D7β€²IT3D_7' I T_3
    • Operand fetch for AND, ADD, LDA, ISZ: D0T4+D1T4+D2T4+D6T4D_0 T_4 + D_1 T_4 + D_2 T_4 + D_6 T_4
  • A memory Write occurs during:
    • Interrupt return address storage: RT1R T_1
    • Store accumulator: D3T4D_3 T_4 (STA)
    • Subroutine return address storage: D5T4D_5 T_4 (BSA)
    • Increment-and-skip result writeback: D6T6D_6 T_6 (ISZ)

Factoring common terms:

Read=Rβ€²T1+D7β€²IT3+(D0+D1+D2+D6)T4\mathbf{Read} = R' T_1 + D_7' I T_3 + (D_0 + D_1 + D_2 + D_6) T_4 Write=RT1+D3T4+D5T4+D6T6\mathbf{Write} = R T_1 + D_3 T_4 + D_5 T_4 + D_6 T_6

4. Synthesis of Sequence Counter Reset (CLR(SC)CLR(SC))​

Instructions execute across varying numbers of clock cycles (e.g., STA finishes at T4T_4, while ISZ requires T6T_6). To maximize system throughput, the Sequence Counter must be cleared as soon as an instruction finishes:

CLR(SC)=β€…β€ŠRT2+D0T5+D1T5+D2T5+D3T4+D4T4+D5T5+D6T6+r+p\begin{aligned} \mathbf{CLR(SC)} = \; & R T_2 + D_0 T_5 + D_1 T_5 + D_2 T_5 + D_3 T_4 \\ & + D_4 T_4 + D_5 T_5 + D_6 T_6 + r + p \end{aligned}

When CLR(SC)CLR(SC) asserts, the counter resets to 00 on the next clock pulse, automatically beginning timing pulse T0T_0 of the next instruction without wasting idle clock cycles!


βš–οΈ Architectural Comparison: Hardwired vs. Microprogrammed​

Architectural ParameterHardwired Control UnitMicroprogrammed Control Unit
Primary Implementation MechanismFixed combinational gates & flip-flopsControl Store Memory (ΞΌ\muROM) & Sequencer
Execution Speed & Clock FrequencyUltra-Fast (Sub-nanosecond gate propagation)Slower (Limited by ROM access latency)
Modification & FlexibilityCompletely Rigid (Requires silicon re-fabrication)Highly Flexible (Update ROM microcode bits)
Instruction Set CompatibilityIdeal for RISC (Simple, fixed-length formats)Ideal for CISC (Complex, multi-cycle instructions)
Silicon Area OverheadGrows exponentially with instruction set complexityGrows linearly with microprogram length
Design & Debugging ComplexityHigh (Complex state machine minimization)Low (Software-like structured microprogramming)
CPI (Cycles Per Instruction)Typically 1Β cycle1 \text{ cycle} (Single-cycle execution)Multi-cycle (3Β toΒ 10+Β cycles3 \text{ to } 10+ \text{ cycles} per instruction)

🏭 Real-World Production Context: Modern High-Speed Decoders​

In modern high-performance microprocessors, pure hardwired control units dominate the execution engines of RISC architectures and modern superscalar front-ends:

Production CPU Control Implementations

How real-world microarchitectures leverage hardwired control logic.

Hybrid CISC

x86-64 Front-End Hybrid Decoders (Intel Raptor Lake / AMD Zen 4)

βš™οΈ

Uses four parallel Hardwired 'Fast-Path' decoders for simple instructions (1-to-1 mapping into micro-ops in 1 cycle), reserving a slower Microcode Sequencer ROM (MSROM) only for legacy CISC instructions.

4-Wide Hardwired DecodersMSROM Fallback EngineDecoded Micro-op Queue (DSB)
↓Pipelined to Execution Units
Pure RISC

Pure Hardwired Silicon Engines (ARM Cortex-A78 / Apple Silicon M-Series)

⚑

Zero microcode ROM. Every single instruction is decoded directly via multi-level synthesized PLA/combinational trees into control vectors in under 250 picoseconds.

Single-Cycle Decoder StageDirect Control Vector Generation3.5+ GHz Operating Frequency
↓Synthesized with Standard Cell ASIC Libraries
Low-Power Core

Hardwired FSM Controllers (RISC-V RV32I / Rocket Core)

πŸ”¬

Single-state combinational decoders mapping 32-bit RISC-V instructions directly into ALU select, register writeback enables, and branch comparator masks.

Zero-Overhead DecodingMinimal Transistor Gate CountDeterministic Cycle Latency

πŸ“ Numerical Applications & Worked Examples​

Example 1: SOP Control Signal Synthesis for Multi-Instruction Datapath​

Problem Statement​

A processor control unit implemented via hardwired combinational logic controls three 8-bit registers: AA, BB, and CC.

The processor supports two distinct instructions: I1I_1 and I2I_2. The timing signals T1,T2,T3,T4T_1, T_2, T_3, T_4 are generated by a sequence counter and decoder. The micro-operations and active control signals required during each clock pulse are specified in the following table:

Timing SignalInstruction I1I_1 Control SignalsInstruction I2I_2 Control Signals
T1T_1Ain,β€…β€ŠBoutA_{in}, \; B_{out}Ain,β€…β€ŠAoutA_{in}, \; A_{out}
T2T_2Bin,β€…β€ŠCoutB_{in}, \; C_{out}Cin,β€…β€ŠAoutC_{in}, \; A_{out}
T3T_3Bin,β€…β€ŠBoutB_{in}, \; B_{out}Cin,β€…β€ŠCoutC_{in}, \; C_{out}
T4T_4Ain,β€…β€ŠAoutA_{in}, \; A_{out}Ain,β€…β€ŠBoutA_{in}, \; B_{out}
  1. Synthesize the minimal Sum-of-Products (SOP) Boolean expressions for the register input control signals: Ain,Bin,CinA_{in}, B_{in}, C_{in}.
  2. Synthesize the minimal Sum-of-Products (SOP) Boolean expressions for the register output control signals: Aout,Bout,CoutA_{out}, B_{out}, C_{out}.
  3. Calculate the total number of 2-input AND and OR gates required to implement the complete control signal generation logic (assuming inverted and decoded inputs I1,I2,T1–T4I_1, I_2, T_1 \text{--} T_4 are available).

Step-by-Step Solution​

1. Register Input Control Signals (Ain,Bin,CinA_{in}, B_{in}, C_{in}):

  • AinA_{in} is active when:

    • During I1I_1: at T1T_1 and T4T_4.
    • During I2I_2: at T1T_1 and T4T_4.
    Ain=I1T1+I1T4+I2T1+I2T4=(I1+I2)(T1+T4)A_{in} = I_1 T_1 + I_1 T_4 + I_2 T_1 + I_2 T_4 = (I_1 + I_2)(T_1 + T_4)

    Since I1I_1 and I2I_2 are the only two instructions in the processor (I1+I2=1I_1 + I_2 = 1):

    Ain=T1+T4\mathbf{A_{in} = T_1 + T_4}
  • BinB_{in} is active when:

    • During I1I_1: at T2T_2 and T3T_3.
    • During I2I_2: never active.
    Bin=I1T2+I1T3=I1(T2+T3)\mathbf{B_{in} = I_1 T_2 + I_1 T_3 = I_1(T_2 + T_3)}
  • CinC_{in} is active when:

    • During I1I_1: never active.
    • During I2I_2: at T2T_2 and T3T_3.
    Cin=I2T2+I2T3=I2(T2+T3)\mathbf{C_{in} = I_2 T_2 + I_2 T_3 = I_2(T_2 + T_3)}

2. Register Output Control Signals (Aout,Bout,CoutA_{out}, B_{out}, C_{out}):

  • AoutA_{out} is active when:

    • During I1I_1: at T4T_4.
    • During I2I_2: at T1T_1 and T2T_2.
    Aout=I1T4+I2T1+I2T2=I1T4+I2(T1+T2)\mathbf{A_{out} = I_1 T_4 + I_2 T_1 + I_2 T_2 = I_1 T_4 + I_2(T_1 + T_2)}
  • BoutB_{out} is active when:

    • During I1I_1: at T1T_1 and T3T_3.
    • During I2I_2: at T4T_4.
    Bout=I1T1+I1T3+I2T4=I1(T1+T3)+I2T4\mathbf{B_{out} = I_1 T_1 + I_1 T_3 + I_2 T_4 = I_1(T_1 + T_3) + I_2 T_4}
  • CoutC_{out} is active when:

    • During I1I_1: at T2T_2.
    • During I2I_2: at T3T_3.
    Cout=I1T2+I2T3\mathbf{C_{out} = I_1 T_2 + I_2 T_3}

3. Hardware Gate Sizing:

  • Ain=T1+T4β€…β€ŠβŸΉβ€…β€Š1Β ORΒ gateA_{in} = T_1 + T_4 \implies 1 \text{ OR gate}.
  • Bin=I1(T2+T3)β€…β€ŠβŸΉβ€…β€Š1Β ORΒ gate+1Β ANDΒ gate=2Β gatesB_{in} = I_1(T_2 + T_3) \implies 1 \text{ OR gate} + 1 \text{ AND gate} = 2 \text{ gates}.
  • Cin=I2(T2+T3)β€…β€ŠβŸΉβ€…β€Š1Β ORΒ gateΒ (sharedΒ withΒ Bin)+1Β ANDΒ gate=1Β newΒ gateC_{in} = I_2(T_2 + T_3) \implies 1 \text{ OR gate (shared with } B_{in}\text{)} + 1 \text{ AND gate} = 1 \text{ new gate}.
  • Aout=I1T4+I2(T1+T2)β€…β€ŠβŸΉβ€…β€Š2Β ANDΒ gates+2Β ORΒ gates=4Β gatesA_{out} = I_1 T_4 + I_2(T_1 + T_2) \implies 2 \text{ AND gates} + 2 \text{ OR gates} = 4 \text{ gates}.
  • Bout=I1(T1+T3)+I2T4β€…β€ŠβŸΉβ€…β€Š2Β ANDΒ gates+2Β ORΒ gates=4Β gatesB_{out} = I_1(T_1 + T_3) + I_2 T_4 \implies 2 \text{ AND gates} + 2 \text{ OR gates} = 4 \text{ gates}.
  • Cout=I1T2+I2T3β€…β€ŠβŸΉβ€…β€Š2Β ANDΒ gates+1Β ORΒ gate=3Β gatesC_{out} = I_1 T_2 + I_2 T_3 \implies 2 \text{ AND gates} + 1 \text{ OR gate} = 3 \text{ gates}.

Total gates required = 15Β gates15 \text{ gates} with a maximum propagation path of just 2Β gateΒ delays2 \text{ gate delays} (tpropβ‰ˆ0.1Β nst_{\text{prop}} \approx 0.1 \text{ ns}).


Example 2: One-Hot (Delay Element) vs. Decoded Counter FSM Sizing & Timing​

Problem Statement​

A processor control unit requires 1616 distinct sequential timing states (T0Β toΒ T15T_0 \text{ to } T_{15}) operating at maximum frequency.

Hardware parameters for the available CMOS standard-cell library:

  • D Flip-Flop propagation delay (tcqt_{\text{cq}}): 0.45Β ns0.45 \text{ ns}
  • D Flip-Flop setup time (tsetupt_{\text{setup}}): 0.25Β ns0.25 \text{ ns}
  • Combinational control gate delay (tcombt_{\text{comb}}): 0.80Β ns0.80 \text{ ns}
  • 4Γ—164 \times 16 Decoder propagation delay (tdect_{\text{dec}}): 0.70Β ns0.70 \text{ ns}

Compare:

  1. The Sequence Counter + Decoder Method: number of flip-flops, minimum clock period (TclkT_{\text{clk}}), and maximum operating clock frequency (fmax⁑f_{\max}).
  2. The One-Hot (Delay Element) Method: number of flip-flops, minimum clock period (TclkT_{\text{clk}}), and maximum operating clock frequency (fmax⁑f_{\max}).
  3. Calculate the percentage increase in maximum clock frequency achieved by the One-Hot method.

Step-by-Step Solution​

1. Sequence Counter + Decoder Method:

  • To represent 16 states:

    NumberΒ ofΒ Flip-Flops=⌈log⁑2(16)βŒ‰=4Β flip-flops\text{Number of Flip-Flops} = \lceil \log_2(16) \rceil = 4 \text{ flip-flops}
  • The critical path begins at the clock edge triggering the counter, propagates through the counter flip-flops, through the 4Γ—164 \times 16 decoder to generate timing pulse TkT_k, through the combinational control gates, and must satisfy the setup time:

    Tclk,Β decodedβ‰₯tcq+tdec+tcomb+tsetupT_{\text{clk, decoded}} \ge t_{\text{cq}} + t_{\text{dec}} + t_{\text{comb}} + t_{\text{setup}} Tclk,Β decoded=0.45Β ns+0.70Β ns+0.80Β ns+0.25Β ns=2.20Β nsT_{\text{clk, decoded}} = 0.45 \text{ ns} + 0.70 \text{ ns} + 0.80 \text{ ns} + 0.25 \text{ ns} = \mathbf{2.20 \text{ ns}}
  • Maximum clock frequency:

    fmax⁑,decoded=12.20Γ—10βˆ’9Β sβ‰ˆ454.55Β MHzf_{\max, \text{decoded}} = \frac{1}{2.20 \times 10^{-9} \text{ s}} \approx \mathbf{454.55 \text{ MHz}}

2. One-Hot (Delay Element) Method:

  • In the One-Hot method, each of the 16 states has its own dedicated flip-flop:

    NumberΒ ofΒ Flip-Flops=16Β flip-flops\text{Number of Flip-Flops} = 16 \text{ flip-flops}
  • Because the output of each flip-flop directly represents the timing pulse TkT_k with zero decoding delay (tdec=0t_{\text{dec}} = 0):

    Tclk,Β one-hotβ‰₯tcq+tcomb+tsetupT_{\text{clk, one-hot}} \ge t_{\text{cq}} + t_{\text{comb}} + t_{\text{setup}} Tclk,Β one-hot=0.45Β ns+0.80Β ns+0.25Β ns=1.50Β nsT_{\text{clk, one-hot}} = 0.45 \text{ ns} + 0.80 \text{ ns} + 0.25 \text{ ns} = \mathbf{1.50 \text{ ns}}
  • Maximum clock frequency:

    fmax⁑,one-hot=11.50Γ—10βˆ’9Β sβ‰ˆ666.67Β MHzf_{\max, \text{one-hot}} = \frac{1}{1.50 \times 10^{-9} \text{ s}} \approx \mathbf{666.67 \text{ MHz}}

3. Performance Improvement:

FrequencyΒ Increase=666.67βˆ’454.55454.55Γ—100%=+46.67%\text{Frequency Increase} = \frac{666.67 - 454.55}{454.55} \times 100\% = \mathbf{+46.67\%}

The One-Hot architecture achieves a 46.67%46.67\% higher operating clock frequency at the cost of 12 additional flip-flops, making it the preferred design in high-speed microarchitectures where silicon area is secondary to cycle time.


Example 3: Complete Gate Synthesis of Memory Write (WRWR) Logic​

Problem Statement​

In a basic computer system, memory writes occur during specific cycles across four distinct instruction execution flows and the interrupt handling sequence:

  1. Interrupt Cycle (R=1R = 1): Return address PCPC is written to memory at address 00: RT1:M[0]←PCR T_1: M[0] \leftarrow PC.
  2. Store Accumulator (STA, D3D_3): D3T4:M[AR]←ACD_3 T_4: M[AR] \leftarrow AC.
  3. Branch and Save Return Address (BSA, D5D_5): D5T4:M[AR]←PCD_5 T_4: M[AR] \leftarrow PC.
  4. Increment and Skip if Zero (ISZ, D6D_6): D6T6:M[AR]←DRD_6 T_6: M[AR] \leftarrow DR.

Synthesize:

  1. The complete Boolean expression for the active-high Memory Write strobe (WRWR).
  2. The gate-level schematic implementation using standard 2-input AND, 2-input OR, and multi-input OR gates.
  3. Determine the logic state of WRWR during timing pulse T4T_4 when executing an indirect ADD instruction (D1=1,I=1D_1 = 1, I = 1).

Step-by-Step Solution​

1. Boolean Synthesis of WRWR: Identify all terms that assert the memory write line:

WR=RT1+D3T4+D5T4+D6T6WR = R T_1 + D_3 T_4 + D_5 T_4 + D_6 T_6

Factoring the common timing term T4T_4:

WR=RT1+(D3+D5)T4+D6T6\mathbf{WR = R T_1 + (D_3 + D_5) T_4 + D_6 T_6}

2. Gate-Level Implementation:

  • Term 1: One 2-input AND gate computing Rβ‹…T1R \cdot T_1.
  • Term 2: One 2-input OR gate computing (D3+D5)(D_3 + D_5), feeding into one 2-input AND gate with T4T_4.
  • Term 3: One 2-input AND gate computing D6β‹…T6D_6 \cdot T_6.
  • Output: One 3-input OR gate combining the three terms to produce WRWR.

Total gate count: 3Β ANDΒ gates+2Β ORΒ gates=5Β gates3 \text{ AND gates} + 2 \text{ OR gates} = 5 \text{ gates}.

3. Logic State Evaluation for Indirect ADD at T4T_4:

  • For an ADD instruction: D1=1D_1 = 1, and all other opcode lines D0,D2,D3,D4,D5,D6,D7=0D_0, D_2, D_3, D_4, D_5, D_6, D_7 = 0.

  • Normal execution implies interrupt is inactive (R=0R = 0).

  • At timing cycle T4T_4:

    WR=(0β‹…0)+(0+0)β‹…1+(0β‹…0)=0+0+0=0WR = (0 \cdot 0) + (0 + 0) \cdot 1 + (0 \cdot 0) = 0 + 0 + 0 = \mathbf{0}

The WRWR line remains 00 (de-asserted). In fact, at cycle T4T_4, the ADD instruction asserts the ReadRead line (D1T4:DR←M[AR]D_1 T_4: DR \leftarrow M[AR]), successfully reading the operand from memory into the Data Register.


🎯 Exam & Interview Pitfall Check​

Core Conceptual Questions
  1. Why does RISC architecture exclusively implement hardwired control units rather than microprogramming?

    • RISC architectures are engineered around the principle of single-cycle instruction execution with uniform instruction lengths, regular register field alignments, and simple addressing modes. Because RISC instructions do not require complex multi-step micro-routines, hardwired control logic can decode and issue control vectors in a single gate delay without the memory read latency of a microcode store, enabling clock speeds exceeding 3–5Β GHz3\text{--}5 \text{ GHz}.
  2. What is the primary operational difference between a Mealy and a Moore control unit?

    • In a Moore machine, the control outputs depend solely on the current state (the current Sequence Counter timing value TkT_k). In a Mealy machine, the control outputs depend simultaneously on both the current state and external asynchronous inputs (such as condition flags or interrupt requests). Mealy control units respond one cycle faster to external inputs but are susceptible to logic glitches and clock-edge racing.
  3. How does the Sequence Counter (SCSC) prevent wasting clock cycles on short instructions?

    • Rather than forcing every instruction to cycle through all 16 states (T0Β toΒ T15T_0 \text{ to } T_{15}), the control unit asserts CLR(SC)CLR(SC) at the end of the final micro-operation of each instruction (e.g., at T4T_4 for STA, or at T5T_5 for ADD). On the very next clock edge, SCSC resets to 00, immediately initiating T0T_0 of the next instruction and optimizing instruction throughput.
Common Interview Traps
  • Trap 1: Assuming hardwired control requires rewriting firmware to fix bugs.
    • Fatal misconception: Hardwired control has no firmware or ROM! The logic is etched permanently into physical silicon transistors and metal interconnect layers. A bug in a hardwired control unit cannot be patched with software or microcode; it requires a costly physical silicon re-spin (new lithography masks and chip manufacturing).
  • Trap 2: Omitting the common Fetch and Indirect cycles during Boolean synthesis.
    • When asked to synthesize a control signal like LD(AR)LD(AR) or ReadRead, candidates frequently only look at the Execution phase (T4Β toΒ T6T_4 \text{ to } T_6) and forget that ARAR is also loaded during Fetch (T0,T2T_0, T_2) and Indirect addressing (T3T_3). All instruction phases must be audited to produce the complete Boolean equation.
  • Trap 3: Confusing One-Hot encoding with binary counter encoding.
    • A 16-state binary counter requires ⌈log⁑216βŒ‰=4\lceil \log_2 16 \rceil = 4 flip-flops followed by a 4Γ—164 \times 16 decoder. A One-Hot state controller requires 16 separate flip-flops, but completely eliminates the decoder, achieving significantly lower propagation delay.

πŸ’¬

Discussion & Doubts