Chapter 8: Programmable Processors

Size: px
Start display at page:

Download "Chapter 8: Programmable Processors"

Transcription

1 Chapter 8: Programmable Processors Slides to accompany the textbook, First Edition, by, John Wiley and Sons Publishers, Copyright 2007 Instructors of courses requiring Vahid's textbook (published by John Wiley and Sons) have permission to modify and use these slides for customary course-related activities, subject to keeping Digital this copyright Design notice in place and unmodified. These slides may be posted as unanimated pdf versions on publicly-accessible course websites.. PowerPoint source (or pdf with animations) may not be posted to publicly-accessible websites, but may be posted for students on internal protected sites or distributed directly to students by other electronic means. Instructors may make printouts of the slides available to students for a reasonable photocopying charge, without incurring royalties. Any other use requires explicit permission. Instructors 1 may obtain PowerPoint Frank source Vahid or obtain special use permissions from Wiley see for information.

2 Introduction 8.1 Programmable (general-purpose) processor Mass-produced, then programmed to implement different processing tasks Well-known common programmable processors: Pentium, Sparc, PowerPC Lesser-known but still common: ARM, MIPS, 8051, PIC Low-cost embedded processors found in cell phones, blinking shoes, etc. Instructive to design a very simple programmable processor Seatbelt warning light single-purpose processor Real processors can be much more complex e x4 x(t) x(t-1) x(t-2) xt0 c0 xt1 c1 xt2 c2 + + reg 3-tap F filter single-purpose processor s i Seatbelt warning light program Instruction memory I PC 0 Note: Slides with animation are denoted with a small red "a" near the animated items 3-tap F filter program a t a p a r t n o c o t g Other programs Data memory D n-bit 2x1 Register file RF ALU Datapath General-purpose processor 2

3 Basic Architecture Processing generally consists of: Loading some data Transforming that data Storing that data Basic datapath: Useful circuit in a programmable processor Can read/write data memory, where main data exists Has register file to hold data locally Has ALU to transform local data s i Data memory D n-bit 2x1 t a p Register file RF a a r t n o c o t g ALU 8.2 somehow connected to the outside world Datapath 3

4 Basic Datapath Operations Load operation: Load data from data memory to RF ALU operation: Transforms data by passing one or two RF register values through ALU, performing operation (ADD, SUB, AND, OR, etc.), and writing back into RF. Store operation: Stores RF register value back into data memory Each operation can be done in one clock cycle Data memory D Data memory D Data memory D n-bit 2x1 n-bit 2x1 n-bit 2x1 Register file RF Register file RF Register file RF ALU ALU ALU Load operation ALU operation Store operation 4

5 Basic Datapath Operations Q: Which are valid single-cycle operations for given datapath? Move D[1] to RF[1] (i.e., RF[1] = D[1]) A: YES That's a load operation Store RF[1] to D[9] and store RF[2] to D[10] A: NO Requires two separate store operations Add D[0] plus D[1], store result in D[9] A: NO ALU operation (ADD) only works with RF. Requires two load operations (e.g., RF[0]=D[0]; RF[1]=D[1], an ALU operation (e.g., RF[2]=RF[0]+RF[1]), and a store operation (e.g., D[9]=RF[2]) Data memory D Data memory D Data memory D n-bit 2x1 n-bit 2x1 n-bit 2x1 Register file RF Register file RF Register file RF ALU ALU ALU Load operation ALU operation Store operation 5

6 Exercise: Basic Datapath Operations Q: How many cycles does each of the following take for given datapath? Move RF[1] to RF[2] 1 Add D[8] with RF[2] and store the result in RF[4] 2 Add D[8] with RF[1], then add the result with RF[4], and store the final result in D[8] 4 X.S. Hu 6

7 Basic Architecture Control Unit D[9] = D[0] + D[1] requires a sequence of four datapath operations: 0: RF[0] = D[0] 1: RF[1] = D[1] 2: RF[2] = RF[0] + RF[1] 3: D[9] = RF[2] Each operation is an instruction Sequence of instructions program Looks cumbersome, but that's the world of programmable processors Decomposing desired computations into processor-supported operations Store program in Instruction memory reads each instruction and executes it on the datapath PC: Program counter address of current instruction : Instruction register current instruction Instruction memory 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC I Data memory D n-bit 2x1 Register file RF ALU Datapath 7

8 Basic Architecture Control Unit To carry out each instruction, the control unit must: Fetch Read instruction from inst. mem. Decode Determine the operation and operands of the instruction Execute Carry out the instruction's operation using the datapath Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 0 >1 (a) Fetch RF[0]=D[0] Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 1 RF[0]=D[0] (b) Decode "load" Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 1 RF[0]=D[0] Execute Data memory D D[0]: 99 n-bit 2x1 Register file RF R[0]:?? 99 ALU (c) Datapath 8

9 Basic Architecture Control Unit To carry out each instruction, the control unit must: Fetch Read instruction from inst. mem. Decode Determine the operation and operands of the instruction Execute Carry out the instruction's operation using the datapath Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 1 >2 (a) Fetch RF[1]=D[1} Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 2 RF[1]=D[1] (b) Decode "load" Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 2 RF[1]=D[1] Execute Data memory D D[1]: 102 n-bit 2x1 Register file RF R[1]:?? 102 ALU (c) Datapath 9

10 Basic Architecture Control Unit To carry out each instruction, the control unit must: Fetch Read instruction from inst. mem. Decode Determine the operation and operands of the instruction Execute Carry out the instruction's operation using the datapath Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 2 >3 (a) Fetch RF[2]=RF[0]+RF[1] Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 3 RF[2]=RF[0]+RF[1] (b) Decode "ALU (add)" Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 3 RF[2]=RF[0]+RF[1] Execute Data memory D n-bit 2x1 Register file RF R[2]:?? 201 ALU (c) Datapath

