ECE314sp08_HW4 - ECE/CS 314 Spring 2008 Hung Dang hvd2...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ECE/CS 314 Spring 2008 Hung Dang hvd2 Homework 4 Due Tuesday, March 11, 2008 before 10:00pm EST Problem 1. (30 points) During the discussion of the single cycle processor in class several interesting MIPS instructions were not mentioned. For each of the following instructions describe how to modify the single cycle datapath to implement these instructions. If no modifications are necessary, explain how the datapath could execute the instruction. You may describe your answers in words or draw your answer on the datapath diagram shown on the last page of the assignment or do both. Please try to be as specific and clear in your answers as you can! a) Load Upper Immediate: lui No modifications are necessary. The immediate field is loaded into the ALU. ALU is used to do the left shifting operation to the immediate field with shift amount of 16. The ALU’s output is to be written back to the destination register hence data source to the W input for Reg File is the ALU’s output and WE is 1. There is no memory read or write so DMC should be zero. b) Jump and Link: jal Modifications are necessary since the calculation of target PC is different from that of branch instructions. The jump target address is obtained by shifting the lower 26 bits (immediate field) of the jumping instruction left 2 bits adding two low-order zero bits in the process. The result is then concatenated with the upper 4 bits of PC + 4 as the high- order bits. For the multiplexor near PC, it is rewired to choose between the jump target and either the branch target or the next instruction instead of between next instruction and branch target. This multiplexor is controlled by the jump control signal. For the linking part, PC+4 is the data source to the W input of Reg File and the destination register is register 31 thus two multiplexors are added. One is used to choose between register 31 or
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/03/2008 for the course ECE 3140 taught by Professor Mckee/long during the Spring '07 term at Cornell University (Engineering School).

Page1 / 5

ECE314sp08_HW4 - ECE/CS 314 Spring 2008 Hung Dang hvd2...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online