Unformatted text preview:

inst eecs berkeley edu cs61c su05 CS61C Machine Structures Lecture 16 Datapath 2005 07 18 CS 61C L16 Datapath 1 Andy Carle A Carle Summer 2004 UCB Anatomy 5 components of any Computer Personal Computer Computer Processor This week Control brain Datapath brawn Memory where programs data live when running Devices Input Output Keyboard Mouse Disk where programs data live when not running Display Printer CS 61C L16 Datapath 2 A Carle Summer 2004 UCB Outlin e Design a processor step by step Requirements of the Instruction Set Hardware components that match the instruction set requirements CS 61C L16 Datapath 3 A Carle Summer 2004 UCB How to Design a Processor step by step 1 Analyze instruction set architecture ISA datapath requirements meaning of each instruction is given by the register transfers datapath must include storage element for ISA registers datapath must support each register transfer 2 Select set of datapath components and establish clocking methodology 3 Assemble datapath meeting requirements 4 Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5 Assemble the control logic CS 61C L16 Datapath 4 A Carle Summer 2004 UCB Step 1 The MIPS Instruction Formats All MIPS instructions 31 26 are2132 bits 16 long 11 3 formats 6 0 R type 31 I type J type 31 op 6 bits op 6 bits op 6 bits 26 26 rs 5 bits rs 5 bits The different fields are 21 rt 5 bits 16 rd 5 bits rt 5 bits shamt 5 bits funct 6 bits 0 address immediate 16 bits 0 target address 26 bits op operation opcode of the instruction rs rt rd the source and destination register specifiers shamt shift amount funct selects the variant of the operation in the op field address immediate address offset or immediate value target address target address of jump instruction CS 61C L16 Datapath 5 A Carle Summer 2004 UCB Step 1 The MIPS lite Subset for today ADD and SUB addU rd rs rt subU rd rs rt OR Immediate 31 op 31 lw rt rs imm16 sw rt rs imm1631 BRANCH 26 op 6 bits 26 op 6 bits 5 bits 21 rs 6 bits 16 rt 5 bits 26 op 31 21 rs 6 bits ori rt rs imm16 LOAD and STORE Word 26 21 rs 5 bits 21 rs 5 bits 6 0 rd shamt funct 5 bits 5 bits 6 bits 16 rt 5 bits 11 0 immediate 5 bits 16 bits 16 rt 5 bits 0 immediate 16 bits 16 rt 5 bits 0 immediate 16 bits beq rs rt imm16 CS 61C L16 Datapath 6 A Carle Summer 2004 UCB Step 1 Register Transfer Language RTL gives the meaning of the instructions op rs rt rd shamt funct MEM PC op rs rt Imm16 MEM PC inst All start by fetching the instruction Register Transfers ADDU R rd R rs R rt PC PC 4 SUBU R rd R rs R rt PC PC 4 ORI R rt R rs zero ext Imm16 PC PC 4 LOAD R rt MEM R rs sign ext Imm16 PC PC 4 STORE MEM R rs sign ext Imm16 R rt PC PC 4 BEQ CS 61C L16 Datapath 7 if R rs R rt then PC PC 4 sign ext Imm16 2 else PCA Carle PC 4 Summer 2004 UCB Step 1 Requirements of the Instruction Set Memory MEM instructions data Registers R 32 x 32 read RS read RT Write RT or RD PC Extender sign extend Add and Sub register or extended immediate Add 4 or extended immediate to PC CS 61C L16 Datapath 8 A Carle Summer 2004 UCB Step 1 Abstract Implementation Control PC Clk Next Address ALU Ideal Instruction Instruction Control Signals Conditions Memory Rd Rs Rt 5 5 5 Instruction Address A Data Data 32 Address Rw Ra Rb 32 Ideal Out 32 32 bit 32 Data Data Registers B Memory In Clk 32 Clk Datapath CS 61C L16 Datapath 9 A Carle Summer 2004 UCB How to Design a Processor step by step 1 Analyze instruction set architecture ISA datapath requirements meaning of each instruction is given by the register transfers datapath must include storage element for ISA registers datapath must support each register transfer 2 Select set of datapath components and establish clocking methodology 3 Assemble datapath meeting requirements 4 Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5 Assemble the control logic hard part CS 61C L16 Datapath 10 A Carle Summer 2004 UCB Step 2a Components of the Datapath Combinational Elements Storage Elements Clocking methodology CS 61C L16 Datapath 11 A Carle Summer 2004 UCB Combinational Logic More Elements B 32 Adder Adder A CarryIn 32 32 Sum Carry Select B 32 MUX MUX A 32 32 Y OP A CS 61C L16 Datapath 12 ALU ALU B 32 32 Result 32 A Carle Summer 2004 UCB ALU Needs for MIPS lite Rest of MIPS Addition subtraction logical OR ADDU R rd R rs R rt SUBU R rd R rs R rt ORI R rt R rs zero ext Imm16 BEQ if R rs R rt Test to see if output 0 for any ALU operation gives test How P H also adds AND Set Less Than 1 if A B 0 otherwise ALU follows chap 5 CS 61C L16 Datapath 13 A Carle Summer 2004 UCB Storage Element Idealized Memory Write Enable Memory idealized One input bus Data In One output bus Data Out Address Data In 32 Clk DataOut 32 Memory word is selected by Address selects the word to put on Data Out Write Enable 1 address selects the memory word to be written via the Data In bus Clock input CLK The CLK input is a factor ONLY during write operation During read operation behaves as a combinational logic block Address valid Data Out valid after access time CS 61C L16 Datapath 14 A Carle Summer 2004 UCB Storage Element Register Building Block Similar to D Flip Flop except N bit input and output Write Enable input Write Enable negated or deasserted 0 Data Out will not change asserted 1 Data Out will become Data In CS 61C L16 Datapath 15 Write Enable Data In N Data Out N Clk A Carle Summer 2004 UCB Storage Element Register File Register File consists of 32 registers Two 32 bit output busses busA and busB One 32 bit input bus busW Register is selected by RW RA RB Write Enable 5 5 5 busW 32 Clk busA 32 32 32 bit Registers busB 32 RA number selects the register to put on busA data RB number selects the register to put on busB data RW number selects the register to be written via busW data when Write Enable is 1 Clock input CLK The CLK input is a factor ONLY during write operation During read operation behaves as a combinational logic block RA or RB valid busA or busB valid after access time CS 61C L16 Datapath 16 A Carle Summer 2004 UCB Administrivia Turn in your HW 45 in class Project 2 …


View Full Document

Berkeley COMPSCI 61C - Lecture Notes

Documents in this Course
SIMD II

SIMD II

8 pages

Midterm

Midterm

7 pages

Lecture 7

Lecture 7

31 pages

Caches

Caches

7 pages

Lecture 9

Lecture 9

24 pages

Lecture 1

Lecture 1

28 pages

Lecture 2

Lecture 2

25 pages

VM II

VM II

4 pages

Midterm

Midterm

10 pages

Load more
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?