DOC PREVIEW
AUBURN ELEC 7770 - Component descriptions

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Component descriptions:Program Counter (PC) This 32 bit edge-triggered register holds the memory address of the next instruction to be loaded from memory.Memory This edge-triggered memory device holds both instructions and data. It is addressed by either the ALU_OUT or the PC.Instruction Register An edge-triggered 32 bit register used to store the output of the memory (instructions only) so that it may be accessed in the 2nd CPU cycle.Register File This structure contains all of the registers numbered #0-#31. It has 4 inputs [Read R1/R2, Write Reg/Data] and 2 outputs [Read Data 1/2 ]. The loading of this register file is controlled by an edge triggered write enable, Reg_write.ALU The core of the MIPS CPU has 3 inputs and 2 outputs. Two of the inputs [32 bits] are the operands and the third input is the operator. A zero flag is set if the value of the result [32 bits], another output, is all zeros. During R-type instructions the ALU performs operations on two values from the register file. During I type instructions, one of the operands [rs] comes from the register file, the other operand comes froman constant/offset that is either zero or sign extended.Performs AND, OR, ADD, SUB, SLT based on function select bitsAdder This component simply adds the 2 operands that are selected by multiplexers. This component is needed to be able to compute the next instruction[PC+4] or a branch address. [PC’+BranchAddr, PC’ is PC+4 from the 1st cycle of execution]Sign Extender This component is simply an AND gate with its it inputs being a control line Signex_EN and IR[15]. When the Sign extend enable bit is activated to logic 1 and if IR[15] is 1 [a negative 2’s complement constant] then the output will be routed to the upper 16 bits of IMM_Value. Any other case the upper bits will be all zeros.Shift Left by 2 Unit This component shifts the value of IMM_Value by 2 bits to the left.Multiplexers – These devices set up the data pathway for each instruction. The name and purpose of each are as follows:- PC_LoadSelecto This chooses which value to store in the PC. For JR, the PC is set to the register specified in the rs field, otherwise the PC is either set to the output Sel_Jump or if a branch instruction proved to evaluate to false, the current PC is not changed. This feedback of the PC is needed because is PC_Write signal is going to be active in all cycles except for during the R-type and the non-branch I-type instructions.- Sel_JUMPo This chooses either the output of the adder or the Jump address for J and JAL instructions.- PC_ALUo This mux chooses whether to address the memory with the PC or a computed memory location.- Br_seto A mux to choose the constant 4 in the first cycle and the output of the of the shift left unit in the second cycle.- Reg_selo This mux picks which register is to be written to during the 2nd cycle. R#31 is hardwired because JAL is a J-type instruction and does not explicitly encode R#31 in the instruction.- WRDatao This mux selects which data is to be sent to the register file. For JAL instructions,it is PC’ (PC+4). For LUI it is the zero extended IR[15-0]. For other R and I type, it is ALU_OUT.- IMM_Rtypeo This mux selects the 2nd input to the ALU. For I type, the ALU receives IMM_Value, and for R type instructions, the ALU receives Read Data 2 (rt). This symbol on the CPU diagram simply means that the inputs are concatenated together to form a new signal.Instruction Formats: MIPS type instruction set with limited instructions implementedR type:OPCODE RS RT RD UNUSED31 26 25 21 20 16 15 11 10 0I type:OPCODE RS RT IMMEDIATE31 26 25 21 20 16 15 0J type:OPCODE ADDRESS31 26 25 0Register Transfers by InstructionFor all instructions, the 1st cycle is the same since every instruction needs to be fetched and decoded.1st Cycle: IR=Memory[PC]PC=PC+4The following transfers take place in the 2nd Cycle:LW ALU_OUT=[rs+signextended(offset)]rt=Memory[ALU_OUT]SW ALU_OUT=[rs+signextended(offset)]Memory[ALU_OUT]=rtLUI rt=zeroExtended(immediate)ADD ALU_OUT=rs+rtrd=ALU_OUTADDI ALU_OUT=rs+signextended(immediate)rt=ALU_OUTSUB ALU_OUT=rs - rtrd=ALU_OUTAND ALU_OUT =rs AND rtrd=ALU_OUTANDI ALU_OUT=rs && signextended(immediate)rt=ALU_OUTOR ALU_OUT =rs AND rtrd=ALU_OUTORI ALU_OUT=rs || signextended(immediate)rt=ALU_OUTSLT ALU_OUT=rs <SLT> rt // The ALU has SLT selected by the function select.rd=ALU_OUTSLTI ALU_OUT=rs <SLT> signextened(immediate)// The ALU has SLT selected by the function select which now is set by the controller and not the instruction.rt=ALU_OUTBEQ ALU=rs - rtPC=PC+ShiftedLeftby2(signextended(offset))BNE ALU=rs - rtPC=PC+ShiftedLeftby2(signextended(offset))//based on the zero flag and opcode, the controller will select if the computed address is actually loaded into PCJ PC=PC(31-28)&IR(25-0)&(“00”)JAL R#31=PC //PC is already PC+4 from 1st cyclePC=PC(31-28)&IR(25-0)&(“00”)JR


View Full Document

AUBURN ELEC 7770 - Component descriptions

Download Component descriptions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Component descriptions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Component descriptions 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?