Mapping ISA Instructions to Hardware Functional Units
In this lesson, you will learn how the processor translates abstract software instructions into physical signals that activate specific hardware circuits to perform work.
From Software to Silicon
An Instruction Set Architecture (ISA) defines what a processor can do, but your hardware functional units define how it gets done. Every time the CPU fetches an instruction, the control unit must map that instruction to a specific path through the hardware.
Think of this like a train track switching system. Depending on the instruction, the hardware must route data through different "stations":
- Arithmetic/Logic Instructions (e.g.,
ADD R1, R2, R3): These instructions require the ALU (Arithmetic Logic Unit). The control unit uses multiplexers to route the data from the register file into the ALU input ports and sets the ALU operation mode to "Add." - Memory Access Instructions (e.g.,
LOAD R1, 0(R2)): These instructions bypass the ALU for calculation (or use it briefly to add an offset) and activate the Data Memory interface. The address is sent to the memory unit, and the "Read" control signal is enabled to pull data back into a register. - Branch Instructions (e.g.,
BEQ R1, R2, target): These instructions utilize the Program Counter (PC) update logic. The ALU is often used here to perform a comparison (subtracting R1 and R2 to check for zero). If the condition flag is met, the result is used to update the PC, effectively changing the path of execution.
The Logic of Selection
The "mapping" happens via the Control Unit, which acts as the traffic controller. By decoding the instruction’s opcode, the hardware sends high/low signals to the multiplexers we studied earlier. For instance:
// If Opcode == ADD
Select_ALU_Source = REGISTER;
ALU_Operation = ADD_FUNCTION;
Write_Enable_Register = TRUE;
By switching these control signals, the same set of registers and adders can perform a memory load in one cycle and an addition in the next. You aren't building a new circuit for every line of code; you are simply reconfiguring the electrical path through the functional units you have already built.
Key Takeaway: Instruction mapping is the process of using control signals to route data through the appropriate functional units—such as the ALU for calculations, memory for data storage, or the PC logic for control flow—to satisfy the specific requirements of each ISA instruction.