Designing Control Logic for a Single-Cycle Processor

A datapath alone does nothing without control signals telling it what to do for each instruction. This article explains how control logic reads an instruction's opcode and function fields to generate the exact signals needed to route data correctly, and walks through how a complete single-cycle implementation executes different instruction types.

Single-Cycle ControlControl SignalsInstruction Decoding

~3 min read · Updated Sep 6, 2026

The Missing Piece: Telling the Datapath What to Do

The datapath described earlier in this series contains multiplexers, an ALU, and memory units, but none of them know on their own what operation to perform for a given instruction. That decision is made by a separate piece of hardware called the Control Unit, which examines the instruction and generates the appropriate signals to drive every controllable element in the datapath.

Where Control Signals Come From

The control unit's decisions are based primarily on the instruction's Opcode field, and in some cases additional Funct fields, both of which were introduced earlier in this series when discussing instruction encoding. Since these fields sit in fixed bit positions across instruction formats, the control unit can extract them directly and use simple combinational logic to determine what the rest of the datapath should do.

Key Control Signals in a Single-Cycle Design

A handful of representative control signals illustrate how this works.

  • ALUOp tells the ALU which specific operation to perform, such as addition for a load instruction's address calculation or subtraction for a branch comparison.
  • MemRead and MemWrite enable reading from or writing to data memory, active only for load and store instructions respectively.
  • RegWrite enables writing a result back into the register file, active for arithmetic and load instructions but not for stores or branches.
  • Branch indicates whether the current instruction is a conditional branch, used together with the ALU's comparison result to decide whether to update the PC with a branch target address.
  • MemtoReg selects, through a multiplexer, whether the value written into the register file comes from the ALU result or from data memory.

Tracing an Instruction Through the Control Logic

Consider how these signals differ across three instruction types executing on the same datapath.

For an "add" instruction:
ALUOp = addition, RegWrite = 1,
MemRead = 0, MemWrite = 0, Branch = 0

For a "load" instruction:
ALUOp = addition (address calculation),
MemRead = 1, RegWrite = 1, MemtoReg = 1

For a "branch" instruction:
ALUOp = subtraction (comparison),
Branch = 1, RegWrite = 0, MemWrite = 0

The same physical hardware handles all three instruction types correctly simply because the control unit changes which signals are active, routing data along a different effective path through the same shared datapath each time.

Why a Single-Cycle Design Is a Useful Starting Point

In this design, every instruction completes fully within one clock cycle, no matter how simple or complex it is. This makes the control logic conceptually simple to design and reason about, since there is no need to track partially completed instructions across multiple cycles. This simplicity, however, comes with a significant performance cost that becomes clear once pipelining is introduced later in this series, since the clock cycle length must be long enough to accommodate even the slowest instruction.

Written & researched by Dr. Shahin Siami

Related Articles

Cache Fundamentals: How Small, Fast Memory Predicts What You Need Next

A cache works because programs tend to access the same or nearby data repeatedly rather than randomly. This article explains the principle of locality that makes caching effective, how a direct-mapped cache locates data using an address, and what happens on a cache hit versus a cache miss.

Continue

The Memory Hierarchy: Why Computers Use Several Kinds of Memory

No single memory technology is simultaneously fast, large, and cheap. This article introduces the concept of a memory hierarchy that combines several different memory technologies to approximate the speed of the fastest one at the cost of the cheapest, then walks through the core technologies that make up each level.

Continue

Common Misconceptions About Processor Design and Chapter Four's Big Picture

After covering datapaths, pipelining, hazards, and real-world processor comparisons, it is time to correct a handful of persistent misconceptions about how processors actually behave. This article addresses common fallacies about pipelining and performance, then ties together the full journey from simple datapaths to superscalar execution covered throughout this chapter.

Continue

Real-World Pipelines: Comparing ARM and Intel, and Speeding Up Matrix Multiply

Theoretical pipeline concepts take concrete shape in real commercial processors, which vary widely in pipeline depth and issue width depending on their design goals. This article compares how the ARM Cortex-A53 and Intel Core i7 implement pipelining differently for power efficiency versus raw performance, then shows how instruction-level parallelism accelerates matrix multiplication in practice.

Continue

Instruction-Level Parallelism: Executing More Than One Instruction at Once

A single pipeline can only advance one instruction into each stage per cycle, which caps its performance at roughly one instruction per clock. This article explains how processors go beyond that limit by issuing multiple instructions simultaneously, the hardware duplication this requires, and the fundamental limits imposed by dependencies between instructions.

Continue

How a Pipelined Processor Handles Exceptions

Not every instruction executes as expected — some trigger error conditions like an undefined opcode or an arithmetic overflow that the processor must respond to safely. This article explains what exceptions are, how a pipelined processor detects and handles them without corrupting program state, and why exceptions are treated similarly to control hazards.

Continue