CSE 140L Spring 2010 Bonus Final

Size: px
Start display at page:

Download "CSE 140L Spring 2010 Bonus Final"

Transcription

1 CSE 140L Spring 2010 Bonus Final Logistics for Bonus Final: This final should be done in individually. Use Xilinx tools version What is due: - Report: o Submit a single report in.pdf form via to the TAs at cse140lsp10@gmail.com by the end of your scheduled final exam time. The subject line of the should read "CSE140L Bonus Final Submission YourLastName-FirstName. s sent after the due date will not be accepted. Please include in the report all your Verilog code, diagrams, simulation results as requested in the question. Turn in only one PDF file containing all the solutions with your Full Name and PID on the first page of the report. o Include all the necessary files for us to test your designs in CSE140L Bonus Final Files - YourLastName-FirstName.zipped file that you attach to your . If all files are not present or don t run, the bonus grade will be zero. Bonus Lab Specifications: Design of a more realistic CPU This is an extension to Lab4. Do the following enhancements to the cpu design in lab4: Datapath: Adder, subtractor and comparison operations should be implemented without using + (add operator), - (subtraction operator) and <= (less than or equals or >=) operators. These 3 operations take one cycle each. Multiplication should be implemented using a sequential multiplier (without using * operator). Similarly, division should be implemented using a sequential divider (without using / or % operator). Both multiplication and division should take exactly 4 cycles each. Data RAM: Both read and write operation from/to RAM now take 10 cycles each. IROM: IROM size should be increased from 32 to 128 locations.

2 Instruction decoder: You need to add four extra instructions. 1. A STALL instruction, which stalls the CPU for one cycle (Opcode is decimal 16). 2. A second comparison instruction for doing greater or equals (>=) comparison (Opcode is decimal 17). 3. Load_R2 aaaa. Load memory value from location whose address is aaaa to R2 (Opcode is decimal 18). 4. Store_R4 aaaa. Store R4 to memory location whose address is aaaa (Opcode is decimal 19). Program counter: Redesign the branch instruction as follows: Branch now takes a 4-bit immediate value and pads 3 b000 at the end (as the least significant bits). The program counter now jumps this 7-bit address. (This way you will able to jump to locations in the whole length of IROM). Eg. BR 0111 PC jumps to if the previous COMP operation is true. Assembly code: You need to write the ROM code for min square error calculation and average square error calculation (you must use loops), do the simulation and submit results similar to lab4. Use the same RAM data as given in lab4 for both of these tasks. Report should include: A. Your complete Verilog code for the CPU with all the modules. B. Assembly code, IROM code for min square error calculation (do not unroll the loop). Simulation results for the same. C. Assembly code, IROM code for average square error calculation (do not unroll the loop) and simulation results for the same. D. In addition, TAs will use additional ROM code for testing your design, so you want to make sure your design works correctly for each and every instruction.

3 Lab 4 question is repeated here for your convenience: The CPU consists of a program counter (PC), a datapath unit, an instruction decoder (ID), a register file, an instruction ROM (IROM), a 16 location 4-bit wide memory and an ALU. The instruction ROM can hold 32 instructions. There are five 4-bit registers R1, R2, R3, R4 and R5. The CPU reads the 8-bit instruction from read-only IROM, and instruction decoder decides what kind of operation the datapath should do. Use the starter files provided to implement your CPU design. Make sure you don t edit the IO ports of the modules we provided. The instructions the CPU can perform are provided below. Table 1. Instruction Set Command 4-bit opcode 4 bit data Description Initialize Initialize all registers: R1=R2=R3=R4=R5=0000 And comparison output. Move R aaaa Put aaaa value in register R1 Move R aaaa Put aaaa value in register R2 Move R3_R XXXX Take previous result in R3 and store into register R1 Add Add R1 and R2 and store result in R3. Store overflow in R Add R5 and R2 and store result in R3. Store overflow in R4. Multiply 0101 XXXX Multiply R1 and R2, put the least significant 4-bit result in Compare 0110 R3 and MSB in R Compare the contents of R1 and R2. The flag bit is true iff R1 R Compare the contents of R5 and R2. The flag bit is true iff R5 R2 Branch 0111 aaaa Jump to instruction aaaa if the compare flag bit is true Divide 1000 XXXX Divide R1 and R2, put the quotient in R4 and remainder Subtract 1001 in R Subtract R2 from R1 (R1-R2) and store result in R3. Overflow should be in R Subtract R2 from R5 (R5-R2) and store result in R3. Overflow should be in R4. Move R3_R XXXX Take previous result in R3 and