11 Basic Architecture Control Unit To carry out each instruction, the control unit must: Fetch Read instruction from inst. mem. Decode Determine the operation and operands of the instruction Execute Carry out the instruction's operation using the datapath Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 3 >4 (a) Fetch D[9]=RF[2] Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 4 D[9]=RF[2] (b) Decode "store" Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] PC 4 D[9]=RF[2] Execute Data memory D D[9]=?? 201 n-bit 2x1 Register file RF R[2]: 201 ALU (c) Datapath 11

12 Basic Architecture Control Unit Init PC=0 Fetch = I[PC] PC=PC+1 Decode Execute Instruction memory I 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] Data memory D PC n-bit 2x1 Register file RF Datapath ALU 12

13 Creating a Sequence of Instructions Q: Create sequence of instructions to compute D[3] = D[0]+D[1]+D[2] on earlier-introduced processor A1: One possible sequence A2: Alternative sequence First load data memory First load D[0] and D[1] and locations into register file add them R[3] = D[0] R[1] = D[0] R[4] = D[1] R[2] = D[1] R[2] = D[2] R[1] = R[1] + R[2] (Note arbitrary register locations) Next, load D[2] and add Next, perform the additions R[2] = D[2] R[1] = R[3] + R[4] R[1] = R[1] + R[2] Finally, store result D[3] = R[1] R[1] = R[1] + R[2] Finally, store result D[3] = R[1] 13

14 Exercise: Creating Instruction Sequences Q1: D[8] = D[8] + RF[1] + RF[4] RF[2] = RF[1] + RF[4] RF[3] = D[8] RF[2] = RF[2] + RF[3] D[8] = RF[2] Q2: RF[2] = RF[1] RF[2] = RF[1] + 0 X.S. Hu 14

15 Number of Cycles Q: How many cycles are needed to execute six instructions using the earlier-described processor? A: Each instruction requires 3 cycles 1 to fetch, 1 to decode, and 1 to execute Thus, 6 instr * 3 cycles/instr = 18 cycles 15

16 Three-Instruction Programmable Processor 8.3 Instruction Set List of allowable instructions and their representation in memory, e.g., Load instruction 0000 r 3 r 2 r 1 r 0 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 Store instruction 0001 r 3 r 2 r 1 r 0 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 Add instruction 0010 ra 3 ra 2 ra 1 ra 0 rb 3 rb 2 rb 1 rb 0 rc 3 rc 2 rc 1 rc 0 Desired program 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2} Instruction memory 0: : : : I Instructions in 0s and 1s machine code opcode operands

17 Program for Three-Instruction Processor Desired program 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2} Instruction memoryi 0: : : : Computes D[9]=D[0]+D[1] Data memory D PC n-bit 2 1 Register file RF ALU Datapath 17

18 Program for Three-Instruction Processor Another example program in machine code Compute D[5] = D[5] + D[6] + D[7] 0: // RF[0] = D[5] 1: // RF[1] = D[6] 2: // RF[2] = D[7] 3: // RF[0] = RF[0] + RF[1] // which is D[5]+D[6] 4: // RF[0] = RF[0] + RF[2] // now D[5]+D[6]+D[7] 5: // D[5] = RF[0] Load instruction 0000 r 3 r 2 r 1 r 0 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 Store instruction 0001 r 3 r 2 r 1 r 0 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 Add instruction 0010 ra 3 ra 2 ra 1 ra 0 rb 3 rb 2 rb 1 rb 0 rc 3 rc 2 rc 1 rc 0 18

19 Assembly Code Machine code (0s and 1s) hard to work with Assembly code Uses mnemonics Load instruction MOV Ra, d specifies the operation RF[a]=D[d]. a must be 0,1,..., or 15 so R0 means RF[0], R1 means RF[1], etc. d must be 0, 1,..., 255 Store instruction MOV d, Ra specifies the operation D[d]=RF[a] Add instruction ADD Ra, Rb, Rc specifies the operation RF[a]=RF[b]+RF[c] Desired program 0: RF[0]=D[0] 1: RF[1]=D[1] 2: RF[2]=RF[0]+RF[1] 3: D[9]=RF[2] 0: : : : : MOV R0, 0 1: MOV R1, 1 2: ADD R2, R0, R1 3: MOV 9, R2 machine code assembly code 19

20 Exercise: Creating Assembly Code Q1: D[8] = D[8] + RF[1] + RF[4] RF[2] = RF[1] + RF[4] Add R2, R1, R4 RF[3] = D[8] MOV R3, 8 RF[2] = RF[2] + RF[3] Add R2, R2, R3 D[8] = RF[2] MOV 8, R2 Q2: RF[2] = RF[1] RF[2] = RF[1] + 0 MOV R1, 0?? X.S. Hu 20

21 Control-Unit and Datapath for Three-Instruction Processor To design the processor, we can begin with a high-level state machine description of the processor's behavior Init PC=0 Fetch =I[PC] PC=PC+1 Decode op=0000 op=0001 op=0010 Load RF[ra]=D[d] Store D[d]=RF[ra] Add RF[ra] = RF[rb]+ RF[rc] 21

