12_LC3_Instruction_Processing

12_LC3_Instruction_Processing - LC-3 Instruction...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: LC-3 Instruction ProcessingTextbook chapter 4, AgainCMPE12 Fall 200909-2Phases of Instruction ProcessingDecode instructionEvaluate addressFetch operands from memoryExecute operationStore resultFetch instruction from memoryCMPE12 Fall 200909-3Phases of Instruction ProcessingSix basic phases of instruction processingF D EA OP EX SInstruction fetchInstruction decodeEvaluate addressFetch operandsExecuteStore resultNotesNot all phases are needed by every instructionBut all instructions will go through F and DPhases may take more than one clock cycleCMPE12 Fall 200909-4Phases: FetchLoad next instruction (at address stored in PC) from memory into Instruction Register (IR).Copy contents of PC into MAR.Send read signal to memory.Copy contents of MDR into IR.Then increment PC, so that it points to the next instruction in sequence.PC becomes PC+1.EAOPEXSFDCMPE12 Fall 200909-5Phases: DecodeEAOPEXSFDFirst identify the opcodeIn LC-3, this is always the first four bits of instruction.A 4-to-16 decoder asserts a control line corresponding to the desired opcode.Depending on opcode, identify other operands from the remaining bitsExample:for LDR, last six bits is offsetfor ADD, last three bits is second source operandCMPE12 Fall 200909-6Phases: Evaluate AddressEAOPEXSFDFor instructions that require memory access, compute address used for accessExamples:add offset to base register (as in LDR)add offset to PCadd offset to zeroset source registers addressesCMPE12 Fall 200909-7Phases: Fetch OperandsEAOPEXSFDObtain source operands needed to perform the operationExamples:load data from memory (LDR)read data from register file (ADD)CMPE12 Fall 200909-8Phases: ExecuteEAOPEXSFDPerform the operation, using the source operandsExamples:send operands to ALU and assert ADDsignaldo nothing (e.g., for loads and stores)CMPE12 Fall 2009...
View Full Document

This note was uploaded on 12/14/2009 for the course CMPE 12/l taught by Professor Bazeghi during the Fall '09 term at UCSC.

Page1 / 41

12_LC3_Instruction_Processing - LC-3 Instruction...

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

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