CSE Introduction to Computer Architecture Chapter 5 The Processor: Datapath & Control

Size: px
Start display at page:

Download "CSE Introduction to Computer Architecture Chapter 5 The Processor: Datapath & Control"

Transcription

1 CSE Introdction to Compter Architectre Chapter 5 The Processor: Datapath & Control Dr. Izadi

2 Data Processor Register # PC Address Registers ALU memory Register # Register # Address Data memory Data We're ready to look at an implementation of the IPS Simplified to contain only: memory-reference instrctions: lw, sw arithmetic-logical instrctions: add, sb, and, or, slt control flow instrctions: beq, j Generic Implementation: se the program conter (PC) to spply instrction address get the instrction from memory read (write) from (to) registers the op-code determines eactly what to do All instrctions se the ALU after reading the registers Why? memory-reference? arithmetic? control flow? 2

3 ore Implementation Details Abstract / Simplified View: Data Register # PC Address Registers ALU memory Register # Register # Address Data memory Two types of fnctional nits: Elements that operate on vales (combinational) ALU Elements that contain state (seqential) Registers and memory Data 3

4 State Elements Unclocked vs. Clocked Clocks sed in synchronos logic when shold an element that contains state be pdated? Falling edge Clock period cycle time Rising edge 4

5 An Unclocked State Element The set-reset latch Otpt depends on present inpts and also on past inpts S R Q Q - R S Q Q 5

6 D-latch D Q(t+) D C Q Two inpts: the vale to be stored (D) the clock signal (C) indicating when to read & store D Two otpts: the vale of the internal state (Q) and it's complement C D Q _ Q 6

