1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Extending MIPS datapath to implement SLL and SRL

  1. Oct 25, 2015 #1
    1. The problem statement, all variables and given/known data
    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.


    3. 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?
     
  2. jcsd
  3. Oct 25, 2015 #2
    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?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Extending MIPS datapath to implement SLL and SRL
  1. LUT implementation (Replies: 1)

  2. Mips subroutines (Replies: 1)

  3. MIPS help (Replies: 1)

Loading...