Post on 20-Jan-2016
241-440 @ W.S.
241-440 Computer Syste
m Design Lecture 4
Wannarat Suntiamorntut
241-440 @ W.S.
Part I : Single D ata Path
241-440 @ W.S.
Outline Design a Processor step by step Requirement of instruction set Components and clocking Testing Datapath Control Datapath
241-440 @ W.S.
Five Componen t of Computer
Datapath
Control
Processor
MEMORY
Input
Output
241-440 @ W.S.
Performance Perspective Performance of machine is determin
ed by CPI Processor Design :
clock cycle time clock per instruction
Single cycle processor : adv. : one clock cycle per instruction
disadv. : long cycle time
241-440 @ W.S.
Design Process or Step by Step
1. Analyze instruction set ==> Datapa th requirement
2. Selection Set of datapath and estab lish clocking methodology
3 . Assembly datapath meeting requirement 4.Analyze implementation of each instruct
i ontodetermi ne setti ngof control 5.Assembly the control logic
241-440 @ W.S.
MIPS Instructio n Format
241-440 @ W.S.
Step 1 AA A A rd,rs,rt SUBUrd,rs,rt
ORI rt, rs, imm1 6
241-440 @ W.S.
Step 1 16 16lw rt, rs ,imm sw rt, rs, imm
16beq rs, rt, imm
241-440 @ W.S.
AAA All instructions start by fetching
Mem[PC] ADDU rd <= rs + rt; PC = PC + 4
SUBU rd <= rs + rt; 4PC = PC +Ori rt <= rs + zero_ext(imm16);PC = PC + 4
16LOAD rt <= mem[rs] + sign_ext(imm ); PC=PC +4
STORE mem[rs] + sign_ext(imm16)<=rt; PC=PC+4BEQ 16 00if rs = rt then PC=PC+sign_ext(imm )||
else PC = PC + 4
241-440 @ W.S.
1Step : The requirement froA AAAAAAAAAAA
Memory Data & Instruction
Register (32 x 32) Read rs AAAA AA AAAAA AA AA AA
PC AAAAAAAA AAA AAA AAA AAAAAAAA AA AAAAAA AAAAAAAAA Add 4 or extended immediate to PC
241-440 @ W.S.
Step 2 : Compon ents of datapath
Combination Element Storage elements
Clocking methodology
241-440 @ W.S.
Combination Elements
Adder MUX
241-440 @ W.S.
Combination Elements
ALU
241-440 @ W.S.
Storage Elemen t : Register
-Similar to D flip/flop A AAAA AAAAAA
AAAA AAA (0) : AAAAAA’
asserted(1 ) : Data out wi l l be data i n
241-440 @ W.S.
Register file 32Consist of registers
A A AAAAAA AAAAAAAA AA AAA A Rbsel ect regi ster tobus B Rw select register to be written via bus W
241-440 @ W.S.
Storage : IdealMemory One Input One Output Memory word is selected
by Address, Write enable = 1 then the data will be written
Clock input : is a factor only during write operation
During read operation : behaves on com bination logic.
241-440 @ W.S.
Clock Methodology
241-440 @ W.S.
Step 3 : Register Transfer Requirements
-- AAAAAAAA AAAAAAAA> Instruction Fetch Read Operands and Execute Operati
AA
241-440 @ W.S.
Step 3 a : Instruc tion Fetch Unit
Update PC : Sequence Code: PC <= PC + 4 - Branch and Jump : PC < something else
241-440 @ W.S.
Step 3b : Add &Sub
241-440 @ W.S.
-Register Regist er Timing
241-440 @ W.S.
3Step c :Logical Opera AAAA AAAAAA.
241-440 @ W.S.
Step 3d: Load operations
241-440 @ W.S.
Step 3e : StoreOperations
241-440 @ W.S.
Step 3f: Branchinstruction
AAA AA A AAA16
[ ] A AA<= = if (con eq 0 ) then PC<=PC+4 +(sig
nExt(imm16)x4); else PC <= PC + 4;
241-440 @ W.S.
Datapath for Br anch Operations
241-440 @ W.S.
Put it all together
241-440 @ W.S.
Abstract view of critical path
241-440 @ W.S.
Step 4 : ControlPath
241-440 @ W.S.
Meaning of cont rol signal
Rs, Rt and Imme16 hardwire to datapaAA
nPC_sel : 0 => PC PC<= PC+4, 1 => PC PC <= PC + 4 +
16 00signExt(Imm ) ||
241-440 @ W.S.
Meaning of cont rol signals
ExtOp : Zero, sign MemWr :write memoryALUsrc: 0=>regB, 1=>imme Memtoreg:1=>memALUcrt : add, sub, or
ReqWr : write dest. Reg.
241-440 @ W.S.
Control Signals
241-440 @ W.S.
5Step : Logic for eaAA AAAAAAA AAAAAA
241-440 @ W.S.
Example : LoadFlow
241-440 @ W.S.
Abstract View ofimplementation
241-440 @ W.S.
AA AAAAAAA A5