ENCM 501 Winter 2019 Assignment 6 for the Week of March 11

Size: px
Start display at page:

Download "ENCM 501 Winter 2019 Assignment 6 for the Week of March 11"

Transcription

1 page of 8 ENCM 5 Winter 29 Assignment 6 for the Week of March Steve Norman Department of Electrical & Computer Engineering University of Calgary February 29 Assignment instructions and other documents for ENCM 5 can be found at Administrative details Group work is permitted See the Assignment 3 instructions for for information about working in groups Due Dates The Due Date for this assignment is 3:3pm, Friday, March 5 The Late Due Date is 3:3pm, Monday, March 8 The penalty for handing in an assignment after the Due Date but before the Late Due Date is 3 marks In other words, X/Y becomes (X 3)/Y if the assignment is late There will be no credit for assignments turned in after the Late Due Date; they will be returned unmarked Marking scheme A B total 5 marks 2 marks 7 marks How to package and hand in your assignments Please see the instructions in Assignment And, if you are submitting a group assignment, please make sure that all group members names are clear and complete on the cover page Exercise A: x86-64 page tables Read This First As stated in the lecture Tuesday, February 26, 48-bit virtual addresses in x86-64 systems are used to search a four-level tree-like page table, with virtual page numbers split into four 9-bit chunks:

2 ENCM 5 Winter 29 Assignment 6 page 2 of 8 36-bit virtual page number VPN VPN 2 VPN 3 VPN 4 page offset Consider a tiny Linux-ish process that uses only three pages of virtual memory: VPN x4 x4 x7fffffffe Use instructions and read-only data readable/writeable static data stack These VPNs split as follows for page table access: VPN VPN VPN2 VPN3 VPN4 x4 2 x4 2 x7fffffffe Those VPN splits result in the page table structure shown in Figure It s not terribly space-efficient seven pages are needed for a page table supporting only three pages used by the process but it s much, much better than a simple array with indexes to x7ffffffff! What to Do Determine the memory footprint memory used for virtual pages plus memory used for a page table for a x86-64 Linux process with the fake but realistic use of virtual memory listed in Figure 2 To keep things relatively simple, count all of the pages related to shared libraries, despite the fact that that part of the footprint is probably shared with other processes Hints: Adding up the number of virtual pages is simple arithmetic You can use the program vpn-splitc to quickly split VPNs into 9-bit chunks To count directories, start by finding out how many page upper directories are needed For each page upper directory, find out how many page middle directories are needed Then for each page middle directory, find out how many last-level page tables are needed What to Hand In Hand in your calculations and results Describe your calculations with enough clarity and detail that a reader could understand exactly what your method was Remark The fake data for this exercise was generated by looking at the virtual memory layout of a real 64-bit Linux process, then simplifying it to make solving the exercise quite a bit less tedious See Figure 3 for more information, if you re curious I m not sure if it s possible to create a process this tiny on a real 64-bit Linux system

3 ENCM 5 Winter 29 Assignment 6 page 3 of 8 Figure : x86-64 page table organization for a process with only three pages The character represents a null pointer in the directories, and indicates no such page in the last-level page tables Each cell in a directory and each PTE is 64 bits wide, so the total memory footprint of the page table is 7 52 cells 8 bytes/cell = 7 4 KB page global directory page upper directories 5 5 page middle directories last-level page tables useful PTE useful PTE useful PTE Figure 2: Fake but fairly realistic information about how an x86-64 Linux process might use virtual memory VPN range x4 to x43 x6 to x62 x63 to x9d3 x34e8 to x34ef52 x7fff35c5 to x7fff35c7 Use instructions and read-only data readable/writeable static data heap shared-library instructions and data stack

