Top Banner
241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut
37

241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

Jan 20, 2016

Download

Documents

Ralph Hines
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

241-440 Computer Syste

m Design Lecture 4

Wannarat Suntiamorntut

Page 2: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Part I : Single D ata Path

Page 3: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Outline Design a Processor step by step Requirement of instruction set Components and clocking Testing Datapath Control Datapath

Page 4: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Five Componen t of Computer

Datapath

Control

Processor

MEMORY

Input

Output

Page 5: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 6: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 7: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

MIPS Instructio n Format

Page 8: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 1 AA A A rd,rs,rt SUBUrd,rs,rt

ORI rt, rs, imm1 6

Page 9: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 1 16 16lw rt, rs ,imm sw rt, rs, imm

16beq rs, rt, imm

Page 10: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 11: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 12: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 2 : Compon ents of datapath

Combination Element Storage elements

Clocking methodology

Page 13: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Combination Elements

Adder MUX

Page 14: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Combination Elements

ALU

Page 15: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 16: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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

Page 17: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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.

Page 18: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Clock Methodology

Page 19: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 3 : Register Transfer Requirements

-- AAAAAAAA AAAAAAAA> Instruction Fetch Read Operands and Execute Operati

AA

Page 20: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 3 a : Instruc tion Fetch Unit

Update PC : Sequence Code: PC <= PC + 4 - Branch and Jump : PC < something else

Page 21: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 3b : Add &Sub

Page 22: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

-Register Regist er Timing

Page 23: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

3Step c :Logical Opera AAAA AAAAAA.

Page 24: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 3d: Load operations

Page 25: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 3e : StoreOperations

Page 26: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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;

Page 27: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Datapath for Br anch Operations

Page 28: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Put it all together

Page 29: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Abstract view of critical path

Page 30: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Step 4 : ControlPath

Page 31: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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 ) ||

Page 32: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

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.

Page 33: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Control Signals

Page 34: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

5Step : Logic for eaAA AAAAAAA AAAAAA

Page 35: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Example : LoadFlow

Page 36: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

Abstract View ofimplementation

Page 37: 241-440 @ W.S. 241-440 Computer System Design Lecture 4 Wannarat Suntiamorntut.

241-440 @ W.S.

AA AAAAAAA A5