This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: LSU EE 4720 Homework 3 Solution Due: 20 March 2006 Review Fall 2004 Final Exam Problem 2, which was discussed in class on Monday, 13 March 2006. Problem 1: Using the solution to Fall 2004 Final Exam problem 2 parts a, b, and d (but not c) as a starting point, make changes to implement a new two-source register MM instruction add.mmr which operates as shown in the example below. Hint: The solution requires a register file modification. add.mmr (r1), (r2), r3 # Mem[r1] = Mem[r2] + r3 Solution shown below. The add.mmr instructions use three register source operands and so a third read port must be added to the register file, that is shown below in blue . The new register value, rdv , is used as the store address for the sum. The diagram below also shows, in green , the bypass connections used in the solution to Problem 3 (but not the branch condition bypasses used in Problem 4). format immed IR Addr 25:21 20:16 IF ID EX WB MEM rsv rtv IMM NPC ALU Addr Data Data Addr D In +1 PC Mem Port Addr D out rxv dst dst Decode dest. reg 30 2 "0" + 15:0 25:0 29:26 29:0 Addr Mem Port D out Addr D in Mem Port D out ALU MD dst dst rsv rtv IMM MS mem dst mem src (rsv) mem dst mem src Addr Data rdv 15:11 rdv Problem 2: Your boss, a stuck-in-the-twentieth-century RISC true believer who only grudgingly agreed to include add.mm , add.mr , add.rm , and add.mmr in MMMIPS, flies into an incoherent rage when you suggest also adding add.mmm to MMMIPS. What pushed your boss over the edge? (That is, why is add.mmm much harder to add to the implementation in the Fall 2004 exam than add.mmr .) Instruction add.mmm operates as shown below: add.mmm (r1), (r2), (r3) # Mem[r1] = Mem[r2] + Mem[r3] Unlike the other memory-memory instructions, add.mmm must read two source operands from memory. To do that without stalling the pipeline would require a second memory port in the MS stage, which is expensive. The alternative is having add.mmm spend two cycles in MS, but that would mean stalling the pipeline which is not something you want to do for reasons other than dependencies. Problem 3:...
View Full Document
- Spring '08