4 ENCM 5 Winter 29 Assignment 6 page 4 of 8 Figure 3: Demonstration of finding the virtual memory layout of a Linux process I suspended a process, used ps to find its process ID, then used one of the facilities in the Linux /proc system This is real output, edited very slightly so that it wouldn t be too wide to fit legibly on letter-size paper --- remote:~/5/assign5 --> /aout sum of junk is ^Z []+ Stopped /aout --- remote:~/5/assign5 --> ps PID TTY TIME CMD 255 pts/ :: bash 2587 pts/ :: aout 2588 pts/ :: ps --- remote:~/5/assign5 --> cat /proc/2587/maps 4-4 r-xp :f /nfs/engfs/[]/aout 6-6 rw-p :f /nfs/engfs/[]/aout 6-4a2 rw-p : [heap] 34e8-34e8c r-xp 8: /lib64/ld-25so 34eac-34ead r--p c 8: /lib64/ld-25so 34ead-34eae rw-p d 8: /lib64/ld-25so 34ec-34ed4f r-xp 8: /lib64/libc-25so 34ed4f-34ef4e ---p 4f 8: /lib64/libc-25so 34ef4e-34ef52 r--p 4e 8: /lib64/libc-25so 34ef52-34ef53 rw-p 52 8: /lib64/libc-25so 34ef53-34ef58 rw-p : 34f8-34f86 r-xp 8: /lib64/libpthread-25so 34f86-34fa6 ---p 6 8: /lib64/libpthread-25so 34fa6-34fa7 r--p 6 8: /lib64/libpthread-25so 34fa7-34fa8 rw-p 7 8: /lib64/libpthread-25so 34fa8-34fac rw-p : r-xp 8: /lib64/librt-25so p 7 8: /lib64/librt-25so r--p 7 8: /lib64/librt-25so rw-p 8 8: /lib64/librt-25so 7f446666d-7f446666f rw-p : 7f446668a-7f446668d rw-p : 7fff94c3d-7fff94c5e rw-p : [stack] 7fff94da7-7fff94da8 r-xp : [vdso] ffffffffff6-ffffffffff6 r-xp : [vsyscall]

5 ENCM 5 Winter 29 Assignment 6 page 5 of 8 Exercise B: Tracing instructions through a 5-stage RISC-V pipeline Read This First To get a feel for how pipelining really works, nothing beats studying a pipelined circuit and tracing the flow of chunks of instructions and data through the circuit This exercise concerns study of how instructions are processed by a computer that aims to support a subset of RV32I, which is the 32-bit version of the core integer ISA of RISC-V In RV32I all instruction and data memory addresses are 32 bits wide, and GPRs are 32 bits wide as well The instructions in the subset are: five R-type instructions: ADD, SUB, SLT, OR, AND add immediate: ADDI load of a 32-bit word: LW store of a 32-bit word: SW branch if two GPRs are equal: BEQ The machine code formats of those instructions are shown in Figure 4 Figure 5 shows a schematic for a microarchitecture for the RV32I subset, with simple, idealized memory units and five pipeline stages The same figure shows a very similar microarchitecture for a subset of the MIPS ISA The microarchitecture for the MIPS subset has been an important subject of study in ENCM 369 every for the last several years Here are a few key points about the RV32 version of the circuit: Branch target address calculation in RISC-V is relative to the address of the branch instruction In MIPS, it s relative to the successor of the branch instruction That explains why the instruction address inputs to the registers between the F and D stages aren t exactly the same in the two schematics Generation of immediate mode operand values is very simple in the MIPS subset just sign-extend bits 5 of the instruction It s more complicated for the RISC-V subset, as you can see from the machine code formats in Figure 4 In the RV32 schematic, all the work of generating immediate mode operand values is lumped into the unit labeled immed gen In the RV32 schematic, comparison of GPRs in BEQ instructions is done with the unit labeled =? That makes the ALU available to do the addition that computes the branch target address Both the RV32 and the MIPS schematics are partly correct, but partly incorrect they don t manage RAW data hazards correctly, and they don t handle BEQ instructions correctly For BEQ the target addresses are computed correctly, but are written into the PC a few cycles too late What to Do Study the code fragment listed in Figure 6 You are going to trace execution of this code in the RV32I subset computer of Figure 5 starting with the lw instruction Assume the following initial values for registers and memory: x: x x3: x x: x4 x4: x4444 x2: x2222 memory at x: x2a

