Building A Data Path - Processor - Digital Principles and Computer Organization
Building A Data Path - Processor - Digital Principles and Computer Organization
Home | All Subjects | CSE Department | Digital Principles and Computer Organization
<< Previous Next >>
The MIPS implementation includes, the datapath elements (a unit used to operate on or hold data within a processor) such as the
instruction and data memories, the register file, the ALU, and adders.
• The instruction memory stores the instructions of a program and gives instruction as an output corresponding to the
address specified by the program counter. The adder is used to increment the PC by 4 to the address of the next instruction.
• Since the instruction memory only reads, the output at any time reflects the contents of the location specified by the
address input, and no read control signal is needed.
• The program counter is a 32-bits register that is written at the end of every clock cycle and thus does not need a write
control signal.
• The adder always adds its two 32-bits inputs and place the sum on its output.
https://cse.poriyaan.in/topic/building-a-data-path-50732/ 1/6
11/6/24, 3:09 PM Building a Data Path - Processor - Digital Principles and Computer Organization
• For each data word to be read from the register file, we need to specify the register number to the register file. On the other
hand, to write a data word, we need two inputs: One to specify the register number to be written and one to supply the data
to be written into the register.
•The register file always outputs the contents of whatever register numbers are on the Read register inputs. Write operations,
however, are controlled by the write control (Reg W) signal. This signal is asserted for a write operation at the clock edge.
• Since writes to the register file are edge-triggered, it is possible to perform read and write operation for the same register
within a clock cycle: The read operation gives the value written in an earlier clock cycle, while the value written will be
available to a read in a subsequent clock cycle.
• As shown in Fig. 7.3.2, the register number inputs are 5 bits wide to specify one of 32 registers, whereas the data input and
two data output buses are each 32 bits wide.
• Sign extension is implemented by replicating the high-order sign bit of the original data item in the high-order bits of the
larger, destination data item.
• Therefore, two units needed to implement loads and stores, in addition to the register file and ALU of Fig. 7.3.2, are the
data memory unit and the sign extension unit.
• The architecture also states that the offset field is shifted left 2 bits so that it is a word offset; this shift increases the
effective range of the offset field by a factor of 4.
• Therefore, the branch target address is given by
Branch target address = PC+4 + offset (shifted left 2 bits)
• In addition to computing the branch target address, we must also see whether the two operands are equal or not. If two
operands are not equal the next instruction is the instruction that follows sequentially (PC= PC+4); in this case, we say that
the branch is not taken. On the other hand, if two operands are equal (i.e., condition is true), the branch target address
becomes the new PC, and we say that the branch is taken.
• Thus, the branch datapath must perform two operations : Compute the branch target address and compare the
registercontents.
• Fig. 7.3.5 shows the structure of the datapath segment that handles branches.
• To compute the branch target address, the branch datapath includes a sign extension unit, shifter and an adder.
• To perform the compare, we need to use the register file and the ALU shown in Fig. 7.3.2.
• Since the ALU provides an Zero signal that indicates whether the result is 0, we I can send the two register operands to the
ALU with the control set to do a subtract operation. If the Zero signal is asserted, we know that the two values are equal.
• For jump instruction lower 28 bits of the PC are replaced by lower 26 bits of the instruction shifted left by 2 bits and
making two LSB bits 0. This can be implemented by simply concatenating 00 to the jump.
• In the MIPS instruction set, branches are delayed, meaning that the instruction immediately following the branch is always
executed, independent of whether the branch condition is true or false. When the condition is false, the execution looks like
a normal branch. When the condition is true, a delayed branch first executes the instruction immediately following the
branch in sequential instruction order before jumping to the specified branch target address.
https://cse.poriyaan.in/topic/building-a-data-path-50732/ 3/6
11/6/24, 3:09 PM Building a Data Path - Processor - Digital Principles and Computer Organization
• We can make a simple datapath for the core MIPS architecture by adding the datapath for instruction fetch, the datapath
from R-type and memory instructions, and the datapath for branches as shown in the Fig. 7.3.7.
Review Questions
1. Draw and explain the datapath to implement instruction fetch and PC increment operations.
2. Draw and explain the datapath segment for arithmetic-logic instructions.
3. Draw and explain the datapath segment for load word and store word instructions.
4. Draw and explain the datapath segment for computation of branch target address.
5. Explain the structure of the datapath segment that handles branches with the help of block diagram.
6. Draw and explain the simple combine datapath for the MIPS architecture.
7. Explain data path in detail. AU: Dec.-14, Marks 8
https://cse.poriyaan.in/topic/building-a-data-path-50732/ 4/6
11/6/24, 3:09 PM Building a Data Path - Processor - Digital Principles and Computer Organization
Digital Principles and Computer Organization: Unit IV: Processor : Tag: : Processor - Digital Principles and Computer
Organization - Building a Data Path
Home | All Subjects | CSE Department | UNIT: Digital Principles and Computer Organization
<< Previous Next >>
Related Topics
Comparison Between Hardwired and Microprogrammed Control Units - Processor - Digital Principles and Computer
Organization
Pipelined Datapath and Control - Processor - Digital Principles and Computer Organization
Two marks Questions with Answers - Processor - Digital Principles and Computer Organization
Related Subjects
CS3351 3rd Semester CSE Dept | 2021 Regulation | 3rd Semester CSE Dept 2021 Regulation
https://cse.poriyaan.in/topic/building-a-data-path-50732/ 5/6
11/6/24, 3:09 PM Building a Data Path - Processor - Digital Principles and Computer Organization
We provide Notes, Study material pdf download, lecture notes, important questions and answers, University question paper pdf download,
Question bank for Engineering students in Tamilnadu under Anna University Affiliated colleges. EEE, ECE, MECH, CIVIL, CSE, IT are the major
departments covered by our website. [2021 Regulation, All 8 semester, All 4 years ]
About | Contact Us | Privacy Policy | Terms and Conditions | Disclaimer | DMCA Complaint | Upload Content | Send Content
https://cse.poriyaan.in/topic/building-a-data-path-50732/ 6/6