4 store into register R2 Load R Memory address Load memory value to R1 Move R3_R XXXX Take previous result in R3 and store it in R5 Store R Memory address Store R3 to memory location. Move R aaaa Put aaaa value in register R5 LDR1ID 1111 XXXX Load R1 Indirect. R1 gets memory value whose address is stored in R5 1. Program Counter (PC) As mentioned above, the mini CPU is limited to 32 instructions. This is controlled by the PC. The PC increments by 1 every clock cycle. So the PC goes up to 31. At 31 the PC will stop, thus essentially shuts down the CPU. In case of branch, the PC should be able to accept a number aaaa from the last 4 bits of instruction as input and set the program counter value equal to 0aaaa (0 value for the fifth most significant bit, since instruction opcode is 5bits wide). For example, if the instruction is branch to address 0011, the CPU will first check the comparison bit. If it is high, the program counter will be set to 00011, and continue on from there. The PC interface is given in Table 2. Table 2. PC Interface Clk Input Clock Signal Enable Input Enable Signal Reset Input Reset signal PC increments by 1 when enable is 1 PC becomes zero when clear is 1 Load Input When load is 1, PC load external data via data input [3:0] data Input The data that will be loaded to PC when load is 1 [4:0] q Output PC value

5 2. Instruction ROM (IROM) This module connects to the program counter and outputs the instruction corresponding to the current program cycle. It basically is a table that stores an instruction at a given address. A program is a sequential list of instructions, and these instructions are stored in the instruction ROM in order. Thus, at address 0, the first instruction of a program is stored, and so on. The ROM reads in the current program cycle from the program counter, reads the address that the program cycle points to (so if the current program cycle is 3, then the ROM will read address 3), and will output the corresponding instruction. Remember, in our machine, instructions are 8 bits long, with the first 4 bits being the instruction type, and the last 4 bits being data. Because our program counter stops at 31, you can store up to 31 instructions in your instruction ROM. We will give you a sample IROM. The IROM interface is given in Table 3. Table 3. IROM interface [4:0] addr Input Address signal [7:0] inst Output Instruction signal 3. Instruction Decoder This module decodes the instructions by reading in the first 4 bits of the instruction (which correspond to the instruction type), decoding it, and outputting all the control signals needed to control the rest of the CPU. This instruction decoder can be thought of as the brain of the CPU. For example, the add instruction is The instruction decoder sees this, and based on the 0100, will output the correct control signals to control the other modules, such as the register file, the datapath, etc. In the case of an add instruction, the instruction decoder will tell the register file that R1 and R2 need to be outputted and R3 needs to be written into, and will also tell the datapath that we need to add R1 and R2 together. You need to define the interface of ID by yourself. 4. Register File This module contains the registers that will be used to store the data that we want to operate on. We want five 4-bit registers, R1, R2, R3, R4 and R5. Each register is made up of D flip flops. It will receive as input the 8-bits output from the datapath and the least significant 4 bits of the actual instruction (this corresponds to the 4-bit immediate value of a move instruction, in case the instruction was a move command). It also has many control signals, such as which register to move the values to, or which value to use (either the datapath output for the case of add or the 4-bit instruction value for a move). It outputs all five register values (yes, this means that every clock cycle, all five register values will be output). It also outputs the comparison result that it gets from the datapath. You need to define the interface of register file by yourself.