22 Control-Unit and Datapath for Three-Instruction Processor Create detailed connections among components Load Init PC=0 RF[ra]=D[d] Fetch Decode Store D[d]=RF[ra] =I[PC] PC=PC+1 op=0000 op=0001 op=0010 Add RF[ra] = RF[rb]+ RF[rc] addr PC clr up rd _ r d R _ l d I P C _ c l r I P C _ i n c data Id I D_addr 8 D_rd D_wr RF_s RF_W_addr 4 RF_W_wr RF_Rp_addr 4 RF_Rp_rd RF_Rq_addr 4 RF_Rq_rd alu_s0 addr rd 256x wr W_data R_data s 1 -bit 2x1 W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd Rp_data 0 D x RF Rq_data s0 A B ALU Datapath 22

23 Control-Unit and Datapath for Three-Instruction Convert high-level state machine description of entire processor to FSM description of controller that uses datapath and other components to achieve same behavior s t a t e s Init PC=0 PC_ clr=1 Load RF[ra]=D[d] D_addr=d D_rd=1 RF_s=1 RF_W_addr=ra RF_W_wr=1 E x e c u t e Fetch Decode op=0000 op=0001 op=0010 Store D[d]=RF[ra] D_addr=d D_wr=1 RF_s=X RF_Rp_addr=ra RF_Rp_rd=1 =I[PC] PC=PC+1 I_rd=1 PC=PC+1 PC_inc=1 _ld=1 Add Add RF[ra] RF[ra] = RF[rb]+ = RF[rb]+ RF[rc] RF_Rp_addr=rb RF[rc] RF_Rp_rd=1 RF_s=0 RF_Rq_addr=rc RF_Rq _rd=1 RF_W_addr=ra RF_W_wr=1 alu_s0=1 Processor addr PC clr up rd data Id _ r d R _ l d I P C _ c l r I P C _ i n c I RF_W_addr RF_W_wr RF_Rp_addr RF_Rp_rd RF_Rq_addr RF_Rq_rd alu_s0 D_addr 8 addr D_rd rd D_wr 256x wr W_dataR_data RF_s s Datapath 1 0 -bit 2x1 W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd D x RF Rp_data Rq_data s0 A B ALU 23

24 Exercise: Understanding the Processor Design (1) Will the correct instruction be fetched if PC is incremented during the fetch cycle? No, since PC will not be updated until the beginning of the next cycle While executing MOV R1, 3, what is the content of PC and at the end of the 1st cycle, 2nd cycle, 3rd cycle, etc.? 1st cycle: PC = 0, = xxxx 2 nd cycle: PC = 1, = I[0] 3 rd cycle: PC = 1, = I[0] What if it takes more than 1 cycle for memory read? Cannot decode until is loaded X.S. Hu 24

25 Exercise: Understanding the Processor Design (2) Q1: D[8] = D[8] + RF[1] + RF[4] I[15]: Add R2, R1, R4 RF[1] = 4 CLK I[]: MOV R3, 8 RF[4] = 5 I[17]: Add R2, R2, R3 D[8] = 7 (n+1) Fetch PC=15 =xxxx (n+2) Decode PC= =2214h (n+3) Execute PC= =2214h RF[2]= xxxxh (n+4) (n+5) Fetch Decode PC= PC=17 =2214h =0308h RF[2]= 0009h (n+6) Execute PC=17 =0308h RF[3]= xxxxh (n+7) Fetch PC=17 =0308h RF[3]= 0007h X.S. Hu 25

26 Exercise: Extending the Three-Instruction Processor Add a instruction: JMP: jump to a location specified by the 12-bit offset RTL: PC = PC+I[15:4] AS: JMP 3 MC: a+b-1 12 addr PC up ld clr rd data Id I D_addr 8 D_rd D_wr RF_s addr rd 256x wr W_data R_data s 1 -bit 2x1 0 D Init PC=0 Fetch Decode =I[PC] PC=PC+1 RF_W_addr 4 RF_W_wr RF_Rp_addr 4 RF_Rp_rd RF_Rq_addr 4 RF_Rq_rd W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd x RF op=0000 op=0001 op=0010 op=1000 Jump alu_s0 Rp_data Rq_data PC_ld =1 s0 A B ALU X.S. Hu Datapath 26

27 A Six-Instruction Programmable Processor 8.4 Let's add three more instructions: Load-constant instruction 0011 r 3 r 2 r 1 r 0 c 7 c 6 c 5 c 4 c 3 c 2 c 1 c 0 MOV Ra, #c specifies the operation RF[a]=c Subtract instruction 0100 ra 3 ra 2 ra 1 ra 0 rb 3 rb 2 rb 1 rb 0 rc 3 rc 2 rc 1 rc 0 SUB Ra, Rb, Rc specifies the operation RF[a]=RF[b] RF[c] Jump-if-zero instruction 0101 ra 3 ra 2 ra 1 ra 0 o 7 o 6 o 5 o 4 o 3 o 2 o 1 o 0 JMPZ Ra, offset specifies the operation PC = PC + offset if RF[a] is 0 27

28 Program for the Six-Instruction Processor Example program Count number of non-zero words in D[4] and D[5] Result will be either 0, 1, or 2 Put result in D[9] _ r d I MOV R0, #0; // initialize result to 0 MOV R1, #1; // constant 1 for incrementing result P C _ l d P C _ c Pl r C _ i n c I R _ l d MOV R2, 4; // get data memory location 4 JMPZ R2, lab1; // if zero, skip next instruction ADD R0, R0, R1; // not zero, so increment result lab1:mov R2, 5; // get data memory location 5 JMPZ R2, lab2; // if zero, skip next instruction ADD R0, R0, R1; //not zero, so increment result lab2:mov 9, R0; // store result in data memory location (a) (b) 28

