Extending MIPS datapath to implement SLL and SRL

  • Thread starter Thread starter izelkay
  • Start date Start date
  • Tags Tags
    Mips
Click For Summary
SUMMARY

The discussion focuses on extending the MIPS datapath to implement Shift Left Logical (SLL) and Shift Right Logical (SRL) operations. The proposed solution involves adding a multiplexer (mux) adjacent to the Read Data 1 line from the register file, which selects between Read Data 1 (rs) and Read Data 2 (rt) based on whether a shift operation is being performed. Additionally, the shift amount is extracted from Instruction[10:6] and routed through another mux to the ALU, ensuring proper handling of the shift operation. This approach effectively integrates SLL and SRL into the existing MIPS architecture.

PREREQUISITES
  • MIPS architecture fundamentals
  • Understanding of datapath components
  • Knowledge of multiplexers (mux) and their functionality
  • Familiarity with ALU operations and instruction encoding
NEXT STEPS
  • Study MIPS datapath design and modifications
  • Learn about the implementation of multiplexers in digital circuits
  • Explore ALU design and its role in executing shift operations
  • Investigate instruction encoding and decoding in MIPS architecture
USEFUL FOR

Computer architecture students, hardware engineers, and anyone involved in designing or modifying MIPS-based systems will benefit from this discussion.

izelkay
Messages
115
Reaction score
3

Homework Statement


Here's the datapath:
nM8IuyM.png


So this seems like a pretty common question but I can't seem to find any answers on how to extend the datapath to implement SLL and SRL.

The Attempt at a Solution



This is how I would think to do it but I'm not entirely sure:

It would need another mux right next to Read data 1 next to the register file. This mux would take Read data 1 (rs) and Read data 2 (rt) as inputs. It would select Read data 1 if we're not doing a shift operation, and it would select rt if we ARE doing a shift operation (since sll and srl use rt, not rs). This would then be fed into the ALU.

Next, we would need to branch Instruction[10:6] (the shift amount) off of Instruction[15:0], and Instruction[10:6] would then be fed into the other port of the ALU. Is this correct thinking?
 
Physics news on Phys.org
It looks like I'd actually need to feed Instruction[10:6] and Instruction[15:0] into another Mux and have it select Instruction[10:6] when I want to shift, which will then be sent through the sign extender and into the ALU when ALUSrc is set to 1. Right? Anyone?
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
2
Views
2K
Replies
3
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
6K