6 ENCM 5 Winter 29 Assignment 6 page 6 of 8 Figure 4: Machine code for the RV32I subset used in Exercise B These formats correspond exactly to RISC-V specifications rd specifies a destination GPR, if there is one rs specifies the first source GPR, and rs2 specifies the second source GPR, if there is one In R-type instructions the funct7 and funct3 fields both play roles in deciding what operation is to be performed by whatever elements compute the result The immediate value for ADDI and the offsets for LW, SW and BEQ are all signed integers represented in two s complement The complicated-looking format for the offset in BEQ supports the design of small, efficient circuits for generation of values to add to PC values in computation of branch target addresses R-type funct7 rs2 rs funct3 rd ADDI 3 2-bit immediate value rs rd LW 3 2-bit offset rs rd SW 3 offset[:5] rs rs offset[4:] BEQ offset[2,:5] rs2 rs offset[4:,] Assume also that ALUControlE = specifies addition and ALUControlE = specifies set-less-than Answer all of the following questions, giving brief explanations for your answers Use hexadecimal for 32-numbers and binary for 5-bit numbers and single bits When lw is in the F stage, what are the values of (a) PCF and (b) the output of I-Mem? 2 When lw is in the D stage and the first addi is in the F stage, what are the values of (a) PCF, (b) the output of I-Mem, (c) InstrD, and (d) the RD and RD2 outputs of the R-file? 3 When lw is in the E stage and the first addi is in the D stage, what are the values of (a) the control signals RegWriteE through ALUSrcE, (b) the A and B inputs to the ALU, (c) RdE, and (d) the RD and RD2 outputs of the R-file? 4 When lw is in the M stage and the first addi is in the E stage, what are the values of (a) the control signals RegWriteE through ALUSrcE, (b) the A and B inputs to the ALU, (c) RdE, (d) RdM and (e) the RD output of D-Mem? 5 When slt is in the E stage, what are the values of (a) the control signals Reg- WriteE through ALUSrcE, (b) the A and B inputs to the ALU, and (c) RdE? 6 When beq is in the E stage, what are the values of (a) the control signals RegWriteE through ALUSrcE, (b) the A and B inputs to the ALU, and (c) the inputs to the =? unit? 7 The circuit computes branch target addresses correctly, but, in the case of a taken branch, updates the PC a few cycles too late Exactly how many of the four addi instructions at the end of the code listing will be fetched before the lw instruction is fetched a second time?

7 ENCM 5 Winter 29 Assignment 6 page 7 of 8 Figure 5: Five-stage pipelines for an RV32I subset (top) and a MIPS32 subset (bottom) The MIPS32 schematic is Figure 747 from Harris D M and Harris S L, Digital Design and Computer Architecture, 2nd ed, c 23, Elsevier, Inc Both circuits are correct in many important ways but both fail to handle data hazards and control hazards correctly 3:25 4:2 6: Control RegWriteE MemtoRegE MemWriteE BranchE ALUControlE ALUSrcBE ALUSrcAE 3 RegWriteM MemtoRegM MemWriteM BranchM RegWriteW MemtoRegW PCF A RD I-Mem PCD InstrD =? 9:5 WE3 A RD WE A 24:2 ALUOutM A2 RD2 ALU A RD B A3 D-Mem WD3 R-File WD ALUOutW ReadDataW 4 + :7 3:2 : immed gen RdE ImmedE RdM RdW ResultW Control Unit 3:26 Op 5: Funct RegWriteD MemtoRegD MemWriteD BranchD ALUControlD ALUSrcD RegWriteE RegWriteM RegWriteW MemtoRegE MemtoRegM MemtoRegW MemWriteE BranchE ALUControlE 2: ALUSrcE MemWriteM BranchM PCSrcM PC' PCF A RD Instruction Memory InstrD 25:2 2:6 2:6 5: A A2 A3 WD3 RegDstD WE3 RD Register File RD2 RegDstE RtE RdE SrcAE SrcBE WriteDataE ALU WriteRegE 4: ZeroM WE ALUOutM A RD Data Memory WriteDataM WD WriteRegM 4: ALUOutW ReadDataW WriteRegW 4: PCPlus4F 4 + 5: PCPlus4D Sign Extend SignImmE PCPlus4E <<2 + PCBranchM ResultW