29 Exercise: More on Programming Q1: Compare the contents of D[4] and D[5]. If equal, D[3] =1, otherwise set D[3]=0. MOV R0, #1 // RF[0] = 1 MOV R1, 4 // RF[1] = D[4] MOV R2, 5 // RF[2] = D[5] SUB R3, R1, R2 // RF[3] = RF[1]-RF[2] JMPZ R3, B1 // if RF[3] = 0, jump to B1 SUB R0, R0, R0 // RF[0] = 0 B1: MOV 3, R0 // D[3] = RF[0] X.S. Hu 29

30 Modifications to the Three-Instruction Processor Load-constant instruction 0011 r 3 r 2 r 1 r 0 c 7 c 6 c 5 c 4 c 3 c 2 c 1 c 0 Subtract instruction 0100 ra 3 ra 2 ra 1 ra 0 rb 3 rb 2 rb 1 rb 0 rc 3 rc 2 rc 1 rc 0 Jump-if-zero instruction 0101 ra 3 ra 2 ra 1 ra 0 o 7 o 6 o 5 o 4 o 3 o 2 o 1 o 0 addr PC clr up rd data Id I RF_W_addr RF_W_wr RF_Rp_addr RF_Rp_rd RF_Rq_addr RF_Rq_rd alu_s0 D_addr 8 addr D_rd rd D_wr 256x wr W_dataR_data RF_s s Datapath 1 0 -bit 2x1 W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd D x RF Rp_data Rq_data s0 A B ALU X.S. Hu 30

31 Extending the Control-Unit and Datapath 1: The load constant instruction requires that the register file be able to load data from [7..0], in addition to data from data memory or the ALU output. Thus, we widen the register file s multiplexer from 2x1 to 3x1, add another mux control signal, and also create a new signal coming from the controller labeled RF_W_data, which will connect with [7..0]. + 2: The subtract instruction requires that we use 3ban ALU capable of subtraction, so we add another a+b-1 ALU control signal. 3: The jump-if-zero instruction requires that we be able to detect if a register is zero, and that we be able to add [7..0] to the PC. 3a: We insert a datapath component to detect if the register file s Rp read port is all zeros (that component would just be a NOR gate). 3b: We also upgrade the PC register so it can be loaded with PC plus [7..0]. The adder used for this also subtracts 1 from the sum, to compensate for the fact that the Fetch state already added 1 to the PC. ld addr PC _ r d I clr up [7..0] rd P C _ c Pl r P C _ l d C _ i n c I R _ l d data Id D_addr D_rd D_wr RF_W_addr RF_Rp_addr RF_Rq_addr RF_Rp_zero 1 8 RF_W_data 1 RF_s1 RF_s0 alu_s1 alu_s a =0 addr rd 256x wr W_data R_data Datapath 2 s1 s0 1 -bit 3x1 W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd Rp_data s1 s0 0 A B ALU D x RF Rq_data s s ALU operation pass A through A+B A-B 31

32 FSM for the Six-Instruction Processor Init PC_clr=1 Fetch I_rd=1 PC_inc=1 _ld=1 Decode op=0000 op=0001 op=0010 op=0011 op=0100 op=0101 Load D_addr=d D_rd=1 RF_s1=0 RF_s0=1 RF_W_addr=ra RF_W_wr=1 Store D_addr=d D_wr=1 RF_s1=X RF_s0=X RF_Rp_addr=ra RF_Rp_rd=1 Add RF_Rp_addr=rb RF_Rp_rd=1 RF_s1=0 RF_s0=0 RF_Rq_add=rc RF_Rq_rd=1 RF_W_addr_ra RF_W_wr=1 alu_s1=0 alu_s0=1 RF_s1=1 RF_s0=0 RF_W_addr=ra RF_W_wr=1 Subtract RF_Rp_addr=rb RF_Rp_rd=1 RF_s1=0 RF_s0=0 RF_Rq_addr=rc RF_Rq_rd=1 RF_W_addr=ra RF_W_wr=1 alu_s1=1 alu_s0=0 RF_Rp_zero Jump-if-zero RF_Rp_addr=ra RF_Rp_rd=1 R F _ R p _ z e r o Loadconstant Jump-ifzero-jmp PC_ld=1? RF_Rp_zero' R F _ R p _ z e r o 32

33 More on Processor Implementation (1) Decode op=0000 op=0001 op=0010 op=0011 op=0100 op=0101 Load Store Add Loadconstant Subtract Jump-if-zero D_addr=d D_rd=1 RF_s1 =0 RF_s0 =1 RF_W_addr=ra RF_W_wr=1 D_addr=d D_wr=1 RF_s1 =X RF_s0 =X RF_Rp_addr=ra RF_Rp_rd=1 RF_Rp_addr=rb RF_Rp_rd=1 RF_s1 =0 RF_s0 =0 RF_Rq_add=rc RF_Rq_rd=1 RF_W_addr_ra RF_W_wr=1 alu_s1 =0 alu_s0 =1 RF_s1=1 RF_s0=0 RF_W_addr=ra RF_W_wr=1 RF_Rp_addr=rb RF_Rp_rd=1 RF_s1=0 RF_s0=0 RF_Rq_addr=rc RF_Rq_rd=1 RF_W_addr=ra RF_W_wr=1 alu_s1=1 alu_s0=0 RF_Rp_zero RF_Rp_addr=ra RF_Rp_rd=1 Jump-ifzero-jmp PC_ld=1? RF_Rp_zero' X.S. Hu 33