6 5. Datapath unit It takes in as inputs the two 4-bit values to be operated on, which are R1 and R2 (so this means our register file is directly connected to the ALU). It also has one 2-bit control signal input ("operation select"), which tells the ALU which operation to perform on the two values. It also takes in the 4-bit immediate value of the instructions since few instructions behavior depend on these values (for instance, SUB does R3=R1-R2 if immediate value is 0001 and R3=R5-R2 if the immediate value is 0101). It outputs the corresponding 8-bit result. For example, if R1 is 3, and R2 is 2, and the operation is add, then the output for the ALU will be 5. If the operation is multiply, then the output will be 6. Note that the output is also a 8-bit value. For Division put the quotient in R4 and the remainder in R3. Another output 1-bit comparison result that is used for the compare instruction. Both these values are fed into the register file. This module should be the easiest to implement. There are only several ALU operations you need to support: addition, multiplication, subtraction, division and compare. The datapath interface is given in Table 4. Table 4. Datapath interface [3:0] r1 Input First operand [3:0] r2 Input Second operand Op [7:0] dp_out Input Output Operation signal Datapath should do addition when op is 0. Datapath should do multiplication when op is Datapath 1. result output Comp Output Comparison output 6. Top module In the top module, all instances are provided and you need to hook them up properly. Simple combinational logics are necessary for some signals. The IO specification of the top module is as follows:

7 Table 5. IO specification of the top module cpu_clk Input System clock signal Clear Input Clear signal [4:0] inst_addr Output The address of the instruction being executed. Instruction Output The instruction being executed [3:0] r1 Output The value of R1 [3:0] r2 Output The value of R2 [3:0] r3 Output The value of R3 [3:0] r4 Output The value of R4 [3:0] r5 Output The value of R5 [7:0] dp_result Output The value of the 8-bit datapath output dp_comp_out Output The comparison result of datapath 7. Data RAM: This module serves as an on-chip RAM for data. It has 16 locations and each location is 4- bits wide. Its interface is given in the starter file. Design the RAM such that both load and store take one cycle each. The first 10 (from 0 to 9) memory locations are initialized in the DRAM interface given to you with values which you can use to compute both Minimum and Average Mean Square Errors. Table 6. RAM interface ram_clk input Ram clk to be synced with cpu clk. ram_en Input Ram enable signal ram_we Input 1 for writing to ram and 0 for reading from ram [3:0]data_addr Input Address port [3:0]ram_data_in Input Data ports for writing data to RAM [3:0]ram_data_out output Data port for reading data from RAM

8 CPU Task 1: Implement all modules needed to be able to run any set of assembly instructions using your CPU design. Provide results using sample code we provided for you below. The following assembly code loads ten data values from RAM memory one at a time. It computes the minimum of the square errors relative to a particular value (use 5 for this value). Output = minimum {( X i value) 2 }. Where i=number of values (in this case 0..9) Make sure you initialize the 0-10 RAM locations as given in the starter file. Table 7. Sample code IROM Sample Code (Commented, Optimized & updated): Addr Inst Description 0 INIT Initialize all registers 1 MOVE_R2 #15 Initialize R2 with decimal 15 2 MOVE_R5 #10 Initializes a count value. 3 LD_R1 [12] R1 gets the old min square value from [12] {except for the very first iteration} 4 COMP_0001 Compares stored value with R2 5 BR 9 If R1 less than R2, don t over write [12] 6 MOVE_R1 #0 Upto 8: Else copy R2 to [12] 7 ADD_ STORE_R3 [12] [12] gets the new minimum square value 9 LDR1ID Load R1 with mem[r5] 10 MOVE_R2 #1 Upto 12: Decrementing the count value 11 SUB_ MOVE_R3_R5 Count gets the decremented value. 13 COMP_ BR 0 Goto INIT if count exhausted. 15 MOVE_R2 #5 Till 19: Computing square error for one sample 16 SUB_ MOVE_R3_R1 18 MOVE_R3_R2 19 MUL Square error computed 20 MOVE_R1 #0 R1 gets #0 21 MOVE_R3_R2 R2 gets the square error value. 22 COMP_0001 Compare R1 and R2. 23 BR 3 Branch is always taken. Make sure your RAM location 12 has an initial value of (decimal) 15 before you execute the above program.

9 When you do the demo, be ready to show results of run of this sample code. In addition, TA may provide additional assembly code for testing your design, so you want to make sure your design works correctly for all instructions. CPU Task 2: Find the average square error by changing the code provided above. The initial statement in the RAM module of the starter file has N=10 values stored in locations 0 to 9. You need to compute the average of the square errors of these values with respect to the given value=5 using assembly; the ASE is defined as follows: N { (X i value) 2 }/ N = Average Squared Error i=0 ****Good Luck******

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

Digital System Design Using Verilog. - Processing Unit Design

