EE 357 Project Multicycle CPU 1

Size: px
Start display at page:

Download "EE 357 Project Multicycle CPU 1"

Transcription

1 EE 357 Project Multicycle CPU Introduction You will work in teams of one or two to implement a basic multicycle CPU that can execute five MIPS instruction types (LW/SW, R-Type, BEQ, J, and ADDI). You will complete the datapath and control unit of the CPU and simulate its execution of some instruction sequences. You will then have the option of extending your CPU to implement more instructions for varying degrees of credit. What you will learn This lab will help you: Understand the detailed design of an appropriate datapath and control unit to execute the given instructions Understand the increasing complexity of the processor design as more instructions are supported Understand the value of simulating the processor design before actual circuit design and fabrication 3 Background Information and Notes To limit the scope of this lab, we will start by implementing only five instruction types: load/store, R-type, BEQ, J (jump), and ADDI. The design is based on the datapath and control unit (FSM) presented in the class notes (and reprinted in Figure and Figure 3) and you are encouraged to review these before beginning. You may also refer to Appendix D on the CD-ROM that was included with CO&D 4 th Ed. for a discussion on control unit implementation. Lab Organization: You will be implementing your CPU using the Xilinx ISE software that is currently used in other EE courses. This software is freely available as the Xilinx ISE Webpack from and is also installed on the campus lab PC s in SAL and other user rooms under the ISE label. This lab will require you to use Verilog to describe the hardware design. System Inputs/Outputs: The inputs to your CPU are clk, rst (active-high), and the memory interface signals. We will also bring out the interface signals to the register file for checking purposes in our testbench to ensure your design is working properly. The provided testbench will instantiate your CPU design and a memory model and connect them together. This is depicted in the Figure below. This lab was originally created by Prof. Gandhi Puvvada and adapted by Prof. Mark Redekopp Last Revised: 3/6/

2 ee357_mcpu_tb (Testbench) For checking purposes reg_ra[4:] reg_rb[4:] reg_radata[3:] reg_rbdata[3:] reg_wa[4:] reg_wdata[3:] regwrite ee357_mcpu (your design) clk rst mem_addr[3:] mem_wdata[3:] mem_rdata[3:] mem_read mem_write Initial Memory clk clk ee357_mem Contents read rst (provided 56x3 mem) from userprovided text mem_addr[9:] mem_addr[7:] file (e.g. memfile.txt) mem_wdata[3:] mem_rdata[3:] mem_read mem_write For checking purposes ee357_mcpu_chkr (Testbench + Checker) Figure - System Block Diagram Important Note: You may NOT change, add, or remove any I/O from your CPU design (leave it alone). However, you may need to change the output declarations to output reg type if you choose to implement that signal in an always block. Provided Components: We have implemented (either fully or partially) several components for you to make the task more manageable. These have been instantiated in the provided CPU skeleton design. ee357_regfile_rw.v: Implements a read-port, write-port, 3x3 register file. The I/O is defined below. It is complete and need not be modified by you. Signal I/O Description ra[4:], rb[4:] Input register select port a and port b data from selected registers (from ra and rb) radata[3:], Output rbdata[3:] wa[4:] Input register select wdata Input Data to write to selected register regwrite Input enable for register selected by wa. ee357_alu.v: You should have completed this design in an earlier lab. You will need to import it to your project via Project..Add Source. A function table is provided below. Be sure you completed the SLT operation near the bottom of the file. You may also modify this component if you want to implement additional instructions, but it should be sufficient for the base CPU design. Last Revised: 3/6/