34 More on Processor Implementation (2) + a+b-1 ld addr PC clr up [7..0] rd data Id [7:0] D_addr D_rd D_wr RF_W_data RF_s1 RF_s addr rd wr W_data 2 s1 s0 256 x R_data 1 -bit 3 x 1 0 D RF_Rp_s [11:8] [7:4] [11:8] [3:0] RF_W_addr RF_Rp_addr RF_Rq_addr W_data W_addr W_wr Rp_addr Rp_rd Rq_addr Rq_rd x RF? RF_Rp_zero alu_s1 alu_s0 =0 Datapath Rp_data s1 s0 A ALU Rq_data B X.S. Hu 34

35 What is the Problem?? X.S. Hu 35

36 Further Extensions to the Programmable 8.5 Processor Typical processor instruction set will contain dozens of data movement (e.g., loads, stores), ALU (e.g., add, sub), and flow-of-control (e.g., jump) instructions Extending the control-unit/datapath follows similarly to previously-shown extensions Input/output extensions Certain memory locations may actually be external pins e.g, D[240] may represent 8-bit input I0, D[255] may represent 8-bit output P7 addr rd wr 0: 1: 2: 239: 240: 241: 248: 255: 256x D W_data R_data I0 I1 P0 P7 36

37 Program using I/O Extensions Recall Chpt 1 Desired motion-at-night detector C-Program Example Programmed microprocessor Custom designed digital circuit Microprocessors a common choice to implement a digital system Easy to program Cheap (as low as $1) Available now M r o r o c I0 I1 I2 I3 I4 I5 I6 I7 p P0 P1 P2 P3 P4 P5 P6 P7 void main() { while (1) { P0 = I0 &&!I1; // F = a and!b, } } 1 a 0 1 b 0 1 F 0 6:00 7:057:06 9:009:01 time 37

38 Program Using Input/Output Extensions Underlying assembly code for C expression I0 &&!I1. 0: MOV R0, 240 // move D[240], which is the value at pin I0, into R0 1: MOV R1, 241 // move D[241], which is that value at pin I1, into R1 2: NOT R1, R1 // compute!i1, assuming existence of a complement instruction 3: AND R0, R0, R1 // compute I0 &&!I1, assuming an AND instruction 4: MOV 248, R0 // move result to D[248], which is pin P0 256x D void main() { while (1) { P0 = I0 &&!I1; // F = a and!b, } } addr rd wr 0: 1: 2: 239: 240: 241: 248: I0 I1 P0 255: P7 W_data R_data 38

39 Chapter Summary Programmable processors are widely used Easy availability, short design time Basic architecture Datapath with register file and ALU with PC,, and controller Memories for instructions and data fetches, decodes, and executes Three-instruction processor with machine-level programs Extended to six instructions Real processors have dozens or hundreds of instructions Extended to access external pins Modern processors are far more sophisticated Instructive to see how one general circuit (programmable processor) can execute variety of behaviors just by programming 0s and 1s into an instruction memory 39

40 Generic Computer Organization Stored Program Machine (vonneumann Model) Instructions are represented as numbers Programs in memory are read or written just as normal data Data Memory Register Data Path Program Memory Control Logic (Interprets the ISA) Clock Program Counter X.S. Hu 40

41 Memory Organization Two main memory organizations: HARVARD ARCHITECTURE PRINCETON ARCHITECTURE Instruction Memory CPU Data Memory CPU Instruction and Data Memory X.S. Hu 41

42 What to Come Next Introduction MIPS Aeembly & instr. set A very simple processor Performance, costs... MIPS Organization Computer implementation X.S. Hu Memory hierarchy Pipelining 42

CSE140L: Components and Design Techniques for Digital Systems Lab. RTL design. Tajana Simunic Rosing. Source: Vahid, Katz

CSE140L: Components and Design Techniques for Digital Systems Lab. RTL design. Tajana Simunic Rosing. Source: Vahid, Katz CSE140L: Components and Design Techniques for Digital Systems Lab RTL design Tajana Simunic Rosing Source: Vahid, Katz 1 Lab #4 due next week Outline Report due at the beginning of class (2pm) Demo hours

More information

Lectures 02, 03 Introduction to Stored Programs"

Lectures 02, 03 Introduction to Stored Programs Lectures 02, 03 Introduction to Stored Programs" Suggested reading:" HP Chapters 1.1-1.3" Some slides/images from Vahid text hence this notice:" Copyright 2007 Frank Vahid Instructors of courses requiring

More information

ECE 274 Digital Logic. Digital Design. Datapath Components Subtractors, Two s Complement, Overflow, ALUs, Register Files Digital Design

ECE 274 Digital Logic. Digital Design. Datapath Components Subtractors, Two s Complement, Overflow, ALUs, Register Files Digital Design ECE 27 Digital Logic Subtractors,, Overflow, ALUs, Register Files Digital Design..0 Digital Design Chapter : Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley and

More information

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University The Processor (1) Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control EE 37 Unit Single-Cycle CPU path and Control CPU Organization Scope We will build a CPU to implement our subset of the MIPS ISA Memory Reference Instructions: Load Word (LW) Store Word (SW) Arithmetic

More information

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories Computer Organization Structure of a Computer Computer design as an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + Control = finite

More information

Chapter 9 Computer Design Basics

Chapter 9 Computer Design Basics Logic and Computer Design Fundamentals Chapter 9 Computer Design asics Part 2 A Simple Computer Charles Kime & Thomas Kaminski 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Overview

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware 4.1 Introduction We will examine two MIPS implementations

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

Computer Organization

Computer Organization Computer Organization! Computer design as an application of digital logic design procedures! Computer = processing unit + memory system! Processing unit = control + datapath! Control = finite state machine

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

The MIPS Processor Datapath

The MIPS Processor Datapath The MIPS Processor Datapath Module Outline MIPS datapath implementation Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational control Assignment: Datapath

More information

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations Chapter 4 The Processor Part I Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations

More information

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture The Processor Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut CSE3666: Introduction to Computer Architecture Introduction CPU performance factors Instruction count

More information

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Chapter 4. The Processor. Computer Architecture and IC Design Lab Chapter 4 The Processor Introduction CPU performance factors CPI Clock Cycle Time Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS

More information

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University The Processor: Datapath and Control Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Introduction CPU performance factors Instruction count Determined

More information

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction CS 61C: Great Ideas in Computer Architecture MIPS CPU Datapath, Control Introduction Instructor: Alan Christopher 7/28/214 Summer 214 -- Lecture #2 1 Review of Last Lecture Critical path constrains clock

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition The Processor - Introduction

More information

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor. COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor The Processor - Introduction

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications EE 3170 Microcontroller Applications Lecture 4 : Processors, Computers, and Controllers - 1.2 (reading assignment), 1.3-1.5 Based on slides for ECE3170 by Profs. Kieckhafer, Davis, Tan, and Cischke Outline

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 25 CPU Design: Designing a Single-cycle CPU Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia T-Mobile s Wi-Fi / Cell phone

More information

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design 1 TDT4255 Computer Design Lecture 4 Magnus Jahre 2 Outline Chapter 4.1 to 4.4 A Multi-cycle Processor Appendix D 3 Chapter 4 The Processor Acknowledgement: Slides are adapted from Morgan Kaufmann companion

More information

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic CS 61C: Great Ideas in Computer Architecture Datapath Instructors: John Wawrzynek & Vladimir Stojanovic http://inst.eecs.berkeley.edu/~cs61c/fa15 1 Components of a Computer Processor Control Enable? Read/Write

More information

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability! inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I CS61C L18 CPU Design: The Single-Cycle I (1)! 2010-07-21!!!Instructor Paul Pearce! Nasty new windows vulnerability!

More information

Laboratory 5 Processor Datapath

Laboratory 5 Processor Datapath Laboratory 5 Processor Datapath Description of HW Instruction Set Architecture 16 bit data bus 8 bit address bus Starting address of every program = 0 (PC initialized to 0 by a reset to begin execution)

More information

CPE 335 Computer Organization. Basic MIPS Architecture Part I

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

More information

Chapter 10 Computer Design Basics

Chapter 10 Computer Design Basics Logic and Computer Design Fundamentals Chapter 10 Computer Design Basics Part 2 A Simple Computer Charles Kime & Thomas Kaminski 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View

More information

Introduction to Digital Logic Missouri S&T University CPE 2210 Hardware Implementations

Introduction to Digital Logic Missouri S&T University CPE 2210 Hardware Implementations Introduction to Digital Logic Missouri S&T University CPE 2210 Hardware Implementations Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science

More information

CSE140: Components and Design Techniques for Digital Systems

CSE140: Components and Design Techniques for Digital Systems CSE4: Components and Design Techniques for Digital Systems Tajana Simunic Rosing Announcements and Outline Check webct grades, make sure everything is there and is correct Pick up graded d homework at

More information

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1 ENG8 Computer Organization and rchitecture MIPS: Data Path Design Part Winter 7 S. reibi School of Engineering University of Guelph Introduction Topics uilding a Complete Data Path for MIPS Multi Cycle

More information

Digital Design. Chapter 9: Hardware Description Languages

Digital Design. Chapter 9: Hardware Description Languages Digital Design Chapter 9: Hardware Description Languages Slides to accompany the textbook Digital Design, with RTL Design, VHDL, and Verilog, 2nd Edition, by, John Wiley and Sons Publishers, 2010. http://www.ddvahid.com

More information

Chapter 4. The Processor Designing the datapath

Chapter 4. The Processor Designing the datapath Chapter 4 The Processor Designing the datapath Introduction CPU performance determined by Instruction Count Clock Cycles per Instruction (CPI) and Cycle time Determined by Instruction Set Architecure (ISA)

More information

Chapter 4 The Processor 1. Chapter 4A. The Processor

Chapter 4 The Processor 1. Chapter 4A. The Processor Chapter 4 The Processor 1 Chapter 4A The Processor Chapter 4 The Processor 2 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 14: One Cycle MIPs Datapath Adapted from Computer Organization and Design, Patterson & Hennessy, UCB R-Format Instructions Read two register operands Perform

More information

The overall datapath for RT, lw,sw beq instrucution

The overall datapath for RT, lw,sw beq instrucution Designing The Main Control Unit: Remember the three instruction classes {R-type, Memory, Branch}: a) R-type : Op rs rt rd shamt funct 1.src 2.src dest. 31-26 25-21 20-16 15-11 10-6 5-0 a) Memory : Op rs

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 2, 2016 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Microprogrammed Control Approach