8 ENCM 5 Winter 29 Assignment 6 page 8 of 8 Figure 6: Listing of a code fragment for Exercise B Addresses and machine code are hexadecimal numbers address machine code assembly language L3: lw x2,(x) addi x,x, nop 45c c686b3 add x3,x3,x2 46 a5a733 slt x4,x,x nop nop 46c fe72e3 beq x4,x,l3 47 ce3 addi x28,x, de93 addi x29,x, ef3 addi x3,x,3 47c ff93 addi x3,x,3 What to Hand In Hand in nicely organized answers to questions 7 in What to Do

ENCM 501 Winter 2017 Assignment 6 for the Week of February 27

ENCM 501 Winter 2017 Assignment 6 for the Week of February 27 page of 8 ENCM 5 Winter 27 Assignment 6 for the Week of February 27 Steve Norman Department of Electrical & Computer Engineering University of Calgary February 27 Assignment instructions and other documents

More information

ENCM 369 Winter 2018 Lab 9 for the Week of March 19

ENCM 369 Winter 2018 Lab 9 for the Week of March 19 page 1 of 9 ENCM 369 Winter 2018 Lab 9 for the Week of March 19 Steve Norman Department of Electrical & Computer Engineering University of Calgary March 2018 Lab instructions and other documents for ENCM

More information

Slide Set 7 for Lecture Section 01

Slide Set 7 for Lecture Section 01 Slide Set 7 for Lecture Section 01 for ENCM 369 Winter 2017 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary February 2017 ENCM 369 Winter

More information

CHW 362 : Computer Architecture & Organization

CHW 362 : Computer Architecture & Organization CHW 362 : Computer Architecture & Organization Instructors: Dr Ahmed Shalaby Dr Mona Ali http://bu.edu.eg/staff/ahmedshalaby4# http://www.bu.edu.eg/staff/mona.abdelbaset Review: Instruction Formats R-Type

More information

Topics. Lecture 12: Pipelining. Introduction to pipelining. Pipelined datapath. Hazards in pipeline. Performance. Design issues.

Topics. Lecture 12: Pipelining. Introduction to pipelining. Pipelined datapath. Hazards in pipeline. Performance. Design issues. Lecture 2: Pipelining Topics Introduction to pipelining Performance Pipelined datapath Design issues Hazards in pipeline Types Solutions Pipelining is Natural! Laundry Example Use case scenario Ann, Brian,

More information

Computer Architectures

Computer Architectures Computer Architectures Pipelined instruction execution Hazards, stages balancing, super-scalar systems Pavel Píša, Michal Štepanovský, Miroslav Šnorek Main source of inspiration: Patterson Czech Technical

More information

CENG 5133 Computer Architecture Design Spring Sample Exam 2

CENG 5133 Computer Architecture Design Spring Sample Exam 2 CENG 533 Computer Architecture Design Spring 24 Sample Exam 2. (6 pt) Determine the propagation delay and contamination delay of the following circuit using the gate delays given below. Gate t pd (ps)

More information

Design of Digital Circuits Lecture 17: Pipelining Issues. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of Digital Circuits Lecture 17: Pipelining Issues. Prof. Onur Mutlu ETH Zurich Spring April 2017 Design of Digital Circuits Lecture 17: Pipelining Issues Prof. Onur Mutlu ETH Zurich Spring 2017 28 April 2017 Agenda for Today & Next Few Lectures! Single-cycle Microarchitectures! Multi-cycle and Microprogrammed

More information

Design of Digital Circuits Lecture 16: Dependence Handling. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of Digital Circuits Lecture 16: Dependence Handling. Prof. Onur Mutlu ETH Zurich Spring April 2017 Design of Digital Circuits Lecture 16: Dependence Handling Prof. Onur Mutlu ETH Zurich Spring 2017 27 April 2017 Agenda for Today & Next Few Lectures! Single-cycle Microarchitectures! Multi-cycle and Microprogrammed

More information

Design of Digital Circuits Lecture 15: Pipelining. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of Digital Circuits Lecture 15: Pipelining. Prof. Onur Mutlu ETH Zurich Spring April 2017 Design of Digital Circuits Lecture 5: Pipelining Prof. Onur Mutlu ETH Zurich Spring 27 3 April 27 Agenda for Today & Next Few Lectures! Single-cycle Microarchitectures! Multi-cycle and Microprogrammed