Digital System Design Using Verilog. - Processing Unit Design Digital System Design Using Verilog - Processing Unit Design 1.1 CPU BASICS A typical CPU has three major components: (1) Register set, (2) Arithmetic logic unit (ALU), and (3) Control unit (CU) The register

More information

Final Exam Review. b) Using only algebra, prove or disprove the following:

Final Exam Review. b) Using only algebra, prove or disprove the following: EE 254 Final Exam Review 1. The final exam is open book and open notes. It will be made up of problems similar to those on the previous 3 hour exams. For review, be sure that you can work all of the problems

More information

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit DataPath Design An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit Add & subtract instructions for fixed binary numbers are found in the

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

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

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

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

Figure 1: System Block Diagram ADDR DATA EXT_COND RESET

Figure 1: System Block Diagram ADDR DATA EXT_COND RESET EE183 Lab 3 EE183 LAB 3 12-bit RISC Microprocessor Purpose The third project consists of implementing a pipelined processor. This project illustrates many of the datapath and control design issues you

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #18 Introduction to CPU Design 2007-7-25 Scott Beamer, Instructor CS61C L18 Introduction to CPU Design (1) What about overflow? Consider

More information

Microcontroller Systems

Microcontroller Systems µcontroller systems 1 / 43 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/2co Michaelmas 2014 µcontroller

More information

Module 5 - CPU Design

Module 5 - CPU Design Module 5 - CPU Design Lecture 1 - Introduction to CPU The operation or task that must perform by CPU is: Fetch Instruction: The CPU reads an instruction from memory. Interpret Instruction: The instruction

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

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

CS3350B Computer Architecture Winter 2015

CS3350B Computer Architecture Winter 2015 CS3350B Computer Architecture Winter 2015 Lecture 5.5: Single-Cycle CPU Datapath Design Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and Design, Patterson

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

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath The MIPS Datapath 1 The Critical Path and Circuit Timing The critical path is the slowest path through the circuit For a synchronous circuit, the clock cycle must be longer than the critical path otherwise

More information

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit Single cycle MIPS data path without Forwarding, Control, or Hazard Unit Figure 1: an Overview of a MIPS datapath without Control and Forwarding (Patterson & Hennessy, 2014, p. 287) A MIPS 1 single cycle

More information

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated. 8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN 0 1 Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box 0 1 START Register operation or output

More information

The assignments will help you learn Verilog as a Hardware Description Language and how hardware circuits can be developed using Verilog and FPGA.

The assignments will help you learn Verilog as a Hardware Description Language and how hardware circuits can be developed using Verilog and FPGA. General Instructions The assignments will help you learn Verilog as a Hardware Description Language and how hardware circuits can be developed using Verilog and FPGA. You have to come to the lab during

More information

CSE140 L. Instructor: Thomas Y. P. Lee. March 1, Agenda. Computer System Design. Computer Architecture. Instruction Memory design.

CSE140 L. Instructor: Thomas Y. P. Lee. March 1, Agenda. Computer System Design. Computer Architecture. Instruction Memory design. CSE4 L Instructor: Thomas Y. P. Lee March, 26 Agenda Computer System Design Computer Architecture Instruction Memory design Datapath Registers Program Counter Instruction Decoder Lab4 Simple Computer System

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

Blog -

Blog - . Instruction Codes Every different processor type has its own design (different registers, buses, microoperations, machine instructions, etc) Modern processor is a very complex device It contains Many

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

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

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

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

Microcomputer Architecture and Programming

Microcomputer Architecture and Programming IUST-EE (Chapter 1) Microcomputer Architecture and Programming 1 Outline Basic Blocks of Microcomputer Typical Microcomputer Architecture The Single-Chip Microprocessor Microprocessor vs. Microcontroller

More information

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated. 8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box START Register operation or output PC 0 (d)

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

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

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

Preventing Stalls: 1

Preventing Stalls: 1 Preventing Stalls: 1 2 PipeLine Pipeline efficiency Pipeline CPI = Ideal pipeline CPI + Structural Stalls + Data Hazard Stalls + Control Stalls Ideal pipeline CPI: best possible (1 as n ) Structural hazards:

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST III Date : 21/11/2017 Max Marks : 40 Subject & Code : Computer Organization (15CS34) Semester : III (A & B) Name of the faculty: Mrs. Sharmila Banu Time : 11.30 am 1.00 pm Answer

More information

Little Man Computer (LMC)