Microprogrammed Control Approach Microprogrammed Control Approach Considering the FSM for our MIPS subset has 10 states, the complete MIPS instruction set, which contains more than 100 instructions, and considering that these instructions

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

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU CS6C L9 CPU Design : Designing a Single-Cycle CPU () insteecsberkeleyedu/~cs6c CS6C : Machine Structures Lecture #9 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker Review

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering Datapath for a Simplified Processor James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy Introduction

More information

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang Lecture 12: Single-Cycle Control Unit Spring 2018 Jason Tang 1 Topics Control unit design Single cycle processor Control unit circuit implementation 2 Computer Organization Computer Processor Memory Devices

More information

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version:

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version: SISTEMI EMBEDDED Computer Organization Central Processing Unit (CPU) Federico Baronti Last version: 20170516 Processing Unit A processor reads program instructions from the computer s memory and executes

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #19 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker CS61C L19 CPU Design : Designing a Single-Cycle CPU

More information

are Softw Instruction Set Architecture Microarchitecture are rdw

are Softw Instruction Set Architecture Microarchitecture are rdw Program, Application Software Programming Language Compiler/Interpreter Operating System Instruction Set Architecture Hardware Microarchitecture Digital Logic Devices (transistors, etc.) Solid-State Physics

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4 Processor Han Wang CS3410, Spring 2012 Computer Science Cornell University See P&H Chapter 2.16 20, 4.1 4 Announcements Project 1 Available Design Document due in one week. Final Design due in three weeks.