More information

Columbia University CSEE 3827 Fundamentals of Computer Systems Final Exam

Columbia University CSEE 3827 Fundamentals of Computer Systems Final Exam Columbia University CSEE 3827 Fundamentals of Computer Systems Final Exam Prof. Martha A. Kim December 7, 23 Name: First Last (Family) UNI (e.g., mak29) You are allowed 3 hours. You may consult your own

More information

#1 #2 with corrections Monday, March 12 7:00pm to 8:30pm. Please do not write your U of C ID number on this cover page.

#1 #2 with corrections Monday, March 12 7:00pm to 8:30pm. Please do not write your U of C ID number on this cover page. page 1 of 6 University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Lecture Instructors: Steve Norman and Norm Bartley Winter 2018 MIDTERM TEST #1 #2 with

More information

Design of A Six-stage Pipelined MIPS Processor Based on FPGA

Design of A Six-stage Pipelined MIPS Processor Based on FPGA Design of A Six-stage Pipelined MIPS Processor Based on FPGA Qiao-Zhi Sun, De-Chun Kong, Cheng-Long Zhao, and Hui-Bin Shi Department of Computer Science and Technology, Nanjing University of Aeronautics

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

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

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

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

ENCM 369 Winter 2019 Lab 6 for the Week of February 25

ENCM 369 Winter 2019 Lab 6 for the Week of February 25 page of ENCM 369 Winter 29 Lab 6 for the Week of February 25 Steve Norman Department of Electrical & Computer Engineering University of Calgary February 29 Lab instructions and other documents for ENCM

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

Slide Set 7. for ENCM 501 in Winter Term, Steve Norman, PhD, PEng

Slide Set 7. for ENCM 501 in Winter Term, Steve Norman, PhD, PEng Slide Set 7 for ENCM 501 in Winter Term, 2017 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2017 ENCM 501 W17 Lectures: Slide

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

Winter 2006 FINAL EXAMINATION Auxiliary Gymnasium Tuesday, April 18 7:00pm to 10:00pm

Winter 2006 FINAL EXAMINATION Auxiliary Gymnasium Tuesday, April 18 7:00pm to 10:00pm University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Lecture Instructor for L01 and L02: Dr. S. A. Norman Winter 2006 FINAL EXAMINATION Auxiliary Gymnasium

More information

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design ENGN64: Design of Computing Systems Topic 4: Single-Cycle Processor Design Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University

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

University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructor: Steve Norman

University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructor: Steve Norman page of 9 University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructor: Steve Norman Winter 26 FINAL EXAMINATION (with corrections) Location: ICT 2

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

ENCM 369 Winter 2016 Lab 11 for the Week of April 4

ENCM 369 Winter 2016 Lab 11 for the Week of April 4 page 1 of 13 ENCM 369 Winter 2016 Lab 11 for the Week of April 4 Steve Norman Department of Electrical & Computer Engineering University of Calgary April 2016 Lab instructions and other documents for ENCM

More information

ENCM 369 Winter 2017 Lab 3 for the Week of January 30

ENCM 369 Winter 2017 Lab 3 for the Week of January 30 page 1 of 11 ENCM 369 Winter 2017 Lab 3 for the Week of January 30 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2017 Lab instructions and other documents for

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

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

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

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

More information

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

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

More information

Winter 2009 FINAL EXAMINATION Location: Engineering A Block, Room 201 Saturday, April 25 noon to 3:00pm

Winter 2009 FINAL EXAMINATION Location: Engineering A Block, Room 201 Saturday, April 25 noon to 3:00pm University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Lecture Instructors: S. A. Norman (L01), N. R. Bartley (L02) Winter 2009 FINAL EXAMINATION Location:

More information

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions 2 3 4 5 Prof. Stephen A. Edwards Columbia University Due June 26, 207 at :00 PM ame: Solutions Uni: Show your work for each problem;

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

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl. Lecture 4: Review of MIPS Instruction formats, impl. of control and datapath, pipelined impl. 1 MIPS Instruction Types Data transfer: Load and store Integer arithmetic/logic Floating point arithmetic Control

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 10: Simple Data Path