Little Man Computer (LMC) Little Man Computer (LMC) A-level Computing Independent Study Project Part Two The Little Man Computer (LMC) is a simulator which models the basic features of a modern computer. It features a central processing

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

ECE 2300 Digital Logic & Computer Organization. More Single Cycle Microprocessor

ECE 2300 Digital Logic & Computer Organization. More Single Cycle Microprocessor ECE 23 Digital Logic & Computer Organization Spring 28 More Single Cycle Microprocessor Lecture 6: HW6 due tomorrow Announcements Prelim 2: Tues April 7, 7:3pm, Phillips Hall Coverage: Lectures 8~6 Inform

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

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

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

Digital Design with FPGAs. By Neeraj Kulkarni

Digital Design with FPGAs. By Neeraj Kulkarni Digital Design with FPGAs By Neeraj Kulkarni Some Basic Electronics Basic Elements: Gates: And, Or, Nor, Nand, Xor.. Memory elements: Flip Flops, Registers.. Techniques to design a circuit using basic

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

Week 6: Processor Components

Week 6: Processor Components Week 6: Processor Components Microprocessors So far, we ve been about making devices, such such as adders, counters and registers. The ultimate goal is to make a microprocessor, which is a digital device

More information

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

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

More information

COMP 303 Computer Architecture Lecture 6

COMP 303 Computer Architecture Lecture 6 COMP 303 Computer Architecture Lecture 6 MULTIPLY (unsigned) Paper and pencil example (unsigned): Multiplicand 1000 = 8 Multiplier x 1001 = 9 1000 0000 0000 1000 Product 01001000 = 72 n bits x n bits =

More information

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin Madison Chapter 5 The LC-3 Instruction Set Architecture

More information

Laboratory 05. Single-Cycle MIPS CPU Design smaller: 16-bits version One clock cycle per instruction

Laboratory 05. Single-Cycle MIPS CPU Design smaller: 16-bits version One clock cycle per instruction Laboratory 05 Single-Cycle MIPS CPU Design smaller: 16-bits version One clock cycle per instruction 1. Objectives Study, design, implement and test Instruction Fetch Unit for the 16-bit Single-Cycle MIPS

More information

Timing for Ripple Carry Adder

Timing for Ripple Carry Adder Timing for Ripple Carry Adder 1 2 3 Look Ahead Method 5 6 7 8 9 Look-Ahead, bits wide 10 11 Multiplication Simple Gradeschool Algorithm for 32 Bits (6 Bit Result) Multiplier Multiplicand AND gates 32

More information

Cpr E 281 FINAL PROJECT ELECTRICAL AND COMPUTER ENGINEERING IOWA STATE UNIVERSITY. FINAL Project. Objectives. Project Selection

Cpr E 281 FINAL PROJECT ELECTRICAL AND COMPUTER ENGINEERING IOWA STATE UNIVERSITY. FINAL Project. Objectives. Project Selection Objectives The main objective of the final project is to teach you how to put together all of the class material that you have learned so far in order to program the Altera DE2 board to carry out an independent

More information

Problem 4 The order, from easiest to hardest, is Bit Equal, Split Register, Replace Under Mask.

Problem 4 The order, from easiest to hardest, is Bit Equal, Split Register, Replace Under Mask. HW3 Solutions (CS552 Spring 2013) Grade distribution: (Total: 100) - Verilog submission of problems 1), 2) and 3) carry 15 points each(total: 45 points) - Written part of problem 1), 2) and 3) carry 5

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

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture Introduction to Computer Engineering CS/ECE 252, Spring 200 Prof. David A. Wood Computer Sciences Department University of Wisconsin Madison Chapter 5 The LC-3 Adapted from Prof. Mark Hill s slides Instruction

More information

CS150 Project Final Report

CS150 Project Final Report CS150 Project Final Report Max Nuyens and Casey Duckering cs150 bp and cs150 bo Team 1 12/12/14 Project Functional Description and Design Requirements: The objective of our project was to implement a functional

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

TABLE 8-1. Control Signals for Binary Multiplier. Load. MUL0 Q 0 CAQ sr CAQ. Shift_dec. C out. Load LOADQ. CAQ sr CAQ. Shift_dec P P 1.

