310 likes | 431 Views
Computer Organization Lecture 12. Branch control Jump control Controller FSM. ck2. ck3. ck1. ck4. ck5. Datapath and controller. Controller Input. Datapath timing overview. Clocks vary from 3 – 5 Clocks 1 and 2 the same for all instructions R-type: 2 more Memory reference
E N D
Computer OrganizationLecture 12 Branch control Jump control Controller FSM University of Portland School of Engineering
ck2 ck3 ck1 ck4 ck5 Datapath and controller Controller Input University of Portland School of Engineering
Datapath timing overview • Clocks vary from 3 – 5 • Clocks 1 and 2 the same for all instructions • R-type: 2 more • Memory reference • Store: 2 more • Load: 3 more • Branch, Jump: 1 more University of Portland School of Engineering
R-type instruction timing Clock Function Register Write Instruction Fetch Instruction Fetch Decode, Reg Read University of Portland School of Engineering
00 00 10 Complete R-type University of Portland School of Engineering
Store instruction timing Clock Memory Write Instruction Fetch Instruction Fetch Decode, Reg Read Address Calculation University of Portland School of Engineering
00 00 00 Complete store word University of Portland School of Engineering
Load instruction timing Clock Reg Write Memory Read Instruction Fetch Instruction Fetch Decode, Reg Read Address Calculation University of Portland School of Engineering
00 00 00 Complete load word University of Portland School of Engineering
Branch (beq) execution Clock 3 • Operation • If (A = = B), PC = ALUout • ALUout = branch address from clock 2 • Functional units • ALU must sub, A-B • ALUout contains optimistic branch address • Zero flag controls write to PC University of Portland School of Engineering
Control for branch (beq)? University of Portland School of Engineering
01 00 00 Complete beq University of Portland School of Engineering
Beq Instruction Timing Clock ALU Subtract Instruction Fetch Instruction Fetch Decode, Reg Read University of Portland School of Engineering
Jump execution Clock 3 • Operation • PC = PC[31-28] || (IR[25-0]<<2) • PC always written • Functional units • Instruction register • Upper 4 bits of PC University of Portland School of Engineering
Control for jump? University of Portland School of Engineering
Jump instruction timing Clock Write PC Instruction Fetch Instruction Fetch Decode, Reg Read University of Portland School of Engineering
00 00 Complete jump University of Portland School of Engineering
Controller and datapath Outputs Outputs Inputs IR(31:25) University of Portland School of Engineering
Outputs Inputs NS Decoder Output Decoder Present State Flip Flops Combo logic ROM MUX Decoder Combo logic ROM MUX FSM architecture University of Portland School of Engineering
Ten one-bit outputs University of Portland School of Engineering
Three two-bit outputs University of Portland School of Engineering
2 Clk 1-3 Clk State diagram overview All instructions require IF, ID (2 clk’s) University of Portland School of Engineering
State diagram notation Current State condition condition Signal1 Previous States Next States Signal2 = 0 condition Signal3 = 00 condition Signals not listed are “don’t cares” University of Portland School of Engineering
Full FSM state diagram Inputs:Op Outputs: 13 signals States: 10 University of Portland School of Engineering
Add state diagram Inputs:Op Outputs: 13 signals States: 10 S0 S1 S6 S7 S0 University of Portland School of Engineering
Add instruction timing Clock S0 S1 S6 S7 Add Operands Register Write Instruction Fetch Instruction Fetch Decode, Reg Read University of Portland School of Engineering
Find the state transitions? University of Portland School of Engineering
01 Control for branch (beq)? Clock 3 Optimistic branch address University of Portland School of Engineering
Control for jump? Clock 3 University of Portland School of Engineering
Find the state transitions? University of Portland School of Engineering