In this lesson, you will learn how to physically connect the register file to the ALU to transform stored data into meaningful computation within a single-cycle architecture.
The Bridge Between Storage and Calculation
So far, you’ve learned how the Register File acts as the "scratchpad" memory for your CPU, and how the ALU performs the actual math. However, they are useless unless they can talk to each other. In a single-cycle design, we treat these two components as the heart of our data path.
To perform an operation like ADD R3, R1, R2 (which means: "Add the contents of R1 and R2 and store the result in R3"), the data flow must be seamless:
- Read: The CPU directs the register file to output the values stored in
R1andR2. - Route: These two values are sent directly into the two input ports of the ALU.
- Compute: The ALU control signal, which you’ve already mastered, tells the ALU to perform an addition on those specific inputs.
- Write: The result output by the ALU is fed back to the register file's "write data" port, while the register index
R3is sent to the "write address" port.
Visualizing the Data Path
Think of the register file as a set of labeled mailboxes. When we "integrate" them, we are effectively installing a conveyor belt that takes mail from two specific boxes, runs it through a calculator, and drops the answer into a destination box.
[Register File]
Read Data 1 ----> [ ALU ] ----> Write Data
Read Data 2 ----> [ ALU ]
Crucially, in a single-cycle architecture, this entire process happens in one steady tick of the clock. By the time the clock signal transitions, the data from the registers has traveled through the ALU logic and returned to the register file, ready to be saved. We use Control Signals to ensure the register file knows when to accept that new result, preventing old data from being overwritten prematurely. By wiring these components together, you have created a functional "execution unit" capable of actual arithmetic.
Key Takeaway: Integrating the register file and ALU creates a closed loop where data is fetched, processed by the ALU, and written back to memory in a single continuous cycle.