TABLE 8-1. Control Signals for Binary Multiplier. Load. MUL0 Q 0 CAQ sr CAQ. Shift_dec. C out. Load LOADQ. CAQ sr CAQ. Shift_dec P P 1. T-192 Control Signals for Binary Multiplier TABLE 8-1 Control Signals for Binary Multiplier Block Diagram Module Microoperation Control Signal Name Control Expression Register A: A 0 Initialize IDLE G

More information

CPU. Fall 2003 CSE 207 Digital Design Project #4 R0 R1 R2 R3 R4 R5 R6 R7 PC STATUS IR. Control Logic RAM MAR MDR. Internal Processor Bus

CPU. Fall 2003 CSE 207 Digital Design Project #4 R0 R1 R2 R3 R4 R5 R6 R7 PC STATUS IR. Control Logic RAM MAR MDR. Internal Processor Bus http://www.engr.uconn.edu/~barry/cse207/fa03/project4.pdf Page 1 of 16 Fall 2003 CSE 207 Digital Design Project #4 Background Microprocessors are increasingly common in every day devices. Desktop computers

More information

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip. EXPERIMENT NO.1 AIM: Study of 8051 Microcontroller TOOLS: 8051 kit THEORY: Salient Features of 8051 A Microcontroller is a complete computer system built on a single chip. It contains all components like

More information

Single Cycle Datapath

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

More information

1. Choose a module that you wish to implement. The modules are described in Section 2.4.

1. Choose a module that you wish to implement. The modules are described in Section 2.4. Chapter 2 Lab 2 - Datapath 2.1 Overview During lab 2 you will complete the RTL code of the ALU and MAC datapaths of the DSP core and write a set of small test programs to verify your implementation. Most

More information

CS 151 Midterm. Instructions: Student ID. (Last Name) (First Name) Signature

CS 151 Midterm. Instructions: Student ID. (Last Name) (First Name) Signature CS 151 Midterm Name Student ID Signature :, (Last Name) (First Name) : : Instructions: 1. Please verify that your paper contains 11 pages including this cover. 2. Write down your Student-Id on the top

More information

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008 CSE 140L Final Exam Prof. Tajana Simunic Rosing Spring 2008 Do not start the exam until you are told to. Turn off any cell phones or pagers. Write your name and PID at the top of every page. Do not separate

More information

FPGA IMPLEMENTATION OF A PROCESSOR THROUGH VERILOG

FPGA IMPLEMENTATION OF A PROCESSOR THROUGH VERILOG FPGA IMPLEMENTATION OF A PROCESSOR THROUGH VERILOG Overview and tutorial by Sagnik Nath Objective 1 About the single cycle ARM microarchitecture 1 Design Process 2 Creating Flow for Instruction set 3 LDR

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

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice Instructions Page 1 of 7 Use pencil, if you have one. For multiple choice questions, circle the letter of the one best choice unless the question specifically says to select all correct choices. There

More information

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR UNIT 1 REFERENCE 1 PROGRAMMING THE 8085 DEVELOPMENT OF PROGRAM A program is a sequence of instructions written to tell a computer to perform a specific function. The instructions are selected from the

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

Computer Architecture 2/26/01 Lecture #

Computer Architecture 2/26/01 Lecture # Computer Architecture 2/26/01 Lecture #9 16.070 On a previous lecture, we discussed the software development process and in particular, the development of a software architecture Recall the output of the

More information

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs V8-uRISC 8-bit RISC Microprocessor February 8, 1998 Product Specification VAutomation, Inc. 20 Trafalgar Square Nashua, NH 03063 Phone: +1 603-882-2282 Fax: +1 603-882-1587 E-mail: sales@vautomation.com

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

IA Digital Electronics - Supervision I

IA Digital Electronics - Supervision I IA Digital Electronics - Supervision I Nandor Licker Due noon two days before the supervision 1 Overview The goal of this exercise is to design an 8-digit calculator capable of adding

More information

Introduction to Computers - Chapter 4

Introduction to Computers - Chapter 4 Introduction to Computers - Chapter 4 Since the invention of the transistor and the first digital computer of the 1940s, computers have been increasing in complexity and performance; however, their overall

More information

Programmable Control Logic

Programmable Control Logic Programmable Control Logic Microsequencers Example: building the micro8 Hardware/Software tradeoff Lab #5 due Thursday, project abstract next Monday 1 Digital Systems = FSMs + Datapath FSM control Datapath:

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

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