Lecture 10: Simple Data Path Lecture 10: Simple Data Path Course so far Performance comparisons Amdahl s law ISA function & principles What do bits mean? Computer math Today Take QUIZ 6 over P&H.1-, before 11:59pm today How do computers

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

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

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

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

Processor Design Pipelined Processor (II) Hung-Wei Tseng

Processor Design Pipelined Processor (II) Hung-Wei Tseng Processor Design Pipelined Processor (II) Hung-Wei Tseng Recap: Pipelining Break up the logic with pipeline registers into pipeline stages Each pipeline registers is clocked Each pipeline stage takes one

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

Winter 2002 FINAL EXAMINATION

Winter 2002 FINAL EXAMINATION University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructors: Dr. S. A. Norman (L01) and Dr. S. Yanushkevich (L02) Note for Winter 2005 students Winter

More information

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

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm ECE 3056 Exam I - Solutions February 19 th, 2015 3:00 pm 4:25pm 1. (35 pts) Consider the following block of SPIM code. The text segment starts at 0x00400000 and the data segment starts at 0x10010000..data

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

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

The Processor: Datapath & Control

The Processor: Datapath & Control Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture The Processor: Datapath & Control Processor Design Step 3 Assemble Datapath Meeting Requirements Build the

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

ENCM 501 Winter 2017 Assignment 3 for the Week of January 30

ENCM 501 Winter 2017 Assignment 3 for the Week of January 30 page 1 of 7 ENCM 501 Winter 2017 Assignment 3 for the Week of January 30 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2017 Assignment instructions and other

More information

COMP2611: Computer Organization. The Pipelined Processor

COMP2611: Computer Organization. The Pipelined Processor COMP2611: Computer Organization The 1 2 Background 2 High-Performance Processors 3 Two techniques for designing high-performance processors by exploiting parallelism: Multiprocessing: parallelism among

More information

Final Programming Project

Final Programming Project Due Thursday, Dec. 7, at 5:00 pm Logistics This assignment should be completed in groups of 3. This is not optional -- you are not allowed to complete it on your own, or in groups of any other size. I

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

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) The MIPS jump and link instruction, jal is used to support procedure calls by jumping to jump address (similar to j ) and

More information

ENCM 501 Winter 2018 Assignment 2 for the Week of January 22 (with corrections)

ENCM 501 Winter 2018 Assignment 2 for the Week of January 22 (with corrections) page 1 of 5 ENCM 501 Winter 2018 Assignment 2 for the Week of January 22 (with corrections) Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2018 Assignment instructions

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

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

ENCM 501 Winter 2016 Assignment 1 for the Week of January 25

ENCM 501 Winter 2016 Assignment 1 for the Week of January 25 page 1 of 5 ENCM 501 Winter 2016 Assignment 1 for the Week of January 25 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2016 Assignment instructions and other

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

Slides for Lecture 15

Slides for Lecture 15 Slides for Lecture 15 ENCM 501: Principles of Computer Architecture Winter 2014 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 6 March,

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

ENCM 501 Winter 2015 Assignment 3 for the Week of February 2

ENCM 501 Winter 2015 Assignment 3 for the Week of February 2 page 1 of 6 ENCM 501 Winter 2015 Assignment 3 for the Week of February 2 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2015 Assignment instructions and other

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

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

Due Nov. 6 th, 23:59pm No Late Submissions Accepted

Due Nov. 6 th, 23:59pm No Late Submissions Accepted Homework Assignment 3 Fall 2017 Department of Computer Science George Mason University Task: Due Nov. 6 th, 23:59pm No Late Submissions Accepted There are 2 parts to this assignment: part 1: written exercises

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

Introduction. Datapath Basics

Introduction. Datapath Basics Introduction CPU performance factors - Instruction count; determined by ISA and compiler - CPI and Cycle time; determined by CPU hardware 1 We will examine a simplified MIPS implementation in this course

More information

Lecture 4: MIPS Instruction Set

Lecture 4: MIPS Instruction Set Lecture 4: MIPS Instruction Set No class on Tuesday Today s topic: MIPS instructions Code examples 1 Instruction Set Understanding the language of the hardware is key to understanding the hardware/software

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