3 Operation FUNC[5:] RES[3:] UOV (unsigned overflow) ADD OPA + OPB * * SUB OPA OPB * * AND OPA & OPB OR OPA OPB XOR OPA ^ OPB NOR ~(OPA OPB) SLT if OPA < OPB (signed), otherwise * * * = output as traditionally defined SOV (signed overflow) ee357_mcpu_cu.v: Skeleton file starting the design of your control unit state machine. You will need to complete this file. If you choose to implement additional instructions, you may feel free to generate new control signals or modify the current control signal outputs. Note: we have shortened some signal names from those used in the in-class slides (e.g. pcw instead of pcwrite., pcs instead of pcsource, etc.) Just be aware. Datapath Completion: You will need to add all the additional datapath logic (beyond the components provided you) such as muxes, glue logic, glue control, sign extension, temporary registers for the PC, IR, and Target register, etc. You can do this by taking a structural approach (i.e. creating other basic modules [in other files if desired] and instantiating them) or at an RTL-level (using always blocks and assign statements to describe the desired operations. The basic datapath considered in class is shown in Figure 3. You will need to consider additional functionality needed for the ADDI instruction. Control Unit Completion: You will implement the FSM (finite state machine) to generate appropriate control signals for fetch, decode, and instruction execution states. The basic control unit is shown in Figure. Additional states for the ADDI instruction may need to be added. When you complete the control unit you can choose an encoded style implementation or a one-hot implementation. We have provided some opcode declaration/constant (OP_LW, OP_SW, OP_RTYPE, etc.) that will help you decode instruction opcodes to choose the next state to transition to after the decode state. Use these as desired. One important aspect of this project is the size of the memory. While your processor will implement a byte-addressable 3-bit address, we will only interface it to a much smaller 56x3 memory (i.e. 56 words) to limit the amount of initialization and make simulation faster. To this end, while your processor will generate mem_addr[3:], we will only connect 8 bits of the address to the memory (since it has 56 locations). Those 8-bits will be mem_addr[9:]. Mem_addr[:] Last Revised: 3/6/ 3

4 PC Mem Mem [5:] Reg PC MemtoReg RegDst EE 357 Project - Multicycle CPU are unneeded since we will always do word accesses. [In an actual design these bits would be converted to byte enable signals that would select the appropriate bytes from the word.] Mem. Addr. Computation Memory Access 3 Reset Instruc. Fetch Mem ALUSelA= IorD= IR ALUSelB= ALUOp= PCSource= PC Instruc. Decode + Reg. Fetch ALUSelA= ALUSelB= ALUOp= IorD= Mem ALUSelA= ALUSelB= ALUOp= IorD= Memory Access Execution -back 5 Mem ALUSelA= ALUSelB= ALUOp= IorD= 7 ALUSelA= ALUSelB= ALUOp= RegDst= MemtoReg= Reg (Op= BEQ ) ALUSelA= ALUSelB= ALUOp= Target (Op= JMP ) ALUSelA= ALUSelA= ALUSelB= PC ALUSelB= ALUOp= PCSource= ALUOp= PCCond PCSource= Branch Completion (Op= ADDI ) ADDI Exec. ADDI Exec. Jump Completion -back 4 Mem ALUSelA= ALUSelB= ALUOp= IorD= MemtoReg= RegDst= Reg Figure - Multicycle CPU FSM (with dummy states for the ADDI implementation should you need them) IorD PC PCCond IR Control Unit PCSource Target ALUOp ALUSelB ALUSelA PC[3:8] Target Reg. Zero 6 3 Sh. Left 3 Addr. Data Data Memory Instruc[3:6] Instruc[5:] Instruc. Reg. [5:] [:6] [5:] Reg. # Reg. # Reg. # Data data data Register File 4 3 ALU Zero Res. [5:] Sign 6 Extend 3 Sh. Left ALU Ctrl [5:] Figure 3 Base Multicycle CPU Datapath (ADDI not considered) 4 Last Revised: 3/6/

5 Testbench and Checker: A Verilog testbench has been provided for you that will generate the rst signal and hold it active for the first few clock cycles. It also generates the clock signal. You will use Modelsim XE simulator to simulate your CPU fetching and executing instructions from memory. This requires that the memory be initialized with the machine code of some instructions before simulation begins. The memory component provided to you will initialize itself with the values in mem_file.txt in your project folder. The format of this file assumes a single 3-bit word per line, specified in hex. The provided mem_file.txt file has no instructions but does have data at line 33 and 34, which corresponds to address x8 and x84 (recall each line is a 4-byte word so the line number of the text file can be related to address via: Address = (line_no * 4) 4 [the - 4 is because the text editor starts at line while the memory starts at address ]). You will need to convert some instructions to machine code and fill in this memfile.txt by hand. The value of the PC at reset will be address, thus your instructions should start at address in memory. Note: Use the Xilinx Text Editor (File..Open..) to edit mem_file.txt and do NOT use Notepad as it handles the newline characters incorrectly. A simple program (Program ) that uses all the basic instruction classes and loops twice is provided below. Convert that program to machine code manually and enter it into the mem_file.txt to start at address. When you are done remove some lines containing s to ensure the data is still at line 33 and 34 (address x8 and x84). Use this program as an initial test to verify correct execution of your instructions. Another program is provided in mem_file_p.txt that implements a loop to sum an array of integers. It can be used as a second test of your design by copying mem_file_p.txt to mem_file.txt (the memory will always use the contents of mem_file.txt ). It would be wise to save a copy of the original memfile that contained the machine code you hand-assembled for later testing. Just rename it or copy it to another filename and then copy it back if needed. Program to be assembled by you addi $9,$,x84 xor $8,$,$ nor $8,$,$ L: lw $4,-4($9) # data at addr x8 = x lw $5,($9) # data at addr x84 = xfffffffe add $7,$4,$5 sub $8,$4,$5 and $6,$4,$5 or $6,$4,$5 slt $6,$7,$8 slt $9,$8,$ beq $9,$,L sw $6,($9) addi $8,$8, j L L: beq $,$,L # inf. loop Program in mem_file_prog.txt # assumes memory address 8-8c are # filled with an array of 4 integers. add $,$,$ # clear $ addi $,$,4 # set $ = x4 addi $8,$,x8 # setup ptr. addi $4,$,4 # set $4 = x4 addi $,$,- # set $ = - L: slt $,$,$ # comp to $ beq $,$,DONE # b if $ >= lw $6,($8) # get A[i] add $,$,$6 add $8,$8,$4 add $,$,$ j L DONE: sw $,($8) lw $3,($8) L: beq $,$,L # inf. loop Last Revised: 3/6/ 5

6 When hand-assemblying instructions, use the machine code format below: R-Type: 3:6 5: :6 5: :6 5: ADD $rd,$rs,$rt rs rt rd SUB $rd,$rs,$rt rs rt rd AND $rd,$rs,$rt rs rt rd OR $rd,$rs,$rt rs rt rd XOR $rd,$rs,$rt rs rt rd NOR $rd,$rs,$rt rs rt rd SLT $rd,$rs,$rt rs rt rd I-Type: 3:6 5: :6 5: LW $rt,disp 6 ($rs) rs rt disp 6 SW $rt,disp 6 ($rs) rs rt disp 6 ADDI $rt,$rs,imm 6 rs rt imm 6 BEQ $rs,$rt,disp 6 rs rt disp 6 *Note: BEQ adds two s to the LSB s of the displacement and adds that value to the already incremented PC (i.e. target addr. = addr. of BEQ (disp.*4) ). Make sure you remove the two s when you calculate the stored disp. value. J-Type: 3:6 5: J addr 6 addr 6 *Note: J adds two s to the LSB s of the jump address. Thus, you should store the desired address with the two s removed. When you simulate your design you will be able to see the signals that have been brought out as outputs. To determine if your design is working or not, it is likely easiest to look at the memory address, read and write values as well as register read and write values to see if they match expectation [obviously you will need to calculate the expected values from each instruction and ensure the actual values match your expectation]. Once an error is found, you can drill down into the design hierarchy in the Workspace pane to find the component and internal signals that you d like to view and drag the desired signal name to the waveform window. Restart the simulation [restart f] and re-run the simulation [run XXXns]. 6 Last Revised: 3/6/

7 To make debugging easier we have written a Verilog checker model. This checker simulates our own model of the CPU and compares it with what your design produces. If there are errors in your design some limited error messages will be output to the console area of the Modelsim window. Find the first error message and use its timestamp to view the time where your design produces an error. If there are errors in the first 3 ns you can ignore these as this is the system reset time window. Challenge Options: For additional credit, you can add an implementation for more instructions to your CPU design. This will likely entail adding to the datapath and may or may not require adding new states to the control unit (though the state sequences you have are likely generic enough for most of the instructions below). Challenge instructions are the easiest to implement while challenge instructions are harder. If you want to implement challenge instructions you must implement challenge instructions as well. [You can t just choose the hardest]. Challenge Instruction(s): I-Type: 3:6 5: :6 5: BNE $rs,$rt,disp 6 * Rs rt disp 6 R-Type: 3:6 5: :6 5: :6 5: SLL $rd,$rt,shamt Unused rt rd shamt SRL $rd,$rt,shamt Unused rt rd shamt SRA $rd,$rt,shamt Unused rt rd shamt * NO NEW states may be added to the control unit / state machine for BNE Notice the $rt field holds the register operand and shamt (shift amount) is really the second operand. When plugging these into the ALU, let rt still go to inb of the ALU and shamt should be provided to ina. All shift operations MUST write their result (regwrite) on the nd execution state (i.e. F, D, E, E). Challenge Instruction(s): J-Type: 3:6 5: JAL addr 6 addr 6 R-Type: 3:6 5: :6 5: :6 5: JR $rs rs Note: Same operation as J addr and also stores address of following instruction (i.e. PC+4) into register $3. MUST write value to $3 on st execution state (i.e. F, D, E). Note: Loads PC = $rs. Last Revised: 3/6/ 7

8 4 Prelab None. 5 Procedure. Download the ee357_mcpu_proj.zip file from Blackboard and extract the source files to a folder of your choice.. Download the ee357_mcpu_lib.zip file that contains a compiled version of the Golden model of the CPU to compare against your implementation. Be sure to download the version that matched your Modelsim version. Extract it to a folder. 3. Start ModelSim and from the File menu choose Change Directory. Browse and choose the folder where you extracted your source files (in procedure ). Do this each time you re-start the Modelsim application. 4. Using the Modelsim Editor, open the ee357_mcpu.v file (instance name uut ). It is the top-level design file which instantiates the ALU, control unit, and register file. Familiarize yourself with code provided in it. 5. Copy your completed ee357_alu.v into the project folder being sure the implementation of the all the operation is completed (especially slt ). 6. In ee357_mcpu_cu.v complete the state machine design to implement the control logic. For challenge instructions, try to reuse states where possible (i.e. where behavior is the same). 7. In ee357_mcpu.v complete the datapath of the design (adding appropriate code to model the muxes, register, glue logic, etc. 8. Hand assemble program listed earlier in this document using paper and pen. 9. Open mem_file.txt (in the File..Open Dialog, choose TXT files to find it. Type in the machine code from program for each instruction (one per line) and remove as many lines of s as you add so that the provided data is still only line 33 and 34. Save this file.. In ModelSim we need to create a logical mapping to the ee357_mcpu_lib that you downloaded that contains the compiled golden version of the CPU. In Modelsim, choose File..New..Library. Select the middle button a map to an existing library. Enter a library name of ee357_mcpu_lib and then Browse to the library folder you unzipped from step.. Compile all your Verilog design and testbench files by choosing Compile..Compile and browse to the folder with your source files. In the Library drop down box at the top of the Compile window and be sure to 8 Last Revised: 3/6/

9 change it to ee357_mcpu_lib. Select all the Verilog files and click compile. Check the transcript pane to look for errors in compiling your files. Fix them appropriately until it compiles successfully.. Simulate your design by choosing Simulation Start Simulation. Expand the ee357_mcpu_lib library and find the ee357_mcpu_tb. Select it and click OK. You can open waveform window (View..Waveform) and drag signals from the object pane into it Then run the simulation by typing run 5 ns at the prompt in the bottom transcript window. You can view the signals in the Waveform for debug purposes. 3. Modelsim will then run your design for 5 ns using the provided instructions in mem_file.txt and verify its correct operation. To do this, check the Modelsim console area for output errors from the provided checker model. Any errors before 6 ns can be ignored as this is the reset time. You should also review the resulting waveform. You can make this small window its own window by clicking the float button in the upper left. You may also want to convert wide bus signals from binary to hex (right-click and choose Radix..Hexadecimal). Note: It is likely easiest to verify the operation in the waveform by looking at the regwdata and the regwrite signals as well as the PC. Most instructions will affect a register or the PC and thus you can simply verify the result in the last state of execution. It may help to drag these signals to be next to each other on the waveform. Find any errors and deduce their cause by adding more signals to the waveform window and re-running the simulation (type: restart f followed by run 5 ns in the console area of the main Modelsim window). Fix the errors in the Xilinx design files, close Modelsim and re-run the behavioral simulation. 4. Now go to your source folder, save a copy of mem_file.txt (i.e. to mem_file_p.txt ) and copy mem_file_p.txt to mem_file.txt (Essentially, Modelsim will always use mem_file.txt as the memory image, so to run a different program we need to change its contents). This new program implements a loop to sum up a 4-element integer array starting at address x8. Simulate and run this program. Verify its correctness, fixing any errors. 5. Once both programs are working you can choose to implement any of the challenge instruction sets. We recommend saving a copy of any Verilog files you will change (ee357_mcpu.v, ee357_mcpu_cu.v, ee357_alu.v) so that you have a copy of what was working in case you are unsuccessful in adding the new instructions. A challenge program that uses the challenge instructions is provided in the source files ( memfile_challenge.txt ) though it uses both challenge and challenge instructions (i.e. if you implement only challenge instructions you will need to pull out the jal and jr instructions in that file). To figure out what instructions are coded in this program you will need to disassemble the machine code. Last Revised: 3/6/ 9

10 6 Lab Report Name(s): Score: Due: Thurs. April 9 th in lecture. (Detach and turn this sheet along with any other requested work or printouts). Our team implemented. BASE IMPLEMENTATION / CHALLENGE / CHALLENGE Electronic Submission. Submit electronic versions of your any verilog files you modified or created (likely ee357_mcpu.v, ee357_mcpu_cu.v, ee357_alu.v, and any other files you created). AT THE TOP OF ee357_mcpu.v add a comment indicating which options/challenges you implemented.. Zip (not BZIP, not WinRAR, etc.) your files into a zip file and submit the zip file via Blackboard. Hard-Copy Submission 3. Print a title sheet indicating which challenge instruction sets (if any) you chose to implement (i.e. Indicate BASE, CHALLENGE or CHALLENGE ). 4. Print the machine code for your hand-assembled program (i.e. printout just the first page of mem_file.txt we need just the instruction code and not the whole contents of memory). 5. On the datasheet scratch sheet shown on the following page, add the modifications you implemented for the ADDI instruction or any challenge instructions (e.g. needed to increase the ALUSELA mux to be a 3-to- mux with XXX as the 3 rd input.). Add a text explanation on a separate page for each modification explaining what it is for. 6. On the FSM scratch sheet shown after the datapath scratch page, show the control signals in the appropriate ADDI states that you implemented. Also, markup the state diagram or add other states to match your implementation of any challenge instructions. Last Revised: 3/6/

11 PC PC Memory Data Data Addr. Mem Mem Instruc. Reg. Instruc[5:] Instruc[3:6] [5:] Zero IR PCCond PC IorD [5:] [5:] Sign 6 Extend 3 Sh. Left ALU Ctrl Register File 3 Data 4 [5:] Reg. # data ALU Res. [:6] Reg. # data Zero Reg. # [5:] RegDst MemtoReg Reg 6 3 PC[3:8] Control Unit PCSource Target ALUOp ALUSelB ALUSelA Target Reg. Sh. Left 3 Last Revised: 3/6/

12 Instruc. Fetch Mem Instruc. Decode + ALUSelA= Reg. Fetch IorD= IR ALUSelB= ALUOp= PCSource= PC (Op= ADDI ) Reset ADDI ALUSelA= ALUSelB= ALUOp= Target Exec. (Op= JMP ) ADDI Exec. (Op= BEQ ) ALUSelA= Execution ALUSelA= ALUSelA= ALUSelB= ALUSelB= ALUSelB= ALUOp= ALUOp= ALUOp= PCCond IorD= Mem. Addr. PCSource= (Op= SW ) Computation Memory Branch Jump (Op= LW ) Access -back Completion Completion 3 Memory Access Mem ALUSelA= ALUSelB= ALUOp= IorD= 5 Mem 7 ALUSelA= ALUSelB= ALUOp= IorD= ALUSelA= ALUSelB= ALUOp= RegDst= MemtoReg= Reg PC PCSource= -back 4 Mem ALUSelA= ALUSelB= ALUOp= IorD= MemtoReg= RegDst= Reg Last Revised: 3/6/

13 7 EE 357 Project Grading Rubric Name: Score: / Req. / Guideline Base Instrucs Challenge Challenge Mult Sco re (Excellent) 6 ADD SUB AND OR SLT LW SW BEQ JMP BNE SLL SRL SRA JAL JR 8 (Good) 5 (Avg.) (Poor) () Failure / 4 / / / / 4 / 4 / 4 / / / / 4 / / 4 / / Machine Code Test Program Datapath Mods Control Unit Mods Errors Errors -3 Errors 4-5 Errors More than 5 Errors Correct additions that utilized current datapath well to arrive at minimal additions for necessary instructions State sequences correctly implemented added instructions and reused current states to a high degree Journal Carefully considered alternative approaches and described their impact on both FSM & datapath Late - per day, TOTAL max - MAX / Correct additions but did not fully utilize current datapath configuration State sequences correctly implemented added instructions but missed several reuse opportunities Considered several alternative approaches but w/o detail description of their impact Missing a major datapath component that affects a single instruction class. Missing necessary states for at least one instruction class Listed some alternatives w/ no description of impact Missing or more major datapath components that affecting several instruction classes Missing necessary states for more than one instruction class. Alternatives were incomplete or unviable. Missing Missing Missing Last Revised: 3/6/ 3

Final Project: MIPS-like Microprocessor

Final Project: MIPS-like Microprocessor Final Project: MIPS-like Microprocessor Objective: The objective of this project is to design, simulate, and implement a simple 32-bit microprocessor with an instruction set that is similar to a MIPS.

More information

RISC Processor Design

RISC Processor Design RISC Processor Design Single Cycle Implementation - MIPS Virendra Singh Indian Institute of Science Bangalore virendra@computer.org Lecture 13 SE-273: Processor Design Feb 07, 2011 SE-273@SERC 1 Courtesy:

More information

Chapter 5 Solutions: For More Practice

Chapter 5 Solutions: For More Practice Chapter 5 Solutions: For More Practice 1 Chapter 5 Solutions: For More Practice 5.4 Fetching, reading registers, and writing the destination register takes a total of 300ps for both floating point add/subtract

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

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

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

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

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

EE457. Note: Parts of the solutions are extracted from the solutions manual accompanying the text book.

EE457. Note: Parts of the solutions are extracted from the solutions manual accompanying the text book. EE457 Instructor: G. Puvvada ======================================================================= Homework 5b, Solution ======================================================================= Note:

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

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

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation RISC Architecture: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay

More information

Midterm. Sticker winners: if you got >= 50 / 67

Midterm. Sticker winners: if you got >= 50 / 67 CSC258 Week 8 Midterm Class average: 4.2 / 67 (6%) Highest mark: 64.5 / 67 Tests will be return in office hours. Make sure your midterm mark is correct on MarkUs Solution posted on the course website.

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 HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination May 23, 2014 Name: Email: Student ID: Lab Section Number: Instructions: 1. This

More information

Points available Your marks Total 100

Points available Your marks Total 100 CSSE 3 Computer Architecture I Rose-Hulman Institute of Technology Computer Science and Software Engineering Department Exam Name: Section: 3 This exam is closed book. You are allowed to use the reference

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

RISC Design: Multi-Cycle Implementation

RISC Design: Multi-Cycle Implementation RISC Design: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/

More information

LECTURE 6. Multi-Cycle Datapath and Control

LECTURE 6. Multi-Cycle Datapath and Control LECTURE 6 Multi-Cycle Datapath and Control SINGLE-CYCLE IMPLEMENTATION As we ve seen, single-cycle implementation, although easy to implement, could potentially be very inefficient. In single-cycle, we

More information

EE457 Lab 4 Part 4 Seven Questions From Previous Midterm Exams and Final Exams ee457_lab4_part4.fm 10/6/04

EE457 Lab 4 Part 4 Seven Questions From Previous Midterm Exams and Final Exams ee457_lab4_part4.fm 10/6/04 EE457 Lab 4 Part 4 Seven Questions From Previous Midterm Exams and Final Exams ee457_lab4_part4.fm 10/6/04 1 [Based on Question #7 of Summer 1993 Midterm] Remove TARGET register, add ZERO FF: Please refer

More information

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Boris Grot School of Informatics University of Edinburgh Previous lecture: single-cycle processor Inf2C Computer Systems - 2017-2018. Boris

More information

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems ECE 3056: Architecture, Concurrency and Energy of Computation Single and Multi-Cycle Datapaths: Practice Problems 1. Consider the single cycle SPIM datapath. a. Specify the values of the control signals

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

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours. This exam is open book and open notes. You have 2 hours. Problems 1-4 refer to a proposed MIPS instruction lwu (load word - update) which implements update addressing an addressing mode that is used in

More information

CS 351 Exam 2 Mon. 11/2/2015

CS 351 Exam 2 Mon. 11/2/2015 CS 351 Exam 2 Mon. 11/2/2015 Name: Rules and Hints The MIPS cheat sheet and datapath diagram are attached at the end of this exam for your reference. You may use one handwritten 8.5 11 cheat sheet (front

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

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

CSEN 601: Computer System Architecture Summer 2014

CSEN 601: Computer System Architecture Summer 2014 CSEN 601: Computer System Architecture Summer 2014 Practice Assignment 5 Solutions Exercise 5-1: (Midterm Spring 2013) a. What are the values of the control signals (except ALUOp) for each of the following

More information

CS232 Final Exam May 5, 2001

CS232 Final Exam May 5, 2001 CS232 Final Exam May 5, 2 Name: This exam has 4 pages, including this cover. There are six questions, worth a total of 5 points. You have 3 hours. Budget your time! Write clearly and show your work. State

More information

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION CSE 2021 COMPUTER ORGANIZATION HUGH LAS CHESSER 1012U HUGH CHESSER CSEB 1012U W10-M Agenda Topics: 1. Multiple cycle implementation review 2. State Machine 3. Control Unit implementation for Multi-cycle

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

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction Multi-cycle Approach Single cycle CPU State element Combinational logic State element clock one clock cycle or instruction Multi-cycle CPU Requires state elements to hold intermediate values State Element

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

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

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation RISC Architecture: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay

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

Informatics 2C Computer Systems Practical 2 Deadline: 18th November 2009, 4:00 PM

Informatics 2C Computer Systems Practical 2 Deadline: 18th November 2009, 4:00 PM Informatics 2C Computer Systems Practical 2 Deadline: 18th November 2009, 4:00 PM 1 Introduction This practical is based on material in the Computer Systems thread of the course. Its aim is to increase

More information

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR Microprogramming Exceptions and interrupts 9 CMPE Fall 26 A. Di Blas Fall 26 CMPE CPU Multicycle From single-cycle to Multicycle CPU with sequential control: Finite State Machine Textbook Edition: 5.4,

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

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

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August Lecture 8: Control COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Datapath and Control Datapath The collection of state elements, computation elements,

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

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

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

LECTURE 5. Single-Cycle Datapath and Control

LECTURE 5. Single-Cycle Datapath and Control LECTURE 5 Single-Cycle Datapath and Control PROCESSORS In lecture 1, we reminded ourselves that the datapath and control are the two components that come together to be collectively known as the processor.

More information

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION CSE 22 COMPUTER ORGANIZATION HUGH CHESSER CHESSER HUGH CSEB 2U 2U CSEB Agenda Topics:. Sample Exam/Quiz Q - Review 2. Multiple cycle implementation Patterson: Section 4.5 Reminder: Quiz #2 Next Wednesday

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

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer EECS150 - Digital Design Lecture 9- CPU Microarchitecture Feb 15, 2011 John Wawrzynek Spring 2011 EECS150 - Lec09-cpu Page 1 Watson: Jeopardy-playing Computer Watson is made up of a cluster of ninety IBM

More information

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141 EECS 151/251A Fall 2017 Digital Design and Integrated Circuits Instructor: John Wawrzynek and Nicholas Weaver Lecture 13 Project Introduction You will design and optimize a RISC-V processor Phase 1: Design

More information

Single Cycle CPU Design. Mehran Rezaei

Single Cycle CPU Design. Mehran Rezaei Single Cycle CPU Design Mehran Rezaei What does it mean? Instruction Fetch Instruction Memory clk pc 32 32 address add $t,$t,$t2 instruction Next Logic to generate the address of next instruction The Branch

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

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

Laboratory Exercise 6 Pipelined Processors 0.0

Laboratory Exercise 6 Pipelined Processors 0.0 Laboratory Exercise 6 Pipelined Processors 0.0 Goals After this laboratory exercise, you should understand the basic principles of how pipelining works, including the problems of data and branch hazards

More information

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Initial Representation Finite State Diagram. Logic Representation Logic Equations 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

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

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

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

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

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

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

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support Components of an ISA EE 357 Unit 11 MIPS ISA 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support SUBtract instruc. vs. NEGate + ADD instrucs. 3. Registers accessible

More information

The Evolution of Microprocessors. Per Stenström

The Evolution of Microprocessors. Per Stenström The Evolution of Microprocessors Per Stenström Processor (Core) Processor (Core) Processor (Core) L1 Cache L1 Cache L1 Cache L2 Cache Microprocessor Chip Memory Evolution of Microprocessors Multicycle

More information

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100 EE 47 Midterm Summer 4 Redekopp Name: Closed Book / minutes No CALCULATORS Score: /. (7 pts.) Short Answer [Fill in the blanks or select the correct answer] a. If a control signal must be valid during

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

CS3350B Computer Architecture Quiz 3 March 15, 2018 CS3350B Computer Architecture Quiz 3 March 15, 2018 Student ID number: Student Last Name: Question 1.1 1.2 1.3 2.1 2.2 2.3 Total Marks The quiz consists of two exercises. The expected duration is 30 minutes.

More information

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Final Exam This is a closed-book take-home exam. You are permitted a calculator and two 8.5x sheets of paper with notes. The exam

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

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation ICS 233 COMPUTER ARCHITECTURE MIPS Processor Design Multicycle Implementation Lecture 23 1 Add immediate unsigned Subtract unsigned And And immediate Or Or immediate Nor Shift left logical Shift right

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

ECE Exam I February 19 th, :00 pm 4:25pm

ECE Exam I February 19 th, :00 pm 4:25pm ECE 3056 Exam I February 19 th, 2015 3:00 pm 4:25pm 1. The exam is closed, notes, closed text, and no calculators. 2. The Georgia Tech Honor Code governs this examination. 3. There are 4 questions and

More information

CSE 378 Midterm 2/12/10 Sample Solution

CSE 378 Midterm 2/12/10 Sample Solution Question 1. (6 points) (a) Rewrite the instruction sub $v0,$t8,$a2 using absolute register numbers instead of symbolic names (i.e., if the instruction contained $at, you would rewrite that as $1.) sub

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

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100 EE 47 Midterm Summer 4 Redekopp Name: Closed Book / minutes No CALCULATORS Score: /. (7 pts.) Short Answer [Fill in the blanks or select the correct answer] a. If a control signal must be valid during

More information

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade CSE 141 Computer Architecture Summer Session 1 2004 Lecture 3 ALU Part 2 Single Cycle CPU Part 1 Pramod V. Argade Reading Assignment Announcements Chapter 5: The Processor: Datapath and Control, Sec. 5.3-5.4

More information

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2003 John Kubiatowicz Midterm I March 2, 2003 CS52 Computer Architecture and Engineering Your Name: SID Number:

More information

Processor (multi-cycle)

Processor (multi-cycle) CS359: Computer Architecture Processor (multi-cycle) Yanyan Shen Department of Computer Science and Engineering Five Instruction Steps ) Instruction Fetch ) Instruction Decode and Register Fetch 3) R-type

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

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

Multicycle conclusion

Multicycle conclusion Multicycle conclusion The last few lectures covered a lot of material! We introduced a multicycle datapath, where different instructions take different numbers of cycles to execute. A multicycle unit is

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

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations ECE7 Computer Architecture Single Cycle Control Review: 3a: Overview of the Fetch Unit The common operations Fetch the : mem[] Update the program counter: Sequential Code: < + Branch and Jump: < something

More information

CPU Design for Computer Integrated Experiment

CPU Design for Computer Integrated Experiment CPU Design for Computer Integrated Experiment Shan Lu, Guangyao Li, Yijianan Wang CEIE, Tongji University, Shanghai, China Abstract - Considering the necessity and difficulty of designing a CPU for students,

More information

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology Computer Organization MIPS Architecture Department of Computer Science Missouri University of Science & Technology hurson@mst.edu Computer Organization Note, this unit will be covered in three lectures.

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

Control Unit for Multiple Cycle Implementation

Control Unit for Multiple Cycle Implementation Control Unit for Multiple Cycle Implementation Control is more complex than in single cycle since: Need to define control signals for each step Need to know which step we are on Two methods for designing

More information

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design Harris Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design The controller for your MIPS processor is responsible for generating the signals to the datapath to fetch and execute each instruction.

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

Grading: 3 pts each part. If answer is correct but uses more instructions, 1 pt off. Wrong answer 3pts off.

Grading: 3 pts each part. If answer is correct but uses more instructions, 1 pt off. Wrong answer 3pts off. Department of Electrical and Computer Engineering University of Wisconsin Madison ECE 552 Introductions to Computer Architecture Homework #2 (Suggested Solution) 1. (10 points) MIPS and C program translations

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

CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation

CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation Note that these questions are taken from the previous final exmas of CSE2021 and should serve as practice

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

Digital Design and Computer Architecture Harris and Harris

Digital Design and Computer Architecture Harris and Harris Digital Design and Computer Architecture Harris and Harris Lab 0: Multicycle Processor (Part ) Introduction In this lab and the next, you will design and build your own multicycle MIPS processor. You will

More information

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction Laboratory 6 6. Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction 6.1. Objectives Study, design, implement and test Instruction Decode Unit for the 16-bit Single-Cycle MIPS

More information

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering University of California, Berkeley College of Engineering Computer Science Division EECS Fall 1999 John Kubiatowicz Midterm I October 6, 1999 CS152 Computer Architecture and Engineering Your Name: SID

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

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

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

Mark Redekopp, All rights reserved. EE 357 Unit 21. Final Review

Mark Redekopp, All rights reserved. EE 357 Unit 21. Final Review EE 357 Unit 21 Final Review EE 357 in review A LOOK BACK Where EE 357 Fits CS 101,102,105,201 Programming with highlevel languages (HLL s) like C / C++/ Java EE 101,201 SW Digital hardware (registers,

More information