CAD for VLSI 2 Pro ject - Superscalar Processor Implementation

CAD for VLSI 2 Pro ject - Superscalar Processor Implementation CAD for VLSI 2 Pro ject - Superscalar Processor Implementation 1 Superscalar Processor Ob jective: The main objective is to implement a superscalar pipelined processor using Verilog HDL. This project may

More information

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2 Chapter 5 The LC-3 ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2 Instruction Set Architecture ISA = All of the programmer-visible components

More information

CS Computer Architecture Spring Week 10: Chapter

CS Computer Architecture Spring Week 10: Chapter CS 35101 Computer Architecture Spring 2008 Week 10: Chapter 5.1-5.3 Materials adapated from Mary Jane Irwin (www.cse.psu.edu/~mji) and Kevin Schaffer [adapted from D. Patterson slides] CS 35101 Ch 5.1

More information

Instruction Set Architecture

Instruction Set Architecture Chapter 5 The LC-3 Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization address space -- how may locations can be addressed? addressibility

More information

Implementing the Control. Simple Questions

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

More information

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

CIS 371 Computer Organization and Design

CIS 371 Computer Organization and Design CIS 371 Computer Organization and Design Lab Hints Based on slides by Prof. Amir Roth & Prof. Milo Martin CIS 371: Comp. Org. Prof. Milo Martin Lab Hints 1 Hints & Tips for ALU Lab // Instruction decoder!

More information

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015 Advanced Parallel Architecture Lesson 3 Annalisa Massini - Von Neumann Architecture 2 Two lessons Summary of the traditional computer architecture Von Neumann architecture http://williamstallings.com/coa/coa7e.html

More information

Where Does The Cpu Store The Address Of The

Where Does The Cpu Store The Address Of The Where Does The Cpu Store The Address Of The Next Instruction To Be Fetched The three most important buses are the address, the data, and the control buses. The CPU always knows where to find the next instruction

More information

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Introduction to Computer Engineering CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison Chapter 5 The LC-3 Instruction Set Architecture ISA = All of the

More information

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital hardware modules that accomplish a specific information-processing task. Digital systems vary in

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

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number:

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number: Login Preceptor Precept Number: Computer Science 126 Second Midterm Exam 11/22/1999 7pm - 9pm This exam has 10 questions. The weight of each question is printed in the table below and next to each question.

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

EEL 5722C Field-Programmable Gate Array Design

EEL 5722C Field-Programmable Gate Array Design EEL 5722C Field-Programmable Gate Array Design Lecture 12: Pipelined Processor Design and Implementation Prof. Mingjie Lin Patt and Patel: Intro. to Computing System * Stanford EE271 notes 1 Instruction

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 24 Introduction to CPU Design 2007-03-14 CS61C L24 Introduction to CPU Design (1) Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia

More information

Basic Von Neumann Designs

Basic Von Neumann Designs COMP 273 Assignment #2 Part One Due: Monday October 12, 2009 at 23:55 on Web CT Mini-Project Due: Monday November 9, 2009 at 23:55 on Web CT Basic Von Neumann Designs This assignment is divided into two

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

CPU Structure and Function

CPU Structure and Function Computer Architecture Computer Architecture Prof. Dr. Nizamettin AYDIN naydin@yildiz.edu.tr nizamettinaydin@gmail.com http://www.yildiz.edu.tr/~naydin CPU Structure and Function 1 2 CPU Structure Registers

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

Computing Layers. Chapter 5 The LC-3

Computing Layers. Chapter 5 The LC-3 Computing Layers Problems Chapter 5 The LC-3 Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Algorithms Language Instruction

More information

CS/COE 0447 Example Problems for Exam 2 Spring 2011

CS/COE 0447 Example Problems for Exam 2 Spring 2011 CS/COE 0447 Example Problems for Exam 2 Spring 2011 1) Show the steps to multiply the 4-bit numbers 3 and 5 with the fast shift-add multipler. Use the table below. List the multiplicand (M) and product

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

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008 CSE 140L Final Exam Prof. Tajana Simunic Rosing Spring 2008 NAME: ID#: Do not start the exam until you are told to. Turn off any cell phones or pagers. Write your name and PID at the top of every page.

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