Upload
drake
View
63
Download
0
Embed Size (px)
DESCRIPTION
240-334 Computer System Design Lecture 4. Wannarat Suntiamorntut. Part I : Single Data Path. Outline. Design a Processor step by step Requirement of instruction set Components and clocking Testing Datapath Control Datapath. Processor. Datapath. M E M O R Y. Input. Control. - PowerPoint PPT Presentation
Citation preview
240-334 By Wannarat
-240334
Computer Syste m Design 4Lecture
Wannarat Suntiamorntut
240-334 By Wannarat
PartI :Si ngl e Data Path
240-334 By Wannarat
Outl i ne Design a Processor step by step Requirement of instruction set Components and clocking Testing Datapath Control Datapath
240-334 By Wannarat
Fi ve Component o f Computer
Datapath
Control
Processor
MEMORY
Input
Output
240-334 By Wannarat
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
240-334 By Wannarat
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
240-334 By Wannarat
MI PSI nstructi o nFormat
240-334 By Wannarat
Step 1 AA A A rd,rs,rt SUBUrd,rs,rt
ORI rt, rs, imm1 6
240-334 By Wannarat
Step 1 16 16lw rt, rs ,imm sw rt, rs, imm
16beq rs, rt, imm
240-334 By Wannarat
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
240-334 By Wannarat
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
240-334 By Wannarat
Step 2 : Compon ents of datapath
Combination Element Storage elements
Clocking methodology
240-334 By Wannarat
Combination Elements
Adder MUX
240-334 By Wannarat
Combination Elements
ALU
240-334 By Wannarat
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
240-334 By Wannarat
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
240-334 By Wannarat
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.
240-334 By Wannarat
Clock Methodology
240-334 By Wannarat
Step 3 : Register Transfer Requirements
-- AAAAAAAA AAAAAAAA> Instruction Fetch Read Operands and Execute Operati
AA
240-334 By Wannarat
Step 3 a : Instruc tion Fetch Unit
Update PC : Sequence Code: PC <= PC + 4 - Branch and Jump : PC < something else
240-334 By Wannarat
Step 3b : Add &Sub
240-334 By Wannarat
-Register Regist er Timing
240-334 By Wannarat
3Step c :Logical Opera AAAA AAAAAA.
240-334 By Wannarat
Step 3d: Load operations
240-334 By Wannarat
Step 3e : StoreOperations
240-334 By Wannarat
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;
240-334 By Wannarat
Datapath for Br anch Operations
240-334 By Wannarat
Put it all together
240-334 By Wannarat
Abstract vi ewof cri t i cal path
240-334 By Wannarat
Step 4 : ControlPath
240-334 By Wannarat
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 ) ||
240-334 By Wannarat
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.
240-334 By Wannarat
Control Signals
240-334 By Wannarat
5Step : Logic for eaAA AAAAAAA AAAAAA
240-334 By Wannarat
Example:LoadFl ow
240-334 By Wannarat
Abstract View ofimplementation
240-334 By Wannarat
AA AAAAAAA A5