More information

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface Chapter 4 The Processor: A Based on P&H Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 3, 2015 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Systems Architecture

Systems Architecture Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some or all figures from Computer Organization and Design: The Hardware/Software

More information

The Single Cycle Processor

The Single Cycle Processor EECS 322 Computer Architecture The Single Cycle Processor Instructor: Francis G. Wolff wolff@eecs.cwru.edu Case Western Reserve University This presentation uses powerpoint animation: please viewshow CWRU

More information

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23) Lecture Topics Today: Single-Cycle Processors (P&H 4.1-4.4) Next: continued 1 Announcements Milestone #3 (due 2/9) Milestone #4 (due 2/23) Exam #1 (Wednesday, 2/15) 2 1 Exam #1 Wednesday, 2/15 (3:00-4:20

More information

Levels in Processor Design

Levels in Processor Design Levels in Processor Design Circuit design Keywords: transistors, wires etc.results in gates, flip-flops etc. Logical design Putting gates (AND, NAND, ) and flip-flops together to build basic blocks such

More information

Lecture 6 Datapath and Controller

Lecture 6 Datapath and Controller Lecture 6 Datapath and Controller Peng Liu liupeng@zju.edu.cn Windows Editor and Word Processing UltraEdit, EditPlus Gvim Linux or Mac IOS Emacs vi or vim Word Processing(Windows, Linux, and Mac IOS) LaTex

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

16.1. Unit 16. Computer Organization Design of a Simple Processor

16.1. Unit 16. Computer Organization Design of a Simple Processor 6. Unit 6 Computer Organization Design of a Simple Processor HW SW 6.2 You Can Do That Cloud & Distributed Computing (CyberPhysical, Databases, Data Mining,etc.) Applications (AI, Robotics, Graphics, Mobile)

More information

CS222: Processor Design

CS222: Processor Design CS222: Processor Design Dr. A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati Processor Design building blocks Outline A simple implementation: Single Cycle Data pathandcontrol

More information

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control CS Computer Architecture Single-Cycle CPU Datapath & Control Instructor: Sören Schwertfeger http://shtech.org/courses/ca/ School of Information Science and Technology SIST ShanghaiTech University Slides

More information

Lecture 7 Pipelining. Peng Liu.

Lecture 7 Pipelining. Peng Liu. Lecture 7 Pipelining Peng Liu liupeng@zju.edu.cn 1 Review: The Single Cycle Processor 2 Review: Given Datapath,RTL -> Control Instruction Inst Memory Adr Op Fun Rt

More information

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath 361 datapath.1 Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath Outline of Today s Lecture Introduction Where are we with respect to the BIG picture? Questions and Administrative

More information

Computer Systems Architecture Spring 2016

Computer Systems Architecture Spring 2016 Computer Systems Architecture Spring 2016 Lecture 01: Introduction Shuai Wang Department of Computer Science and Technology Nanjing University [Adapted from Computer Architecture: A Quantitative Approach,

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

CSE 141L Computer Architecture Lab Fall Lecture 3

CSE 141L Computer Architecture Lab Fall Lecture 3 CSE 141L Computer Architecture Lab Fall 2005 Lecture 3 Pramod V. Argade November 1, 2005 Fall 2005 CSE 141L Course Schedule Lecture # Date Day Lecture Topic Lab Due 1 9/27 Tuesday No Class 2 10/4 Tuesday

More information

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan) Microarchitecture Design of Digital Circuits 27 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan) http://www.syssec.ethz.ch/education/digitaltechnik_7 Adapted from Digital

More information

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath The Big Picture: Where are We Now? EEM 486: Computer Architecture Lecture 3 The Five Classic Components of a Computer Processor Input Control Memory Designing a Single Cycle path path Output Today s Topic:

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

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization CS/COE0447: Computer Organization and Assembly Language Datapath and Control Sangyeun Cho Dept. of Computer Science A simple MIPS We will design a simple MIPS processor that supports a small instruction

More information

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization A simple MIPS CS/COE447: Computer Organization and Assembly Language Datapath and Control Sangyeun Cho Dept. of Computer Science We will design a simple MIPS processor that supports a small instruction

More information

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Introduction Chapter 4.1 Chapter 4.2 Review: MIPS (RISC) Design Principles Simplicity favors regularity fixed size instructions small number

