0% found this document useful (0 votes)
36 views3 pages

Building a Datapath in Computer Architecture

Uploaded by

esomnath2006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

Building a Datapath in Computer Architecture

Uploaded by

esomnath2006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

BUILDING DATA PATH AND CONTROL IMPLEMENTATION SCHEME


Datapath
• Components of the processor that perform arithmetic operations and holds data.
Control
· Components of the processor that commands the datapath, memory, I/O devices
according to the instructions of the memory.
Building a Datapath
• Elements that process data and addresses in the CPU - Memories, registers,
ALUs.
• MIPS datapath can be built incrementally by considering only a subset of
instructions
• 3 main elements are

Fig. 3.2.1 Datapath


[source : V. Carl Hamacher, Zvonko G. Varanesic and Safat G. Zaky, ―Computer Organization]
A memory unit to store instructions of a program and supply instructions given
an address. Needs to provide only read access (once the program is loaded).- No control
signal is needed .PC (Program Counter or Instruction address register) is a register that
holds the address of the current instruction

• A new value is written to it every clock cycle. No control signal is required to


enable write
• Adder to increment the PC to the address of the next instruction

EC - 8552 COMPUTER ARCHITECTURE AND ORGANIZATION


ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

An ALU permanently wired to do only addition. No extra control signal required

Fig. 3.2.2 Datapath portion for Instruction Fetch Types of Elements in the
Datapath
[source : V. Carl Hamacher, Zvonko G. Varanesic and Safat G. Zaky, ―Computer Organization]

State element:
• A memory element, i.e., it contains a state
E.g., program counter, instruction memory Combinational element:
• Elements that operate on values
Eg adder ALU E.g. adder, ALU

Elements required by the different classes of instructions

• Arithmetic and logical instructions


• Data transfer instructions
• Branch instructions R-Format ALU Instructions
• E.g., add $t1, $t2, $t3

EC - 8552 COMPUTER ARCHITECTURE AND ORGANIZATION


ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY

• Perform arithmetic/logical operation


• Read two register operands and write register result Register file:
• A collection of the registers
• Any register can be read or written by specifying the number of the register
• Contains the register state of the computer

Read from register


• inputs to the register file specifying the numbers
• bit wide inputs for the 32 registers
• outputs from the register file with the read values
• 32 bit wide
• For all instructions. No control required.

Write to register file


• 1 input to the register file specifying the number 5 bit wide inputs for the 32
registers
• 1 input to the register file with the value to be written 32 bit wide
• Only for some instructions. RegWrite control signal.

ALU

• Takes two 32 bit input and produces a 32 bit output


• Also, sets one-bit signal if the results is 0
• The operation done by ALU is controlled by a 4 bit control signal input. This is
set according to the instruction .

EC - 8552 COMPUTER ARCHITECTURE AND ORGANIZATION

Common questions

Powered by AI

Executing R-Format ALU instructions in the MIPS architecture involves specific control mechanisms to direct the datapath appropriately. These instructions require several control signals: RegDst to select the destination register, ALUOp to indicate the precise ALU operation, and RegWrite to enable writing the result back to the register file. These control signals guide the flow of data through the datapath, ensuring the correct registers are read and written, the correct ALU operation is performed, and the outcome is stored in the appropriate location. This controlled flow ensures that the instruction executes as intended without interference from other concurrent operations .

The register file in a MIPS datapath allows both reading and writing operations by utilizing specified inputs that determine the registers involved. For reading, any register can be accessed by specifying its number, utilizing bit-wide inputs for the 32 registers and generating 32-bit wide outputs. For writing, the register file requires an input to specify the register number with 5-bit wide inputs and another input with the 32-bit wide value to be written. Writing to the register file occurs only for certain instructions, necessitating the RegWrite control signal to enable this operation .

Within the MIPS architecture, state elements like the Program Counter (PC) and combinational elements like the ALU serve different roles that together enhance processing capabilities. The PC is a state element that stores the current instruction address, facilitating orderly instruction sequencing and ensuring that the execution flow follows the program logic by holding and updating its state over time. In contrast, the ALU is a combinational element that performs real-time arithmetic and logical operations. Its design does not involve storing state; instead, it operates solely on the given inputs to produce immediate outputs. The PC's design secures the execution sequence by maintaining state continuity, while the ALU provides computational power, demonstrating how their combined functionality allows the processor to manage control flow and data processing effectively .

An ALU that is permanently wired for addition is used in the instruction fetch process to compute the address of the next instruction by incrementing the current value of the Program Counter (PC). This process is a fundamental part of the instruction fetch cycle, ensuring a sequential flow of instructions by calculating the address of the subsequent instruction without needing any control signal modifications. The simplicity of an ALU permanently wired for addition supports the rapid and consistent updating of the PC each clock cycle, which is critical for maintaining the flow of execution in a pipelined architecture .

The adder in the context of the MIPS processor is crucial for updating the Program Counter (PC) during each execution cycle. Its primary function is to increment the PC by a constant value, typically the size of an instruction (such as 4 bytes in a 32-bit architecture), which computes the address of the next instruction in sequence. This operation is automatic and does not require external control signals, thereby simplifying the control logic needed for instruction sequencing. By continuously updating the PC, the adder supports the smooth flow of the instruction pipeline, enabling the processor to efficiently move to consecutive instructions .

The memory unit associated with instruction storage within the MIPS datapath operates by storing the instructions of a program and supplying them based on the address provided by the Program Counter (PC). It is designed to provide only read access post-program load, meaning that it cannot be written to during execution, as its primary function is to deliver instructions for execution. This setup ensures that instructions remain immutable during execution, facilitating consistent retrieval and processing of instructions throughout the program lifecycle .

State elements in the MIPS datapath, such as the Program Counter and instruction memory, contain state information because they store data over time. These elements are crucial for maintaining and providing data and instruction addresses during processing. In contrast, combinational elements, like adders and ALUs, perform operations based on input values without storing them. These elements process data as it flows through the datapath, enabling arithmetic and logical operations required by the instructions. Together, they allow the MIPS datapath to efficiently handle instruction processing by storing necessary elements of the processor state while also performing calculations and logic operations as needed .

The ALU in a MIPS processor is controlled by a 4-bit control signal that determines the specific operation to perform based on the type of instruction being executed. When executing arithmetic instructions, the ALU takes two 32-bit inputs, performs the specified operation such as addition or subtraction, and produces a 32-bit output. Additionally, the ALU sets a one-bit signal if the result of the operation is zero, which is useful for certain conditional operations. This control allows the ALU to execute a range of arithmetic operations efficiently without additional control complexity .

Arithmetic and logical instructions in MIPS architecture are distinct from data transfer instructions by their focus on performing operations on data, such as addition or logical comparisons, using the ALU. These instructions read two register operands and write the result back to a register, involving the ALU and register file. In contrast, data transfer instructions move data between memory and registers, utilizing memory access and the register file. They do not require the ALU for computation but instead rely heavily on the memory hierarchy for transferring data into and out of registers .

In a MIPS processor, the Program Counter (PC) holds the address of the current instruction being executed. Its value is updated automatically every clock cycle by an adder that increments it to point to the address of the next instruction. This process does not require any additional control signals to write the new value into the PC .

You might also like