7 Latches and Flip-flops Otpt is eqal to the stored vale inside the element (don't need to ask for permission to look at the vale) Change of state (vale) is based on the clock Latches: whenever the clock is asserted (high or low) and the inpt changes Flip-flop: whenever the clock is asserted (low to high or high to low transition) and the inpt changes (edge-triggered methodology) Note: "logically tre cold mean electrically low 7

8 D flip-flop Otpt changes only on the clock edge D D C D latch Q D C D latch Q Q Q Q C D C Q 8

9 Or Implementation An edge triggered methodology Typical eection: read contents of some state elements, send vales throgh some combinational logic write reslts to one or more state elements State element Combinational logic State element 2 Clock cycle 9

10 Clocking ethodology A clocking methodology defines when signals can be read and written woldn't want to read a signal at the same time it was being written Clk Setp Hold Setp Hold Don t Care All storage elements are clocked by the same clock edge Cycle Time CLK-to-Q + Longest Delay Path + Setp + Clock Skew (CLK-to-Q + Shortest Delay Path - Clock Skew) > Hold Time......

11 Abstraction ake sre yo nderstand the abstractions! Sometimes it is easy to think yo do, when yo Select don t 32 A 32 B Select 32 C A3 B3 A3 B3.. C3 C3 A B C

12 Register File operation sing D flip-flops and UX s register nmber Register register nmber register nmber 2 Register... Register n 2 register Register file 2 Register n register nmber 2 2 What is the fnction of above? 2

13 Register File and register nmber register nmber 2 register nmber register nmber 2 register Register Register Register n Register n Register file 2 Register n-to- decoder n n C Register D C Register D C Register n D 2 Data C Registern D How many registers can we read and write at the same time? Does this spport IPS instrctions reqirements? 3

14 Bilding the Datapath Inclde the fnctional nits we need for each instrction address em memory PC Add Sm Address Data memory 6 Sign 32 etend Register nmbers Data a. memory b. Program conter 5 3 register 5 5 register 2 Registers register 2 Reg Data c. Adder ALU control ALU ALU reslt a. Registers b. ALU Use mltipleors to stitch them together Zero em a. Data memory nit ALU Control: AND OR add sbtract set-on-less-than b. Sign-etension nit 4

15 Datapath for Fetch and R-s Portion of path for fetching instrctions and pdating PC Add 4 PC address memory R-format instrctions: read two registers and write one register ALU control register register 2 Registers register 2 Reg 3 Zero ALU ALU reslt ALU Control: AND OR add sbtract set-on-less-than 5

16 Datapath for lw and sw Instrctions lw $t, offset_vale($t2) or sw $t, offset_vale ($t2) Compte memory address Sign etend 6 bit to 32 bit Registers re giste r da ta re giste r 2 3 ALU operation Zero em re giste r 2 ALU ALU re s lt Address Rea RegW rite da ta Data memory 6 32 Sign etend em 6

17 Bilding beq beq $t, $t2, offset Compare registers, se ALU to affect Z flag If not eqal, net PC <= PC +4 If eqal, sign etend the offset and shift by two PC + 4 Net instrction address Shift left 2 Add ALU reslt register re gister 2 register Reg Registers 2 6 Sign 32 etend ALU operation 3 Zero ALU Branch control 7

18 A Simple Implementation of a Datapath Covers: lw, sw, beq, add, sb, and, or, set-on-less-than Use mltipleors to stitch them together register register 2 register Reg Registers Sign etend ALUSrc 3 ALU operation Zero ALU ALU reslt Address em em Data memory emtoreg 8

19 Implementation of the Datapath PCSrc Add 4 Shift left 2 Add ALU reslt PC address memory register register 2 register Registers 2 Reg 6 Sign 32 etend ALUSrc 3 ALUoperation Zero ALU ALU reslt Address em em Data memory emtoreg 9

20 Three Classes R-Type op rs rt rd shamt fnct rd: destination Load and Store s op rs rt 6 bit offset rt: destination Branch op rs rt 6 bit offset rt: destination 2

21 Completed Data Path PCSrc Add ALU reslt Add Shift left 2 4 Reg PC address memory [3 ] [25 2] [2 6] [5 ] [5 ] RegDst register register 2 Registers register Sign etend ALUSrc Zero ALU ALU reslt ALU Control em Address Data memory em emtoreg 2

22 Control Using the op-code from the instrction, the control isses signals to: Selecting the operations to perform (ALU, read/write, etc.) Controlling the flow of (mltipleer inpts) ALU's operation based on instrction type and fnction code Eample: what shold the ALU do with the instrction add $8, $7, $8 op rs rt rd shamt fnct 22

23 Control Eample: what shold the ALU do with the instrction lw $, ($2) 35 2 op rs rt 6 bit offset Why is the ALU code for sbtract is and not? 23

24 ALU Control st describe hardware to compte 3-bit ALU control inpt Given instrction type = lw, sw = beq, = arithmetic ALUOp Fnction code for arithmetic compted from instrction type ALUOp Fnct field Operation ALUOp ALUOp F5 F4 F3 F2 F F X X X X X X add X X X X X X sb (X) X X add (X) X X sb (X) X X and (X) X X or (X) X X slt ALU Control: AND OR add sbtract set-on-less-than 24

25 ALU Control F(5 ) F3 F2 F F Inpts ALUOp Fnct field Operation ALUOp ALUOp F5 F4 F3 F2 F F 2 X X X X X X add X X X X X X sb X X add X X sb X X and X X or X X slt ALUOp ALUOp ALUOp ALU control block Operation2 Operation Operation Operation Otpts li-level decoding can redce size of control nit and increase its speed. 25

26 A Simple Control PCSrc Add ALU reslt Add Shift left 2 4 Reg PC address memory [3 ] [25 2] [2 6] [5 ] RegDst register register 2 Registers register 2 ALUSrc Zero ALU ALU reslt Address em Data memory emtoreg [5 ] 6 32 Sign etend ALU control em [5 ] ALUop 26

27 Control 4 Add [3 26] Control RegDst Branch em emtoreg ALUOp em ALUSrc Reg Shift left 2 Add ALU reslt PC address memory [3 ] [25 2] [2 6] [5 ] register register 2 Registers 2 register Zero ALU ALU reslt Address Data memory [5 ] 6 32 Sign etend ALU control [5 ] emto- Reg em em Opcode RegDst ALUSrc Reg Branch ALUOpALUOp R-format lw sw X X beq X X 27

28 Single Cycle Control Simple combinational logic Inpts ALUOp ALUOp ALUOp ALU control block Op5 Op4 Op3 Op2 Op Op F(5 ) F3 F2 F F Operation2 Operation Operation Operation R-format Iw sw beq Otpts RegDst ALUSrc emtoreg Reg em em Branch ALUOp ALUOpO 28

29 Or Simple Control Strctre All of the logic is combinational We wait for everything to settle down, and the right thing to be done ALU might not prodce right answer right away we se write signals along with clock to determine when to write Cycle time determined by length of the longest path Content of PC Combinational logic Content of PC Clock 29

30 Single Cycle Implementation Calclate cycle time assming negligible delays ecept: memory (2ns), ALU and adders (2ns), register file access (ns) PCSrc Add 4 Reg Shift left 2 Add ALU reslt PC address [3 ] memory [25 2] [2 6] [5 ] RegDst [5 ] register register 2 register 2 Registers 6 Sign 32 etend ALUSrc ALU control Zero ALU ALU reslt em Address Data memory em emtoreg [5 ] ALUOp 3

31 Single Cycle Implementation Calclate cycle time assming negligible delays ecept: memory (2ns), ALU and adders (2ns), register file access (ns) PCSrc 4 Add Reg Shift left 2 Add ALU res lt PC address In str ction [3 ] memory In strctio n [25 2 ] In strctio n [2 6] In strctio n [5 ] RegDst In strctio n [5 ] register register 2 register d ata d ata 2 Registers 6 Sign 32 etend ALUSrc ALU control ALU Zero ALU reslt em Address Data memory em emtoreg [5 ] ALUOp Instr. emory Register ALU Op. Data emory Reg. Total R-format ns lw ns sw ns beq ns 3

32 Single Cycle Problems: Cycle time shold accommodate the longest instrction. What if we had more complicated instrctions like floating point? Can se a nit only once dring a cycle ay need mltiple copies of some fnctional nits (wastefl of area) One Soltion: se a smaller cycle time have different instrctions take different nmbers of cycles a mlti-cycle path: 32

33 lti-cycle Approach We will be resing fnctional nits ALU sed to compte address and the new PC vale Same memory sed for instrction and Break p the instrctions into steps, each step takes a cycle Balance the amont of work to be done Restrict each cycle to se only one major fnctional nit Or control signals will not be determined solely by instrction, bt also by the crrent step e.g., what shold the ALU do for an add instrction? At the end of a cycle (step) Store vales for se in later steps Introdce additional internal registers 33

34 lti-cycle Approach Added components IR and DR both needed dring the same cycle A and B registers to hold operand vales ALUOt register PC Address emory Data or register emory register Data Register # Registers Register # Register # A B ALU ALUOt 34

35 lticycle Approach Internal registers ecept IR are pdated every clock cycle; No write control Need to add new UX s and epand eisting UX s PC Address emory emdata [25 2] [2 6] [5 ] register [5 ] [5 ] register register 2 Registers register 2 A B Zero ALU ALU reslt ALUOt emory register 6 Sign etend 32 Shift left2 35

36 Control Signals REGDst PCSorce em em IorD IR REG 26 Shift left2 ALUSrcA 32 2 PC PC PCCond Address emory emdata Zero (ALU) [25 2] [2 6] [5 ] register [5 ] emory register [5 ] 6 register register 2 Registers register emtoreg 2 32 Sign etend Shift left2 A B Zero ALU ALU reslt ALUSrcB ALU control ALUOp ALUOt 36

37 s from ISA Perspective Consider each instrction from perspective of ISA. Eample: The add instrction changes a register. Register specified by bits 5: of instrction. specified by the PC. New vale is the sm ( op ) of two registers. Registers specified by bits 25:2 and 2:6 of the instrction Reg[emory[PC][5:]] <= Reg[emory[PC][25:2]] op Reg[emory[PC][2:6]] In order to accomplish this we mst break p the instrction. (kind of like introdcing variables when programming) 37

38 Breaking Down of an ISA definition of arithmetic: Reg[emory[PC][5:]] <= Reg[emory[PC][25:2]] op Reg[emory[PC][2:6]] Cold break down to: IR <= emory[pc] A <= Reg[IR[25:2]] B <= Reg[IR[2:6]] ALUOt <= A op B Reg[IR[5:]] <= ALUOt We forgot an important part of the definition of arithmetic! PC <= PC

39 Idea Behind lticycle Approach We define each instrction from the ISA perspective (do this!) Break it down into steps following or rle that flows throgh at most one major fnctional nit (e.g., balance work across steps) Introdce new registers as needed (e.g, A, B, ALUOt, DR, etc.) Finally try and pack as mch work into each step (avoid nnecessary cycles) while also trying to share steps where possible (minimizes control, helps to simplify soltion) Reslt: Or book s mlticycle Implementation! 39

40 Five Eection Steps. fetch 2. decode and register fetch 3. Eection, memory address comptation, or branch completion 4. emory access or R-type instrction completion 5. -back step INSTRUCTIONS TAKE FRO 3-5 CYCLES!

41 Step : Fetch Use PC to get instrction and pt it in the Register. Increment the PC by 4 and pt the reslt back in the PC sing RTL "Register-Transfer Langage" IR <= emory[pc]; em ALUSrcA = IorD = IR ALUSrcB = ALUOp = PC PCSorce = PC <= PC + 4; PC PC PCCond em em IorD Address emory emdata Zero (ALU) IR [25 2] [2 6] [5 ] register [5 ] emory register REGDst [5 ] 6 emto Reg REG register register2 Registers register 2 Sign 32 etend Shift left2 A B 26 4 Shift left ALUSrcB PCSorce ALUSrcA ALU Zero ALU reslt ALU control 2 ALUOt ALUOp 4

42 Step 2: Decode and Register Fetch registers rs and rt (in case we need them) and pt them in A & B Compte the branch address in case the instrction is a branch; pt it in ALUOt A <= Reg[IR[25-2]]; B <= Reg[IR[2-6]]; ALUOt <= PC + (sign-etend(ir[5-]) << 2); ALUSrcA = ALUSrcB = ALUOp = lw or sw 3 R-type 2 beq 3 3 j 3 PC PC PCCond em em IorD Address emory emdata Zero (ALU) IR [25 2] [2 6] [5 ] register register register 2 Registers register 2 We are Looking at the instrction and determine what to do in the net cycle We aren't setting any control lines based on the instrction type [5 ] emory register REGDst [5 ] 6 emto Reg REG Sign 32 etend Shift left2 A B 26 4 Shift left ALUSrcB PCSorce ALUSrcA ALU Zero ALU reslt ALU control 2 ALUOt ALUOp 42

43 Step 3: Dependent ALU is performing one of three fnctions, based on instrction type (ignore j instrction for now) emory Reference: (lw or sw) R-type: Branch: beq ALUOt <= A + sign-etend(ir[5-]); ALUOt <= A op B; if (A==B) PC <= ALUOt (compte address) (eecte) (complete branch) lw ALUSrcA = ALUSrcA = ALUSrcA = ALUSrcB = ALUSrcB = ALUSrcB = ALUOp = ALUOp = ALUOp = go to step 4 PCCond PCSorce = sw end of eection fetch net instrction 43

44 For beq REGDst PCSorce em em IorD IR REG 26 Shift left 2 ALUSrcA 32 2 PC PC PCCond Address emory emdata Zero (ALU) [25 2] [2 6] [5 ] register [5 ] emory register [5 ] 6 register register 2 Registers register emtoreg 2 32 Sign etend Shift left 2 A B Zero ALU ALU reslt ALUSrcB ALU control ALUOp ALUOt For lw and sw 44

45 Step 4: R-type or emory Access Lw sw R-type DR = emory[aluot]; emory[aluot] = B; Reg[IR[5-]] = ALUOt; (read from memory) (write to memory) (store reslt) em em RegDst = IorD = IorD = REG emtoreg = end of eection fetch net instrction end of eection fetch net instrction 45

46 lw sw REGDst PCSorce PC PC PCCond em em IorD Address emory emdata Zero (ALU) IR [25 2] [2 6] [5 ] register [5 ] emory register [5 ] 6 register register 2 Registers register emtoreg REG 2 32 Sign etend Shift left 2 26 A B 4 Shift left ALUSrcA 28 Zero ALU ALU reslt ALUSrcB ALU control 32 ALUOp 2 ALUOt R-type 46

47 Step 5 Back Only for lw instrctions to store read from memory into a register Reg[IR[2-6]]= DR; RegDest = Reg emtoreg = PC PC PCCond em em IorD Address emory emdata Zero (ALU) IR [25 2] [2 6] [5 ] register [5 ] emory register REGDst [5 ] 6 emto Reg REG register register 2 Registers register 2 Sign 32 etend Shift left2 A B 26 4 Shift left ALUSrcB PCSorce ALUSrcA ALU Zero ALU reslt ALU control 2 ALUOt ALUOp 47

48 Control Smmary Step name fetch decode/register fetch Action for R-type instrctions Action for memory-reference Action for instrctions branches IR = emory[pc] PC = PC + 4 A = Reg [IR[25-2]] B = Reg [IR[2-6]] ALUOt = PC + (sign-etend (IR[5-]) << 2) Action for jmps Eection, address ALUOt = A op B ALUOt = A + sign-etend if (A ==B) then PC = PC [3-28] II comptation, branch/ (IR[5-]) PC = ALUOt (IR[25-]<<2) jmp completion emory access or R-type Reg [IR[5-]] = Load: DR = emory[aluot] completion ALUOt or Store: emory [ALUOt] = B emory read completion Load: Reg[IR[2-6]] = DR 48

49 Implementing the Control Vale of control signals is dependent pon: what instrction is being eected which step is being performed Use the information we ve accmlated to specify a finite state machine specify the finite state machine graphically, or se microprogramming Implementation can be derived from specification 49

50 Review: Finite State achines Finite state machines: A set of states and Net state fnction (determined by crrent state and the inpt) Otpt fnction (determined by crrent state and possibly inpt) Crrent state Net-state fnction Net state Inpts Clock Otpt fnction Otpts We ll se a oore machine (otpt based only on crrent state) How does oore machine varios from ealy machine? 5

51 Review: finite state machines Eample: A friend wold like yo to bild an electronic eye for se as a fake secrity device. The device consists of three lights lined p in a row, controlled by the otpts Left, iddle, and Right, which, if asserted, indicate that a light shold be on. Only one light is on at a time, and the light moves from left to right and then from right to left, ths scaring away thieves who believe that the device is monitoring their activity. Draw the graphical representation for the finite state machine sed to specify the electronic eye. Note that the rate of the eye s movement will be controlled by the clock speed (which shold not be too great) and that there are essentially no inpts. 5

52 Graphical Specification of FS don t care if not mentioned asserted if name only otherwise eact vale How many state bits will we need? 2 3 emory address comptation ALUSrcA = ALUSrcB = ALUOp = (Op ='LW') emory access (O p = 'SW') 5 Start (Op = 'LW ') or (O p = 'SW ') emory access fetch em ALUSrcA = IorD = IRW rite ALUSrcB = ALUOp = PC PCSorce = 6 7 Eection ALUSrcA = ALUSrcB = ALUOp= 8 R-type completion (Op = R-type) Branch completion ALUSrcA = ALUSrcB = ALUOp = PCCond PCSorce = (Op = 'BEQ') decode/ register fetch 9 ALUSrcA = ALUSrcB = ALUOp = (Op = 'J') Jmp completion PC PCSorce = em IorD = em IorD = RegDst = Reg emtoreg = 4 -back step RegDst= Reg emtoreg=

53 Simple Qestions How many cycles will it take to eecte this code? lw $t2, ($t3) lw $t3, 4($t3) beq $t2, $t3, Label add $t5, $t2, $t3 sw $t5, 8($t3) Label:... #assme not What is going on dring the 8th cycle of eection? In what cycle does the actal addition of $t2 and $t3 takes place? 53

54 ltiple Cycle Datapath PCWr PC IorD PCWrCond PCSrc BrWr Zero emwr IRWr RegDst RegWr ALUSelA Target 32 RAdr Ideal emory WrAdr Din Dot 32 Reg 32 Rs Rt Rt Rd 5 5 Ra Rb Reg File Rw bsa bsw bsb << Zero ALU ALU Control 32 ALU Ot Imm 6 EtOp Etend 32 emtoreg ALUSelB ALUOp 54

55 [3 26] PC Address [25 2] register emory emdata PCCond [2 6] [5 ] register [5 ] emory register PC IorD em em emtoreg IR [25-] Otpts Control Op [5 ] [5 ] PCSorce ALUOp ALUSrcB ALUSrcA Reg RegDst register 2 Registers register 6 Sign 32 etend 2 A Shift left 2 B Shift 28 left 2 PC [3 28] Zero ALU ALU reslt ALU control Jmp address [3 ] ALUOt 2 [5 ]

56 Finite State achine for Control Implementation: PC Control logic Otpts PCCond IorD em em IR emtoreg PCSorce ALUOp ALUSrcB ALUSrcA Reg RegDst Inpts NS3 NS2 NS NS Op5 Op4 Op3 Op2 Op Op S3 S2 S S register opcode field State register 56

57 PLA Implementation Op5 If I picked a horizontal or vertical line cold yo eplain it? Op code D Q D Q Op4 Op3 Op2 Op Op S3 S2 S S PC PCCond IorD e mre a d e m IR e mtore g PCSorce PCSorce ALUOp ALUOp ALUSrcB ALUSrcB ALUSrcA Reg RegDst NS3 NS2 NS NS 57

58 RO Implementation RO = " Only emory" vales of memory locations are fied ahead of time A RO can be sed to implement a trth table if the address is m-bits, we can address 2 m entries in the RO. or otpts are the bits of that the address points to. m n m n m is the "height", and n is the "width" 58

59 RO Implementation How many inpts are there? 6 bits for opcode, 4 bits for state = address lines (i.e., 2 = 24 different addresses) How many otpts are there? 6 path-control otpts, 4 state bits = 2 otpts RO is 2 2 = 2K bits (and a rather nsal size) Rather wastefl, since for lots of the entries, the otpts are the same i.e., opcode is often ignored 59

60 RO vs PLA Break p the table into two parts 4 state bits tell yo the 6 otpts, bits of RO bits tell yo the 4 net state bits, 2 4 bits of RO Total: 4.3K bits of RO PLA is mch smaller Can share prodct terms Only need entries that prodce an active otpt Can take into accont don't cares Size: (#inpts #prodct-terms) + (#otpts #prodct-terms) For this eample = (7)+(27) = 5 PLA cells PLA cells sally abot the size of a RO cell (slightly bigger) 6

61 Another Implementation Style Comple instrctions The "net state" is often crrent state + Control nit PLA or RO Inpt Otpts PC PCCond IorD em em IR B emtoreg PCSorce ALUOp ALUSrcB ALUSrcA Reg RegDst AddrCtl State Adder Address select logic Op[5 ] register opcode field 6

62 icroprogramming Control is the hard part of processor design Datapath is fairly reglar and well-organized emory is highly reglar Control is irreglar and global icroprogramming: A Particlar Strategy for Implementing the Control Unit of a processor by "programming" at the level of register transfer operations icroarchitectre: Logical strctre and fnctional capabilities of the hardware as seen by the microprogrammer Historical Note: IB 36 Series first to distingish between architectre & organization Same instrction set across wide range of implementations, each with different cost/performance 62

63 acroinstrction Verss icroinstrction ain emory eection nit ADD SUB AND... DATA User program pls Data this can change! one of these is mapped into one of these at RTL level CPU control memory AND microseqence e.g., Fetch Fetch Operand(s) Calclate Save Answer(s) 63

64 Controller Design seqencer control path control microinstrction micro-pc seqencer The state diagrams that arise define the controller for an instrction set processor are highly strctred Use this strctre to constrct a simple microseqencer Control redces to programming this very simple device microprogramming 64

65 icroprogramming Implementation of the Control Control nit icrocode memory Inp t Otpts PC PCCond Io rd emrea d em IR W rite B emtoreg PCSorce ALUOp ALUS rcb ALUS rca Reg RegDst Ad drc tl Da ta pa th icroprogra m conte r Adder Address select logic Op[5 ] Ins tr c tio n re g is te r opcode field 65

66 icroprogramming microinstrction: low level control instrction which defines a set of path control signal. A specification methodology appropriate if hndreds of opcodes, modes, cycles, etc. signals specified symbolically sing microinstrctions Label ALU control SRC SRC2 Register control emory PC control Seqencing Fetch Add PC 4 PC ALU Seq Add PC Etshft Dispatch em Add A Etend Dispatch 2 LW2 ALU Seq DR Fetch SW2 ALU Fetch Rformat Fnc code A B Seq ALU Fetch BEQ Sbt A B ALUOt-cond Fetch JUP Jmp address Fetch 66

67 Field name Vale Signals active Comment Add ALUOp = Case the ALU to add. ALU control Sbt ALUOp = Case the ALU to sbtract; this implements the compare for branches. Fnc code ALUOp = Use the instrction's fnction code to determine ALU control. SRC PC ALUSrcA = Use the PC as the first ALU inpt. A ALUSrcA = Register A is the first ALU inpt. B ALUSrcB = Register B is the second ALU inpt. SRC2 4 ALUSrcB = Use 4 as the second ALU inpt. Etend ALUSrcB = Use otpt of the sign etension nit as the second ALU inpt. Etshft ALUSrcB = Use the otpt of the shift-by-two nit as the second ALU inpt. two registers sing the rs and rt fields of the IR as the register nmbers and ptting the into registers A and B. ALU Reg, a register sing the rd field of the IR as the register nmber and Register RegDst =, the contents of the ALUOt as the. control emtoreg = DR Reg, a register sing the rt field of the IR as the register nmber and RegDst =, the contents of the DR as the. emtoreg = PC em, memory sing the PC as address; write reslt into IR (and lord = the DR). emory ALU em, memory sing the ALUOt as address; write reslt into DR. lord = ALU em, memory sing the ALUOt as address, contents of B as the lord =. ALU PCSorce = the otpt of the ALU into the PC. PC PC write control ALUOt-cond PCSorce =, If the Zero otpt of the ALU is active, write the PC with the contents PCCond of the register ALUOt. jmp address PCSorce =, the PC with the jmp address from the instrction. PC Seq AddrCtl = Choose the net microinstrction seqentially. Seqencing Fetch AddrCtl = Go to the first microinstrction to begin a new instrction. Dispatch AddrCtl = Dispatch sing the RO. Dispatch 2 AddrCtl = Dispatch sing the RO 2.

68 Details Dispatch RO Dispatch RO 2 Op Opcode name Vale Op Opcode name Vale R-format lw jmp sw beq lw sw Adder PLA or RO State 3 2 AddrCtl Dispatch RO 2 Dispatch RO Address select logic State nmber Address-control action Vale of AddrCtl Use incremented state 3 Use dispatch RO 2 Use dispatch RO Use incremented state 3 4 Replace state nmber by 5 Replace state nmber by 6 Use incremented state 3 7 Replace state nmber by 8 Replace state nmber by 9 Replace state nmber by register opcode field 68

69 aimally vs. inimally Encoded No encoding: bit for each path operation faster, reqires more memory (logic) sed for Va 78 an astonishing 4K of memory! Lots of encoding: send the microinstrctions throgh logic to get control signals ses less memory, slower Historical contet of CISC: Too mch logic to pt on a single chip with everything else Use a RO (or even RA) to hold the microcode It s easy to add new instrctions 69

70 Designing a icroinstrction Set. Start with list of control signals 2. Grop signals together that make sense (vs. random): called fields 3. Places fields in some logical order e.g., ALU operation & ALU operands first and microinstrction seqencing last 4. Create a symbolic legend for the microinstrction format, showing name of field vales and how they set the control signals Use compters to design compters 5. To minimize the width, encode operations that will never be sed at the same time 7

71 Possible Design Paths of Control Initial Representation Finite State Diagram icroprogram Seqencing Control Eplicit Net State icroprogram conter Fnction + Dispatch ROs Logic Representation Logic Eqations Trth Tables Implementation PLA RO Techniqe hardwired control microprogrammed control 7

72 icroprogramming Pros and Cons Ease of design Fleibility Easy to adapt to changes in organization, timing, technology Can make changes late in design cycle, or even in the field Can implement very powerfl instrction sets (jst more control memory) Generality Can implement mltiple instrction sets on same machine. Can tailor instrction set to application. Compatibility any organizations, same instrction set Costly to implement Slow 72

73 icrocode: Trade-offs Distinction between specification and implementation is blrred Specification Advantages: Easy to design and write Design architectre and microcode in parallel Implementation (off-chip RO) Advantages Easy to change since vales are in memory Can emlate other architectres Can make se of internal registers Implementation Disadvantages, SLOWER now that: Control is implemented on same chip as processor RO is no longer faster than RA No need to go back and make changes 73

74 Historical Perspective In the 6s and 7s microprogramming was very important for implementing machines This led to more sophisticated ISAs and the VAX In the 8s RISC processors based on pipelining became poplar Pipelining the microinstrctions is also possible! Implementations of IA-32 architectre since 486 hardwired control for simpler instrctions (few cycles, FS control implemented sing PLA or random logic) microcoded control for more comple instrctions (large nmbers of cycles, central control store) The IA-64 architectre ses a RISC-style ISA and can be implemented withot a large central control store 74

75 Pentim 4 Pipelining is important (last IA-32 withot it was 8386 in 985) Control Control I/O interface cache Enhanced floating point and mltimedia Control Data cache Integer path Secondary cache and memory interface Chapter 7 Chapter 6 Advanced pipelining hyperthreading spport Control 75

76 Control Pentim 4 Control I/O interface cache Enhanced floating point and mltimedia Control Data cache Integer path Secondary cache and memory interface Advanced pipelining hyperthreading spport Control Somewhere in all that control we mst handle comple instrctions Processor eectes simple microinstrctions, 7 bits wide (hardwired) 2 control lines for integer path (4 for floating point) If an instrction reqires more than 4 microinstrctions to implement, control from microcode RO (8 microinstrctions) Its complicated! 76

77 Smmary If we nderstand the instrctions, we can bild a simple processor! If instrctions take different amonts of time, mlti-cycle is better Datapath implemented sing: Combinational logic for arithmetic logic nit State holding elements for registers and memory Control implemented sing: Combinational logic for single-cycle implementation Finite state machine for mlti-cycle implementation 77

The extra single-cycle adders

The extra single-cycle adders lticycle Datapath As an added bons, we can eliminate some of the etra hardware from the single-cycle path. We will restrict orselves to sing each fnctional nit once per cycle, jst like before. Bt since

More information

The single-cycle design from last time

The single-cycle design from last time lticycle path Last time we saw a single-cycle path and control nit for or simple IPS-based instrction set. A mlticycle processor fies some shortcomings in the single-cycle CPU. Faster instrctions are not

More information

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read.

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read. The final path PC 4 Add Reg Shift left 2 Add PCSrc Instrction [3-] Instrction I [25-2] I [2-6] I [5 - ] register register 2 register 2 Registers ALU Zero Reslt ALUOp em Data emtor RegDst ALUSrc em I [5

More information

Review Multicycle: What is Happening. Controlling The Multicycle Design

Review Multicycle: What is Happening. Controlling The Multicycle Design Review lticycle: What is Happening Reslt Zero Op SrcA SrcB Registers Reg Address emory em Data Sign etend Shift left Sorce A B Ot [-6] [5-] [-6] [5-] [5-] Instrction emory IR RegDst emtoreg IorD em em

More information

1048: Computer Organization

1048: Computer Organization 48: Compter Organization Lectre 5 Datapath and Control Lectre5A - simple implementation (cwli@twins.ee.nct.ed.tw) 5A- Introdction In this lectre, we will try to implement simplified IPS which contain emory

More information

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University Compter Architectre Chapter 5 Fall 25 Department of Compter Science Kent State University The Processor: Datapath & Control Or implementation of the MIPS is simplified memory-reference instrctions: lw,

More information

1048: Computer Organization

1048: Computer Organization 48: Compter Organization Lectre 5 Datapath and Control Lectre5B - mlticycle implementation (cwli@twins.ee.nct.ed.tw) 5B- Recap: A Single-Cycle Processor PCSrc 4 Add Shift left 2 Add ALU reslt PC address

More information

EEC 483 Computer Organization

EEC 483 Computer Organization EEC 483 Compter Organization Chapter 4.4 A Simple Implementation Scheme Chans Y The Big Pictre The Five Classic Components of a Compter Processor Control emory Inpt path Otpt path & Control 2 path and

More information

The multicycle datapath. Lecture 10 (Wed 10/15/2008) Finite-state machine for the control unit. Implementing the FSM

The multicycle datapath. Lecture 10 (Wed 10/15/2008) Finite-state machine for the control unit. Implementing the FSM Lectre (Wed /5/28) Lab # Hardware De Fri Oct 7 HW #2 IPS programming, de Wed Oct 22 idterm Fri Oct 2 IorD The mlticycle path SrcA Today s objectives: icroprogramming Etending the mlti-cycle path lti-cycle

More information

Multicycle Approach. Designing MIPS Processor

Multicycle Approach. Designing MIPS Processor CSE 675.2: Introduction to Computer Architecture Multicycle Approach 8/8/25 Designing MIPS Processor (Multi-Cycle) Presentation H Slides by Gojko Babić and Elsevier Publishing We will be reusing functional

More information

The Processor: Datapath & Control

The Processor: Datapath & Control Chapter Five 1 The Processor: Datapath & Control We're ready to look at an implementation of the MIPS Simplified to contain only: memory-reference instructions: lw, sw arithmetic-logical instructions:

More information

Review. A single-cycle MIPS processor

Review. A single-cycle MIPS processor Review If three instrctions have opcodes, 7 and 5 are they all of the same type? If we were to add an instrction to IPS of the form OD $t, $t2, $t3, which performs $t = $t2 OD $t3, what wold be its opcode?

More information

Review: Computer Organization

Review: Computer Organization Review: Compter Organization Pipelining Chans Y Landry Eample Landry Eample Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 3 mintes A B C D Dryer takes 3 mintes

More information

Lecture 5: The Processor

Lecture 5: The Processor Lecture 5: The Processor CSCE 26 Computer Organization Instructor: Saraju P. ohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed from various books, websites, authors pages, and

More information

Exceptions and interrupts

Exceptions and interrupts Eceptions and interrpts An eception or interrpt is an nepected event that reqires the CPU to pase or stop the crrent program. Eception handling is the hardware analog of error handling in software. Classes

More information

Lecture 7. Building A Simple Processor

Lecture 7. Building A Simple Processor Lectre 7 Bilding A Simple Processor Christos Kozyrakis Stanford University http://eeclass.stanford.ed/ee8b C. Kozyrakis EE8b Lectre 7 Annoncements Upcoming deadlines Lab is de today Demo by 5pm, report

More information

Lets Build a Processor

Lets Build a Processor Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let s review Boolean Logic and build the ALU we ll need (Material from Appendix B) operation a 32 ALU result

More information

Pipelining. Chapter 4

Pipelining. Chapter 4 Pipelining Chapter 4 ake processor rns faster Pipelining is an implementation techniqe in which mltiple instrctions are overlapped in eection Key of making processor fast Pipelining Single cycle path we

More information

Lecture 9: Microcontrolled Multi-Cycle Implementations

Lecture 9: Microcontrolled Multi-Cycle Implementations 8-447 Lectre 9: icroled lti-cycle Implementations James C. Hoe Dept of ECE, CU Febrary 8, 29 S 9 L9- Annoncements: P&H Appendi D Get started t on Lab Handots: Handot #8: Project (on Blackboard) Single-Cycle

More information

Chapter 4 The Processor (Part 2)

Chapter 4 The Processor (Part 2) Department of Electr rical Eng ineering, Chapter 4 The Processor (Part 2) 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline A Multicycle Implementation Mapping Control

More information

ENE 334 Microprocessors

ENE 334 Microprocessors ENE 334 Microprocessors Lecture 6: Datapath and Control : Dejwoot KHAWPARISUTH Adapted from Computer Organization and Design, 3 th & 4 th Edition, Patterson & Hennessy, 2005/2008, Elsevier (MK) http://webstaff.kmutt.ac.th/~dejwoot.kha/

More information

What do we have so far? Multi-Cycle Datapath

What do we have so far? Multi-Cycle Datapath What do we have so far? lti-cycle Datapath CPI: R-Type = 4, Load = 5, Store 4, Branch = 3 Only one instrction being processed in datapath How to lower CPI frther? #1 Lec # 8 Spring2 4-11-2 Pipelining pipelining

More information

EXAMINATIONS 2010 END OF YEAR NWEN 242 COMPUTER ORGANIZATION

EXAMINATIONS 2010 END OF YEAR NWEN 242 COMPUTER ORGANIZATION EXAINATIONS 2010 END OF YEAR COPUTER ORGANIZATION Time Allowed: 3 Hors (180 mintes) Instrctions: Answer all qestions. ake sre yor answers are clear and to the point. Calclators and paper foreign langage

More information

PART I: Adding Instructions to the Datapath. (2 nd Edition):

PART I: Adding Instructions to the Datapath. (2 nd Edition): EE57 Instrctor: G. Pvvada ===================================================================== Homework #5b De: check on the blackboard =====================================================================

More information

Lecture 6: Microprogrammed Multi Cycle Implementation. James C. Hoe Department of ECE Carnegie Mellon University

Lecture 6: Microprogrammed Multi Cycle Implementation. James C. Hoe Department of ECE Carnegie Mellon University 8 447 Lectre 6: icroprogrammed lti Cycle Implementation James C. Hoe Department of ECE Carnegie ellon University 8 447 S8 L06 S, James C. Hoe, CU/ECE/CALC, 208 Yor goal today Hosekeeping nderstand why

More information

1048: Computer Organization

1048: Computer Organization 8: Compter Organization Lectre 6 Pipelining Lectre6 - pipelining (cwli@twins.ee.nct.ed.tw) 6- Otline An overview of pipelining A pipelined path Pipelined control Data hazards and forwarding Data hazards

More information

Computer Architecture

Computer Architecture Compter Architectre Lectre 4: Intro to icroarchitectre: Single- Cycle Dr. Ahmed Sallam Sez Canal University Based on original slides by Prof. Onr tl Review Compter Architectre Today and Basics (Lectres

More information

ECE369. Chapter 5 ECE369

ECE369. Chapter 5 ECE369 Chapter 5 1 State Elements Unclocked vs. Clocked Clocks used in synchronous logic Clocks are needed in sequential logic to decide when an element that contains state should be updated. State element 1

More information

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control معماري كامپيوتر پيشرفته معماري MIPS data path and control abbasi@basu.ac.ir Topics Building a datapath support a subset of the MIPS-I instruction-set A single cycle processor datapath all instruction actions

More information

Computer Architecture

Computer Architecture Compter Architectre Lectre 4: Intro to icroarchitectre: Single- Cycle Dr. Ahmed Sallam Sez Canal University Spring 25 Based on original slides by Prof. Onr tl Review Compter Architectre Today and Basics

More information

EEC 483 Computer Organization

EEC 483 Computer Organization EEC 83 Compter Organization Chapter.6 A Pipelined path Chans Y Pipelined Approach 2 - Cycle time, No. stages - Resorce conflict E E A B C D 3 E E 5 E 2 3 5 2 6 7 8 9 c.y9@csohio.ed Resorces sed in 5 Stages

More information

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13 Comp 33 Compter Architectre A Pipelined path Lectre 3 Pipelined path with Signals PCSrc IF/ ID ID/ EX EX / E E / Add PC 4 Address Instrction emory RegWr ra rb rw Registers bsw [5-] [2-6] [5-] bsa bsb Sign

More information

PS Midterm 2. Pipelining

PS Midterm 2. Pipelining PS idterm 2 Pipelining Seqential Landry 6 P 7 8 9 idnight Time T a s k O r d e r A B C D 3 4 2 3 4 2 3 4 2 3 4 2 Seqential landry takes 6 hors for 4 loads If they learned pipelining, how long wold landry

More information

Chapter 6: Pipelining

Chapter 6: Pipelining CSE 322 COPUTER ARCHITECTURE II Chapter 6: Pipelining Chapter 6: Pipelining Febrary 10, 2000 1 Clothes Washing CSE 322 COPUTER ARCHITECTURE II The Assembly Line Accmlate dirty clothes in hamper Place in

More information

Implementing the Control. Simple Questions

Implementing the Control. Simple Questions Simple Questions How many cycles will it take to execute this code? lw $t2, 0($t3) lw $t3, 4($t3) beq $t2, $t3, Label add $t5, $t2, $t3 sw $t5, 8($t3) Label:... #assume not What is going on during the

More information

Quiz #1 EEC 483, Spring 2019

Quiz #1 EEC 483, Spring 2019 Qiz # EEC 483, Spring 29 Date: Jan 22 Name: Eercise #: Translate the following instrction in C into IPS code. Eercise #2: Translate the following instrction in C into IPS code. Hint: operand C is stored

More information

Outline. Combinational Element. State (Sequential) Element. Clocking Methodology. Input/Output of Elements

Outline. Combinational Element. State (Sequential) Element. Clocking Methodology. Input/Output of Elements Outline ombinational Element ombinational & sequential logic Single-cycle PU ulti-cycle PU Examples of ombinational Elements State (Sequential) Element! "#$$$ #$$ #$$ #$ # & & ) *.// * - + #3, * + - locking

More information

Animating the Datapath. Animating the Datapath: R-type Instruction. Animating the Datapath: Load Instruction. MIPS Datapath I: Single-Cycle

Animating the Datapath. Animating the Datapath: R-type Instruction. Animating the Datapath: Load Instruction. MIPS Datapath I: Single-Cycle nimating the atapath PS atapath : Single-Cycle npt is either (-type) or sign-etended lower half of instrction (load/store) op offset/immediate W egister File 6 6 + from instrction path beq,, offset if

More information

Prof. Kozyrakis. 1. (10 points) Consider the following fragment of Java code:

Prof. Kozyrakis. 1. (10 points) Consider the following fragment of Java code: EE8 Winter 25 Homework #2 Soltions De Thrsday, Feb 2, 5 P. ( points) Consider the following fragment of Java code: for (i=; i

More information

MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture

MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture Another Eample: IPS From the Harris/Weste book Based on the IPS-like processor from the Hennessy/Patterson book IPS Architectre Eample: sbset of IPS processor architectre Drawn from Patterson & Hennessy

More information

CS 251, Spring 2018, Assignment 3.0 3% of course mark

CS 251, Spring 2018, Assignment 3.0 3% of course mark CS 25, Spring 28, Assignment 3. 3% of corse mark De onday, Jne 25th, 5:3 P. (5 points) Consider the single-cycle compter shown on page 6 of this assignment. Sppose the circit elements take the following

More information

CS 251, Winter 2018, Assignment % of course mark

CS 251, Winter 2018, Assignment % of course mark CS 25, Winter 28, Assignment 4.. 3% of corse mark De Wednesday, arch 7th, 4:3P Lates accepted ntil Thrsday arch 8th, am with a 5% penalty. (6 points) In the diagram below, the mlticycle compter from the

More information

Hardware Design Tips. Outline

Hardware Design Tips. Outline Hardware Design Tips EE 36 University of Hawaii EE 36 Fall 23 University of Hawaii Otline Verilog: some sbleties Simlators Test Benching Implementing the IPS Actally a simplified 6 bit version EE 36 Fall

More information

Chapter 6 Enhancing Performance with. Pipelining. Pipelining. Pipelined vs. Single-Cycle Instruction Execution: the Plan. Pipelining: Keep in Mind

Chapter 6 Enhancing Performance with. Pipelining. Pipelining. Pipelined vs. Single-Cycle Instruction Execution: the Plan. Pipelining: Keep in Mind Pipelining hink of sing machines in landry services Chapter 6 nhancing Performance with Pipelining 6 P 7 8 9 A ime ask A B C ot pipelined Assme 3 min. each task wash, dry, fold, store and that separate

More information

TDT4255 Friday the 21st of October. Real world examples of pipelining? How does pipelining influence instruction

TDT4255 Friday the 21st of October. Real world examples of pipelining? How does pipelining influence instruction Review Friday the 2st of October Real world eamples of pipelining? How does pipelining pp inflence instrction latency? How does pipelining inflence instrction throghpt? What are the three types of hazard

More information

CC 311- Computer Architecture. The Processor - Control

CC 311- Computer Architecture. The Processor - Control CC 311- Computer Architecture The Processor - Control Control Unit Functions: Instruction code Control Unit Control Signals Select operations to be performed (ALU, read/write, etc.) Control data flow (multiplexor

More information

Enhanced Performance with Pipelining

Enhanced Performance with Pipelining Chapter 6 Enhanced Performance with Pipelining Note: The slides being presented represent a mi. Some are created by ark Franklin, Washington University in St. Lois, Dept. of CSE. any are taken from the

More information

CS 251, Winter 2018, Assignment % of course mark

CS 251, Winter 2018, Assignment % of course mark CS 25, Winter 28, Assignment 3.. 3% of corse mark De onday, Febrary 26th, 4:3 P Lates accepted ntil : A, Febrary 27th with a 5% penalty. IEEE 754 Floating Point ( points): (a) (4 points) Complete the following

More information

CS 251, Winter 2019, Assignment % of course mark

CS 251, Winter 2019, Assignment % of course mark CS 25, Winter 29, Assignment.. 3% of corse mark De Wednesday, arch 3th, 5:3P Lates accepted ntil Thrsday arch th, pm with a 5% penalty. (7 points) In the diagram below, the mlticycle compter from the corse

More information

EECE 417 Computer Systems Architecture

EECE 417 Computer Systems Architecture EECE 417 Computer Systems Architecture Department of Electrical and Computer Engineering Howard University Charles Kim Spring 2007 1 Computer Organization and Design (3 rd Ed) -The Hardware/Software Interface

More information

Overview of Pipelining

Overview of Pipelining EEC 58 Compter Architectre Pipelining Department of Electrical Engineering and Compter Science Cleveland State University Fndamental Principles Overview of Pipelining Pipelined Design otivation: Increase

More information

EXAMINATIONS 2003 END-YEAR COMP 203. Computer Organisation

EXAMINATIONS 2003 END-YEAR COMP 203. Computer Organisation EXAINATIONS 2003 COP203 END-YEAR Compter Organisation Time Allowed: 3 Hors (180 mintes) Instrctions: Answer all qestions. There are 180 possible marks on the eam. Calclators and foreign langage dictionaries

More information

Instruction fetch. MemRead. IRWrite ALUSrcB = 01. ALUOp = 00. PCWrite. PCSource = 00. ALUSrcB = 00. R-type completion

Instruction fetch. MemRead. IRWrite ALUSrcB = 01. ALUOp = 00. PCWrite. PCSource = 00. ALUSrcB = 00. R-type completion . (Chapter 5) Fill in the vales for SrcA, SrcB, IorD, Dst and emto to complete the Finite State achine for the mlti-cycle datapath shown below. emory address comptation 2 SrcA = SrcB = Op = fetch em SrcA

More information

Computer Architecture. Lecture 6: Pipelining

Computer Architecture. Lecture 6: Pipelining Compter Architectre Lectre 6: Pipelining Dr. Ahmed Sallam Based on original slides by Prof. Onr tl Agenda for Today & Net Few Lectres Single-cycle icroarchitectres lti-cycle and icroprogrammed icroarchitectres

More information

Chapter 6: Pipelining

Chapter 6: Pipelining Chapter 6: Pipelining Otline An overview of pipelining A pipelined path Pipelined control Data hazards and forwarding Data hazards and stalls Branch hazards Eceptions Sperscalar and dynamic pipelining

More information

Lab 8 (All Sections) Prelab: ALU and ALU Control

Lab 8 (All Sections) Prelab: ALU and ALU Control Lab 8 (All Sections) Prelab: and Control Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received nathorized aid on this academic work Objective In this lab yo will

More information

CSSE232 Computer Architecture I. Mul5cycle Datapath

CSSE232 Computer Architecture I. Mul5cycle Datapath CSSE232 Compter Architectre I Ml5cycle Datapath Class Stats Next 3 days : Ml5cycle datapath ing Ml5cycle datapath is not in the book! How long do instrc5ons take? ALU 2ns Mem 2ns Reg File 1ns Everything

More information

Chapter 3 & Appendix C Pipelining Part A: Basic and Intermediate Concepts

Chapter 3 & Appendix C Pipelining Part A: Basic and Intermediate Concepts CS359: Compter Architectre Chapter 3 & Appendi C Pipelining Part A: Basic and Intermediate Concepts Yanyan Shen Department of Compter Science and Engineering Shanghai Jiao Tong University 1 Otline Introdction

More information

Chapter 5: The Processor: Datapath and Control

Chapter 5: The Processor: Datapath and Control Chapter 5: The Processor: Datapath and Control Overview Logic Design Conventions Building a Datapath and Control Unit Different Implementations of MIPS instruction set A simple implementation of a processor

More information

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón ICS 152 Computer Systems Architecture Prof. Juan Luis Aragón Lecture 5 and 6 Multicycle Implementation Introduction to Microprogramming Readings: Sections 5.4 and 5.5 1 Review of Last Lecture We have seen

More information

Computer Organization & Design The Hardware/Software Interface Chapter 5 The processor : Datapath and control

Computer Organization & Design The Hardware/Software Interface Chapter 5 The processor : Datapath and control Computer Organization & Design The Hardware/Software Interface Chapter 5 The processor : Datapath and control Qing-song Shi http://.24.26.3 Email: zjsqs@zju.edu.cn Chapter 5 The processor : Datapath and

More information

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed Lecture 3: General Purpose Processor Design CSCE 665 Advanced VLSI Systems Instructor: Saraju P. ohanty, Ph. D. NOTE: The figures, tet etc included in slides are borrowed from various books, websites,

More information

MIPS Architecture. An Example: MIPS. From the Harris/Weste book Based on the MIPS-like processor from the Hennessy/Patterson book

MIPS Architecture. An Example: MIPS. From the Harris/Weste book Based on the MIPS-like processor from the Hennessy/Patterson book An Eample: IPS From the Harris/Weste book Based on the IPS-like processor from the Hennessy/Patterson book IPS Architectre w Eample: sbset of IPS processor architectre n Drawn from Patterson & Hennessy

More information

4.13 Advanced Topic: An Introduction to Digital Design Using a Hardware Design Language 345.e1

4.13 Advanced Topic: An Introduction to Digital Design Using a Hardware Design Language 345.e1 .3 Advanced Topic: An Introdction to Digital Design Using a Hardware Design Langage 35.e.3 Advanced Topic: An Introdction to Digital Design Using a Hardware Design Langage to Describe and odel a Pipeline

More information

Topic #6. Processor Design

Topic #6. Processor Design Topic #6 Processor Design Major Goals! To present the single-cycle implementation and to develop the student's understanding of combinational and clocked sequential circuits and the relationship between

More information

CpE 442. Designing a Multiple Cycle Controller

CpE 442. Designing a Multiple Cycle Controller CpE 442 Designing a Multiple Cycle Controller CPE 442 multicontroller.. Outline of Today s Lecture Recap (5 minutes) Review of FSM control (5 minutes) From Finite State Diagrams to Microprogramming (25

More information

Systems Architecture I

Systems Architecture I Systems Architecture I Topics A Simple Implementation of MIPS * A Multicycle Implementation of MIPS ** *This lecture was derived from material in the text (sec. 5.1-5.3). **This lecture was derived from

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Harware Organization an Design ectre 11: Introction to IPs path apte from Compter Organization an Design, Patterson & Hennessy, CB IPS-lite processor Compter Want to bil a processor for a sbset

More information

EEC 483 Computer Organization. Branch (Control) Hazards

EEC 483 Computer Organization. Branch (Control) Hazards EEC 483 Compter Organization Section 4.8 Branch Hazards Section 4.9 Exceptions Chans Y Branch (Control) Hazards While execting a previos branch, next instrction address might not yet be known. s n i o

More information

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions COP33 - Computer Architecture Lecture ulti-cycle Design & Exceptions Single Cycle Datapath We designed a processor that requires one cycle per instruction RegDst busw 32 Clk RegWr Rd ux imm6 Rt 5 5 Rs

More information

Review. How to represent real numbers

Review. How to represent real numbers PCWrite PC IorD Review ALUSrcA emread Address Write data emory emwrite em Data IRWrite [3-26] [25-2] [2-6] [5-] [5-] RegDst Read register Read register 2 Write register Write data RegWrite Read data Read

More information

Ch 5: Designing a Single Cycle Datapath

Ch 5: Designing a Single Cycle Datapath Ch 5: esigning a Single Cycle path Computer Systems Architecture CS 365 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Control Memory path Input Output Today s Topic:

More information

Computer Architecture Lecture 6: Multi-cycle Microarchitectures. Prof. Onur Mutlu Carnegie Mellon University Spring 2012, 2/6/2012

Computer Architecture Lecture 6: Multi-cycle Microarchitectures. Prof. Onur Mutlu Carnegie Mellon University Spring 2012, 2/6/2012 8-447 Compter Architectre Lectre 6: lti-cycle icroarchitectres Prof. Onr tl Carnegie ellon University Spring 22, 2/6/22 Reminder: Homeworks Homework soltions Check and stdy the soltions! Learning now is

More information

CPE 335. Basic MIPS Architecture Part II

CPE 335. Basic MIPS Architecture Part II CPE 335 Computer Organization Basic MIPS Architecture Part II Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE232 Basic MIPS Architecture

More information

Solutions for Chapter 6 Exercises

Solutions for Chapter 6 Exercises Soltions for Chapter 6 Eercises Soltions for Chapter 6 Eercises 6. 6.2 a. Shortening the ALU operation will not affect the speedp obtained from pipelining. It wold not affect the clock cycle. b. If the

More information

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu CENG 342 Computer Organization and Design Lecture 6: MIPS Processor - I Bei Yu CEG342 L6. Spring 26 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified

More information

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller ECE468 Computer Organization and Architecture Designing a Multiple Cycle Controller ECE468 multicontroller Review of a Multiple Cycle Implementation The root of the single cycle processor s problems: The

More information

Major CPU Design Steps

Major CPU Design Steps Datapath Major CPU Design Steps. Analyze instruction set operations using independent RTN ISA => RTN => datapath requirements. This provides the the required datapath components and how they are connected

More information

CSE 141 Computer Architecture Summer Session I, Lectures 10 Advanced Topics, Memory Hierarchy and Cache. Pramod V. Argade

CSE 141 Computer Architecture Summer Session I, Lectures 10 Advanced Topics, Memory Hierarchy and Cache. Pramod V. Argade CSE 141 Compter Architectre Smmer Session I, 2004 Lectres 10 Advanced Topics, emory Hierarchy and Cache Pramod V. Argade CSE141: Introdction to Compter Architectre Instrctor: TA: Pramod V. Argade (p2argade@cs.csd.ed)

More information

Designing a Multicycle Processor

Designing a Multicycle Processor Designing a Multicycle Processor Arquitectura de Computadoras Arturo Díaz D PérezP Centro de Investigación n y de Estudios Avanzados del IPN adiaz@cinvestav.mx Arquitectura de Computadoras Multicycle-

More information

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter Control Implementation Alternatives Control may be designed using one of several initial representations. The choice of sequence control, and how logic is represented, can then be determined independently;

More information

CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions. Review of a Multiple Cycle Implementation

CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions. Review of a Multiple Cycle Implementation CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions March 3, 1995 Dave Patterson (patterson@cs) and Shing Kong (shing.kong@eng.sun.com) Slides available on http://http.cs.berkeley.edu/~patterson

More information

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control Chapter 5 The Processor: Datapath and Control Big Picture: Where are We Now? Performance of a

More information

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M CSE 22 Computer Organization Hugh Chesser, CSEB 2U Agenda Topics:. ultiple cycle implementation - complete Patterson: Appendix C, D 2 Breaking the Execution into Clock Cycles Execution of each instruction

More information

Processor: Multi- Cycle Datapath & Control

Processor: Multi- Cycle Datapath & Control Processor: Multi- Cycle Datapath & Control (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann, 27) COURSE

More information

Processor (I) - datapath & control. Hwansoo Han

Processor (I) - datapath & control. Hwansoo Han Processor (I) - datapath & control Hwansoo Han Introduction CPU performance factors Instruction count - Determined by ISA and compiler CPI and Cycle time - Determined by CPU hardware We will examine two

More information

Mapping Control to Hardware

Mapping Control to Hardware C A P P E N D I X A custom format such as this is slave to the architecture of the hardware and the instruction set it serves. The format must strike a proper compromise between ROM size, ROM-output decoding,

More information

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Data Paths and Microprogramming We have spent time looking at the MIPS instruction set architecture and building

More information

CPU Design Steps. EECC550 - Shaaban

CPU Design Steps. EECC550 - Shaaban CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements. 2. Select set of datapath components & establish clock methodology. 3. Assemble datapath meeting the

More information

MIPS-Lite Single-Cycle Control

MIPS-Lite Single-Cycle Control MIPS-Lite Single-Cycle Control COE68: Computer Organization and Architecture Dr. Gul N. Khan http://www.ee.ryerson.ca/~gnkhan Electrical and Computer Engineering Ryerson University Overview Single cycle

More information

CPU Organization (Design)

CPU Organization (Design) ISA Requirements CPU Organization (Design) Datapath Design: Capabilities & performance characteristics of principal Functional Units (FUs) needed by ISA instructions (e.g., Registers, ALU, Shifters, Logic

More information

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath COMP33 - Computer Architecture Lecture 8 Designing a Single Cycle Datapath The Big Picture The Five Classic Components of a Computer Processor Input Control Memory Datapath Output The Big Picture: The

More information

Multiple Cycle Data Path

Multiple Cycle Data Path Multiple Cycle Data Path CS 365 Lecture 7 Prof. Yih Huang CS365 1 Multicycle Approach Break up the instructions into steps, each step takes a cycle balance the amount of work to be done restrict each cycle

More information

Single-Cycle Examples, Multi-Cycle Introduction

Single-Cycle Examples, Multi-Cycle Introduction Single-Cycle Examples, ulti-cycle Introduction 1 Today s enu Single cycle examples Single cycle machines vs. multi-cycle machines Why multi-cycle? Comparative performance Physical and Logical Design of

More information

Lecture 10 Multi-Cycle Implementation

Lecture 10 Multi-Cycle Implementation Lecture 10 ulti-cycle Implementation 1 Today s enu ulti-cycle machines Why multi-cycle? Comparative performance Physical and Logical Design of Datapath and Control icroprogramming 2 ulti-cycle Solution

More information

Review: Abstract Implementation View

Review: Abstract Implementation View Review: Abstract Implementation View Split memory (Harvard) model - single cycle operation Simplified to contain only the instructions: memory-reference instructions: lw, sw arithmetic-logical instructions:

More information

ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller. Review of a Multiple Cycle Implementation

ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller. Review of a Multiple Cycle Implementation ECE 6 Computer Architecture Lecture : Designing a Multiple Cycle ler 6 multicontroller. Review of a Multiple Cycle Implementation The root of the single cycle processor s problems: The cycle time has to

More information

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor CS 52 Computer Architecture and Engineering Lecture 8 Single-Cycle (Con t) Designing a Multicycle Processor February 23, 24 John Kubiatowicz (www.cs.berkeley.edu/~kubitron) lecture slides: http://inst.eecs.berkeley.edu/~cs52/

More information

Single Cycle Datapath

Single Cycle Datapath Single Cycle atapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili Section 4.1-4.4 Appendices B.3, B.7, B.8, B.11,.2 ing Note: Appendices A-E in the hardcopy text correspond to chapters 7-11 in

More information

CENG 3420 Lecture 06: Datapath

CENG 3420 Lecture 06: Datapath CENG 342 Lecture 6: Datapath Bei Yu byu@cse.cuhk.edu.hk CENG342 L6. Spring 27 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified to contain only: memory-reference

More information