Design of Digital Circuits Lecture 13: Multi-Cycle Microarch. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of Digital Circuits Lecture 13: Multi-Cycle Microarch. Prof. Onur Mutlu ETH Zurich Spring April 2017 Design of Digital Circuits Lecture 3: Multi-Cycle Microarch. Prof. Onur Mutlu ETH Zurich Spring 27 6 April 27 Agenda for Today & Next Few Lectures! Single-cycle Microarchitectures! Multi-cycle and Microprogrammed

More information

Single Cycle Data Path

Single Cycle Data Path Single ycle ata Path S 365 Lecture 6 Prof. Yih Huang S365 1 MIPS Lite We're ready to look at an implementation of the MIPS Simplified to support only: memory-reference instructions: lw, sw arithmetic-logical

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

Design of Digital Circuits Lecture 14: Pipelining. Prof. Onur Mutlu ETH Zurich Spring April 2018

Design of Digital Circuits Lecture 14: Pipelining. Prof. Onur Mutlu ETH Zurich Spring April 2018 Desig of Digital Circuits Lecture 4: Pipeliig Prof. Our Mutlu ETH Zurich Sprig 28 9 April 28 Ageda for Today & Next Few Lectures Previous lectures Sigle-cycle Microarchitectures Multi-cycle ad Microprogrammed

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

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

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

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ 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

Mapping Control to Hardware

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

More information

Pipelining. CSC Friday, November 6, 2015

Pipelining. CSC Friday, November 6, 2015 Pipelining CSC 211.01 Friday, November 6, 2015 Performance Issues Longest delay determines clock period Critical path: load instruction Instruction memory register file ALU data memory register file Not

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

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

NATIONAL UNIVERSITY OF SINGAPORE

NATIONAL UNIVERSITY OF SINGAPORE NATIONAL UNIVERSITY OF SINGAPORE SCHOOL OF COMPUTING EXAMINATION FOR Semester 1 AY2013/14 CS2100 COMPUTER ORGANISATION ANSWER SCRIPT Nov 2013 Time allowed: 2 hours Caveat on the grading scheme: I have

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

Computer Hardware Engineering

Computer Hardware Engineering Computer Hardware Engineering IS2, spring 27 Lecture 9: LU and s ssociate Professor, KTH Royal Institute of Technology Slides version. 2 Course Structure Module : C and ssembly Programming LE LE2 LE EX

More information

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

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

More information

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

Slide Set 5. for ENCM 369 Winter 2014 Lecture Section 01. Steve Norman, PhD, PEng

Slide Set 5. for ENCM 369 Winter 2014 Lecture Section 01. Steve Norman, PhD, PEng Slide Set 5 for ENCM 369 Winter 2014 Lecture Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2014 ENCM 369 W14 Section

More information

CS 351 Exam 2, Fall 2012

CS 351 Exam 2, Fall 2012 CS 351 Exam 2, Fall 2012 Your name: Rules You may use one handwritten 8.5 x 11 cheat sheet (front and back). This is the only resource you may consult during this exam. Include explanations and comments

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

Project Description EEC 483 Computer Organization, Spring 2019

Project Description EEC 483 Computer Organization, Spring 2019 Project Description EEC 483 Computer Organization, Spring 2019 Title: Implement a (single-cycle) MIPS processor on Altera DE10-Lite using Quartus and VHDL Goal: This project is designed to help understand

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture Computer Science 324 Computer Architecture Mount Holyoke College Fall 2009 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture. Idea:

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

Fundamentals of Computer Systems

Fundamentals of Computer Systems Fundamentals of Computer Systems Single Cycle MIPS Processor Stephen. Edwards Columbia University Summer 26 Illustrations Copyright 27 Elsevier The path The lw The sw R-Type s The beq The Controller Encoding

More information

ECE260: Fundamentals of Computer Engineering

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

More information

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University Lecture 9 Pipeline Hazards Christos Kozyrakis Stanford University http://eeclass.stanford.edu/ee18b 1 Announcements PA-1 is due today Electronic submission Lab2 is due on Tuesday 2/13 th Quiz1 grades will

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