More information

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Inf2C - Computer Systems Lecture Processor Design Single Cycle Inf2C - Computer Systems Lecture 10-11 Processor Design Single Cycle Boris Grot School of Informatics University of Edinburgh Previous lectures Combinational circuits Combinations of gates (INV, AND, OR,

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19 CO2-3224 Computer Architecture and Programming Languages CAPL Lecture 8 & 9 Dr. Kinga Lipskoch Fall 27 Single Cycle Disadvantages & Advantages Uses the clock cycle inefficiently the clock cycle must be

More information

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L09.1 Smith Spring 2008 MIPS

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory Computer System Hiroaki Kobayashi 7/25/2011 7/25/2011 Computer Engineering 1 Agenda Basic model of modern computer systems Von Neumann Model Stored-program instructions and data are stored on memory Fundamental

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

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

Outline of today s lecture. EEL-4713 Computer Architecture Designing a Multiple-Cycle Processor. What s wrong with our CPI=1 processor?

Outline of today s lecture. EEL-4713 Computer Architecture Designing a Multiple-Cycle Processor. What s wrong with our CPI=1 processor? Outline of today s lecture EEL-7 Computer Architecture Designing a Multiple-Cycle Processor Recap and Introduction Introduction to the Concept of Multiple Cycle Processor Multiple Cycle Implementation

More information

COMP2121: Microprocessors and Interfacing. Instruction Formats and Addressing Modes

COMP2121: Microprocessors and Interfacing. Instruction Formats and Addressing Modes COMP2121: Microprocessors and Interfacing Instruction Formats and Addressing Modes http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2017 1 1 Overview Instruction format AVR instruction format

More information

Introduction to Digital Logic

Introduction to Digital Logic Introduction to Digital Logic Lecture 5 Simple CPU Overview Instruction Set Software Process Software Program High Level Language Description if (x > ) x = x + y - z; a = b*x; Compiler JLEZ X,SKIP MOVE.W

More information

Single Cycle Datapath

Single Cycle Datapath Single Cycle atapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili Section 4.-4.4 Appendices B.7, B.8, B.,.2 Practice Problems:, 4, 6, 9 ing (2) Introduction We will examine two MIPS implementations

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN 5 Edition th The Hardware/Software Interface Chapter 4 The Processor 4.1 Introduction Introduction CPU performance factors Instruction count CPI and Cycle time Determined

More information

Register Transfer Level (RTL) Design

Register Transfer Level (RTL) Design CSE4: Components and Design Techniques for Digital Systems Register Transfer Level (RTL) Design Instructor: Mohsen Imani Slides from Tajana Simunic Rosing CAPE CAPEs are out!!! https://cape.ucsd.edu/students/

More information

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book BUILDING BLOCKS OF A BASIC MICROPROCESSOR Part PowerPoint Format of Lecture 3 of Book Decoder Tri-state device Full adder, full subtractor Arithmetic Logic Unit (ALU) Memories Example showing how to write

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

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

CPU Design John D. Carpinelli, All Rights Reserved 1

CPU Design John D. Carpinelli, All Rights Reserved 1 CPU Design 1997 John D. Carpinelli, All Rights Reserved 1 Outline Register organization ALU design Stacks Instruction formats and types Addressing modes 1997 John D. Carpinelli, All Rights Reserved 2 We

More information

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are

More information

Approaches to Digital System Design

Approaches to Digital System Design Approaches to Digital System Design In Digital Devices, you learned how to create a logic network (Flip-flops + combinational gates) to solve a problem The logic network was SPECIFIC to the problem. To

More information

Learning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW

Learning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW 3-3. Learning Outcomes 3-3. Spiral 3-3 Single Cycle CPU I understand how the single-cycle CPU datapath supports each type of instruction I understand why each mux is needed to select appropriate inputs

More information

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control ELEC 52/62 Computer Architecture and Design Spring 217 Lecture 4: Datapath and Control Ujjwal Guin, Assistant Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL 36849

More information

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 6 Pipelining Part 1

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 6 Pipelining Part 1 ECE 552 / CPS 550 Advanced Computer Architecture I Lecture 6 Pipelining Part 1 Benjamin Lee Electrical and Computer Engineering Duke University www.duke.edu/~bcl15 www.duke.edu/~bcl15/class/class_ece252fall12.html

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN ARM COMPUTER ORGANIZATION AND DESIGN Edition The Hardware/Software Interface Chapter 4 The Processor Modified and extended by R.J. Leduc - 2016 To understand this chapter, you will need to understand some

More information

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath CPE 442 single-cycle datapath.1 Outline of Today s Lecture Recap and Introduction Where are we with respect to the BIG picture?

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1 Guest Lecturer: Sagar Karandikar hfp://inst.eecs.berkeley.edu/~cs61c/ http://research.microsoft.com/apps/pubs/default.aspx?id=212001!

More information

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction EECS150 - Digital Design Lecture 10- CPU Microarchitecture Feb 18, 2010 John Wawrzynek Spring 2010 EECS150 - Lec10-cpu Page 1 Processor Microarchitecture Introduction Microarchitecture: how to implement

More information

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle? CSE 2021: Computer Organization Single Cycle (Review) Lecture-10b CPU Design : Pipelining-1 Overview, Datapath and control Shakil M. Khan 2 Single Cycle with Jump Multi-Cycle Implementation Instruction:

More information

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction Control and Control Components Introduction Software application similar to familiar nested Russian dolls As we ve observed earlier Application written in some high level programming language C, C++, C#,

More information

Pipeline Overview. Dr. Jiang Li. Adapted from the slides provided by the authors. Jiang Li, Ph.D. Department of Computer Science

Pipeline Overview. Dr. Jiang Li. Adapted from the slides provided by the authors. Jiang Li, Ph.D. Department of Computer Science Pipeline Overview Dr. Jiang Li Adapted from the slides provided by the authors Outline MIPS An ISA for Pipelining 5 stage pipelining Structural and Data Hazards Forwarding Branch Schemes Exceptions and

More information