© BYU LC3-3 Page 1 ECEn 224 The LC-3 State Machine
© BYU LC3-3 Page 2 ECEn 224 Output Forming Logic Current State Input Forming Logic FF LC-3 Datapath FF.....
© BYU LC3-3 Page 3 ECEn 224 OFLIFL LC-3 Datapath Next State Current State Datapath Control Datapath Status FF.....
© BYU LC3-3 Page 4 ECEn 224 Instruction Fetch Example 1. Copy PC contents to MAR enaPC = 1 & ldMAR= 1 2. Perform memory read selMDR=1 & ldMDR=1 Increment PC selPC = 00 & ldPC = 1 3. Copy memory output register contents to IR enaMDR = 1 & ldIR = 1 IR PC ALU enaPC ldMAR ldPC selPC selMDR ldMDR enaMDR ldIR AB
© BYU LC3-3 Page 5 ECEn 224 CSNS fetch0fetch111xx0x000 fetch1fetch fetch2decode00xx0x011 decode???? ????? enaPC ldMAR selPC ldPC enaMDR ldIR Current State Next State Outputs Fetch Control Sequence selMDR ldMDR
© BYU LC3-3 Page 6 ECEn 224 The Control Logic Examples: IR[8:6] IR[2:0] IR[11:9] BranchTaken
© BYU LC3-3 Page 7 ECEn 224 The Control Logic IRNZP DR SR2selMARselPCaluControlSR1 ldMDRldMARregWEldPCldIR memWE enaMARMenaALUenaMDRenaPC selEAB1selEAB2selMDRflagWE IFL Flip Flops OFL