Last Name (in case pages get detached): UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2011

Size: px
Start display at page:

Download "Last Name (in case pages get detached): UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2011"

Transcription

1 Page 1 of 17 UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2011 ECE243H1 S COMPUTER ORGANIZATION Exam Type: D Duration: 2.5 Hours Prof.s Anderson, Enright Jerger, and Steffan This is a type D exam. You are allowed to use any book/notes and a non-programmable calculator as allowed by the University regulations. Last Name (Print): First Name: Student Number: Marks Total 140 Max. Marks Please: State your assumptions. Show your work. Comment your code. Use your time wisely. The mark value of each question is roughly equivalent to how many minutes it should take to answer. If you think that assumptions must be made to answer a question, state them clearly. If there are multiple possibilities, comment that there are, explain why and then provide at least one possible answer and state the corresponding assumptions.

2 Page 2 of 17 Part 1. [15] Short Answer a) Give the immediate 16bit value that is needed to encode the beq r8, r9, branch2 instruction in the following NIOS code: branch1: branch2: beq r8, r9, branch2 blt r8, r9, branch1 add r8, r8, r8 add r8, r8, r8 add r9, r9, r9 add r8, r8, r0 Answer: 16 (0x0010) b) Consider the following simplified datapath (as discussed in class) with no forwarding lines: Write STALL between instructions that contain a data hazard so that the code produces the correct result in the above datapath: add r8, r8, r9 STALL sub r9, r8, r10 add r10, r10, r10 STALL ldw r11, 0(r10) c) True or False: there are instructions found in CISC machines that are also found in RISC machines [true]

3 Page 3 of 17 d) The following code sums the top two words on the stack, pops one of the words, and overwrites the other word with the sum- - - however, the code does not do these operations in that order. In general the code works, but in what case would this code lead to an incorrect result? (NOTE: This is a hard question!) addi sp,sp,4 #move the stack pointer by 4bytes ldw r8,-4(sp) #get first operand ldw r9,0(sp) #get second operand add r8,r9,r8 #calculate the sum stw r8,0(sp) #store the sum [moving the stack pointer before loading from it means an interrupt between the addi and first ldw could change the value on the stack at - 4(sp)] e) Fill in the table below, showing the result of each instruction. Assume that : R8 = 0xBADACABA slli r9,r8,4 srli r9,r8,8 srai r9,r8,8 R9=0xADACABA0 R9=0x00BADACA R9=0xFFBADACA f) Caches are organized into blocks to exploit what form of locality? Why does it make sense for an instruction- cache to have blocks (instead of single- instruction cache entries)? Blocks exploit spatial locality; instructions are often executed sequentially. g) In virtual memory implementations, why are pages normally so much larger (e.g., 4KB) than cache blocks (eg., 64B)?

4 Page 4 of 17 Hard drives are much slower than main memory, so you must transfer larger chunks to be worth the overhead. Also to reduce the page table size. Part 2. [20] C to Assembly The structure used to represent a binary tree are shown in part (a) of the figure below. Part (b) shows the sum_tree function, a C function that accepts a pointer, tree. The tree pointer points to an element in the tree. The function traverses the tree recursively to sum all the elements. Ints and pointers are 4B each. Implement sum_tree in NIOS II assembly. Please use callee- save registers for any temporary registers you may need (and save/restore them). struct node_t { int item; struct node_t *left; struct node_t *right; } (a) void sum_tree (struct node_t *tree) { if (tree!= NULL) { sum += tree- >item; sum_tree(tree- >left); sum_tree(tree- >right); } } (b) COPY1: please cross out the copy you do not want graded.section.data.align 2 sum:.word 0 sum_tree: # prologue.section.text add sp, sp, - 20 stw ra, 16(sp) stw r16, 12(sp) stw r17, 8(sp) stw r18, 4(sp) movia r16, sum # if (tree!= NULL) { beq r4, r0, epi # sum += tree- >item; ldw r17, 0(r4) ldw r18, 0(r16) epi: # sum_tree(tree- >left); stw r4, 0(sp) ldw r4, 4(r4) call sum_tree ldw r4, 0(sp) # sum_tree(tree- >right); ldw r4, 8(r4) call sum_tree # epilogue ldw r18, 4(sp) ldw r17, 8(sp) ldw r16, 12(sp) ldw ra, 16(sp) add sp, sp, 20 ret

5 Page 5 of 17 add r18, r18, r17 stw r18, 0(r16) (this is repeated here for your convenience) struct node_t { int item; struct node_t *left; struct node_t *right; } (a) void sum_tree (struct node_t *tree) { if (tree!= NULL) { sum += tree- >item; sum_tree(tree- >left); sum_tree(tree- >right); } } (b) COPY2: please cross out the copy you do not want graded.section.data.align 2 sum:.word 0 sum_tree: # prologue.section.text # sum_tree(tree- >left); # sum_tree(tree- >right); # epilogue # if (tree!= NULL) { # sum += tree- >item;

6 Page 6 of 17 Part 3. [15] Stack / Procedure calls a) Fill in the stack operations to save registers as required by convention in the following subroutine: RS232Out: # put stack operations here addi sp,sp,-8 stw r19,0(sp) stw r21,4(sp) movia r13, 0x /* r13 now contains the base addr of UART*/ ldhio r19, 4(r13) /* Load from the UART */ beq r19, r0, Done /* this branch is taken if no room for data*/ ldbio r8, 0(r4) /* get value to output */ stwio r21, 0(r13) Done: # put stack operations here ldw r21,4(sp) ldw r19,0(sp) addi sp,sp,8 ret b) If this subroutine were to be called from code within an interrupt handler, what registers (in addition to those you saved above) would also have to be saved (if any)? Where in the code would you perform this additional saving of registers? ra, r4, r8, r13 saved in preamble of ISR

7 Page 7 of 17 Part 4. [20] Interrupts The program and data below have been loaded on a NIOS II system. Assume that as soon as interrupts are enabled, that it is possible that some device might request an interrupt. A 5-element array is stored in memory at label array..section.data index:.byte 4 array:.byte 1, 2, 3, 4, 5.section.exceptions, ax h0: movia r8, index h1: stbu r0, 0(r8) h2: addi ea, ea, - 4 h3: eret.section.text main: # interrupts are disabled here movia r16, index movia r17, array movia r18, sum # interrupts are enabled here f0: ldbu r19, 0(r16) f1: add r20, r17, r19 f2: ldbu r21, 0(r20) f3: addi r21, r21, 1 f4: addi r19, r19, - 1 f5: stbu r19, 0(r16) f6: stbu r21, 0(r20) f7: bgt r19,r0,f0 f8: Give the final contents of array for each of the following scenarios: a) No interrupt occurs: array = { 2, 3, 4, 5, 6 } b) One interrupt occurs before f0: c) below, put check marks next to each valid final state for array (for any occurrence of interrupts including (a) and (b) above): array = {2, 3, 4, 5, 6} _X array = {1, 2, 3, 4, 5} array = {2, 3, 4, 5, 5} array = {2, 2, 3, 4, 5} _X array = {1, 2, 3, 4, 6} array = {2, 2, 3, 4, 6} _X array = {2, 2, 3, 5, 6}_X array = {2, 2, 2, 4, 6} array = {2, 2, 4, 5, 6}_X array = {1, 2, 3, 5, 6} array = {1, 2, 4, 5, 6}

8 Page 8 of 17 array = { 2, 2, 3, 4, 5 } Part 5. [20] CPU Design You have the following computer structure as described in class: The datapath is controlled by the following control signals: PCout PC to bus PCwrite MDRBuswrite MDR updated from bus MEMoutBus Memory data value to bus MARwrite Ywrite Zwrite ZoutBus Z value to bus IRwrite RFsel Select which register is output to bus or written, as determined by RFout and RFwrite RFout Allow output from selected register to bus RFwrite Write to selected register from bus ra_outbus ra register value to bus ra_write write to ra register from bus ALUop Add, subtract, shift, etc. Select Chooses one of the ALU inputs MEMRead The data from the memory address specified is output to Dout MEMWrite The data on Din is written to the memory address specified

9 Page 9 of 17 a) Show a cycle- by- cycle timing diagram of how the memory works for a single read. Assume that control signals change only on the falling edge of the clock. Also assume that MDR data is available on the rising edge of the clock directly after the cycle in which the MEMRead is initiated. NOTE: this is a very easy question, we essentially describe the answer in the question- - - its purpose is to help you get the answer to (b) correct. CPU Clock MARwrite MEMRead MDR data available for bus b) Fill in the table below to specify the proper control signals to implement a JSR (jump to subroutine) instruction that performs: ra pc+2, pc mem[pc+1]. Include all cycles, including those to fetch the instruction. State all assumptions. For ALUop and Select, just specify the values. Ex: Select Y, ALUop=Subtract. Assume that memory read information is available the cycle directly after the cycle in which the MEMRead is initiated. The first cycle is started for you (but not necessarily completed). Put an X only where signals are active during the cycle. Some columns and rows may be unused. For full marks your implementation should be as fast as possible.

10 Page 10 of 17 COPY1: please cross out the copy you do not want graded Cycle Signal PCout X xxxxxx xxxxxx xxxxxxx xxxxxx xxxxxx xxxxxx xxxxxx xxxxxx PCwrite X X MDRBuswrite MEMoutBus X X MARwrite X X Ywrite Zwrite X X ZoutBus X X IRwrite X RFsel RFout RFwrite ra_outbus ra_write X ALUop ADD ADD Select 1 1 MEMRead X X MEMWrite

11 Page 11 of 17 COPY2: please cross out the copy you do not want graded Cycle Signal PCout X PCwrite MDRBuswrite MEMoutBus MARwrite Ywrite Zwrite ZoutBus IRwrite RFsel RFout RFwrite ra_outbus ra_write ALUop Select 1 MEMRead MEMWrite

12 Page 12 of 17 Part 6. [20] Memory Design Consider the ROM chip above that has the following pins of interest: A5..0: address pins D15..0: data pins, which include built-in tri-state buffers enabled by BE1 and BE0 appropriately BE1: byte enable for the upper byte of output (D15..8) BE0: byte enable for the lower byte of output (D7..0) You are to build a ROM device out of a number of these ROM chips by completing one copy of the diagrams on the next two pages. Your ROM device and solution should have the following features: 256bytes of ROM storage The first byte (eg., byte0) of the ROM should be mapped to address 0xFA000 All 256bytes of the ROM should be mapped to consecutive byte addresses o Eg., byte1 is mapped to 0xFA001, byte2 is mapped to 0xFA002, etc. Your ROM device should respond properly to byte, half-word, and word loads You may use only decoders, AND gates, OR gates, NOT gates, and tri-state-buffers You do not have to handle illegal combinations of the BE3..0 signals You can ignore the ACK line of the bus (it is not shown) COPY1: please cross out the copy you do not want graded.

13 Page 13 of 17 COPY2: please cross out the copy you do not want graded.

14 Page 14 of 17 Part 7. [30] Caches

15 Page 15 of 17 a) fill in the blanks in the table below; each row describes a certain cache design by giving the total cache capacity, the cache block size (data only), associativity, and number of tag, set-index, and offset bits. For all rows assume a 32-bit address space. Show your work on this page below for possible part marks. Total Capacity Block Size Associativity Tag bits Set-index bits Cache1: 1MB 128B 2-way Cache2: 2KB 32B 1-way (directmapped) Cache3: 8KB 64B 4-way Offset bits b) assuming a 512B, 2- way set- associative cache with 16B cache blocks and LRU replacement, and the address- trace from a set of accesses below:

16 Page 16 of 17 What is the number total number of hits: 8 What is the hit rate: 50% Show your work below for possible part marks. ADDRESS TRACE: 0xFA23 0xFA29 0xFADE 0xEBD0 0xFB2E 0xFAD3 0xFA2A 0xFAD9 0xFBDE 0xEB23 0xFA21 0xFA20 0xEBDF 0xEB29 0xFBDC 0xFAD1 c) For a cache, is there a sequence of addresses that will perform better if the cache is directmapped rather than 2-way set associative? If so, describe the sequence. This is assuming that the capacity of the cache and the size of the blocks is the same in both cases.

17 Page 17 of 17 (CEDOMIR S ANSWER) Cache has four 1-byte blocks (Blocks 0-3, Sets 0-1) and LRU policy. The sequence of addresses is 0, 2, 6, 0: Direct 0 MISS, BRING 0 to Block 0 2 MISS, BRING 2 to Block 2 6 MISS, BRING 6 to Block 2 0 HIT 2-way 0 MISS, BRING 0 to Set 0 2 MISS, BRING 2 to Set 0 6 MISS, 6 REPLACES 0 in Set 0 0 MISS

Last Name (in case pages get detached): UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING MIDTERM EXAMINATION, MARCH 2011

Last Name (in case pages get detached): UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING MIDTERM EXAMINATION, MARCH 2011 Page 1 of 13 UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING MIDTERM EXAMINATION, MARCH 2011 ECE243H1 S COMPUTER ORGANIZATION Exam Type: D Duration: 2 Hours Prof.s Anderson, Enright Jerger,

More information

University of Toronto Faculty of Applied Science and Engineering

University of Toronto Faculty of Applied Science and Engineering Print: First Name:............................. Last Name:............................. Student Number:............................................... University of Toronto Faculty of Applied Science and

More information

Student # (use if pages get separated)

Student # (use if pages get separated) UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2016 DURATION 2 and ½ hrs Second Year - ECE ECE243H1 S COMPUTER ORGANIZATION Exam Type: D Examiners P. Anderson,

More information

University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination

University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination ECE 253F - Digital and Computer Systems Friday December 10, 2010 Duration:

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

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

Problem 1 (logic design)

Problem 1 (logic design) Problem 1 (logic design) For this problem, you are to design and implement a sequential multiplexor that works as follows. On each clock cycle, interpret the current input as a selector from the most recent

More information

CS232 Final Exam May 5, 2001

CS232 Final Exam May 5, 2001 CS232 Final Exam May 5, 2 Name: Spiderman 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

More information

1. Number Conversions [8 marks]

1. Number Conversions [8 marks] 1. Number Conversions [8 marks] a. convert the decimal number 42 to a 16-bit signed integer in binary 0b0000 0000 0010 1010 b. convert the 8-bit number 0x42 to a 16-bit signed integer in binary 0b0000

More information

CS 230 Practice Final Exam & Actual Take-home Question. Part I: Assembly and Machine Languages (22 pts)

CS 230 Practice Final Exam & Actual Take-home Question. Part I: Assembly and Machine Languages (22 pts) Part I: Assembly and Machine Languages (22 pts) 1. Assume that assembly code for the following variable definitions has already been generated (and initialization of A and length). int powerof2; /* powerof2

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

Faculty of Science FINAL EXAMINATION

Faculty of Science FINAL EXAMINATION Faculty of Science FINAL EXAMINATION COMPUTER SCIENCE COMP 273 INTRODUCTION TO COMPUTER SYSTEMS Examiner: Prof. Michael Langer April 18, 2012 Associate Examiner: Mr. Joseph Vybihal 2 P.M. 5 P.M. STUDENT

More information

Machine Organization & Assembly Language

Machine Organization & Assembly Language Name: 1 CSE 378 Fall 2010 Machine Organization & Assembly Language Final Exam Solution Write your answers on these pages. Additional pages may be attached (with staple) if necessary. Please ensure that

More information

6.823 Computer System Architecture Datapath for DLX Problem Set #2

6.823 Computer System Architecture Datapath for DLX Problem Set #2 6.823 Computer System Architecture Datapath for DLX Problem Set #2 Spring 2002 Students are allowed to collaborate in groups of up to 3 people. A group hands in only one copy of the solution to a problem

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

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

Topic #6. Processor Design

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

More information

CSE 378 Final Exam 3/14/11 Sample Solution

CSE 378 Final Exam 3/14/11 Sample Solution Name There are 8 questions worth a total of 100 points. Please budget your time so you get to all of the questions don t miss the short questions at the end. Keep your answers brief and to the point. Copies

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

Computer Architecture V Fall Practice Exam Questions

Computer Architecture V Fall Practice Exam Questions Computer Architecture V22.0436 Fall 2002 Practice Exam Questions These are practice exam questions for the material covered since the mid-term exam. Please note that the final exam is cumulative. See 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

CS/CoE 1541 Mid Term Exam (Fall 2018).

CS/CoE 1541 Mid Term Exam (Fall 2018). CS/CoE 1541 Mid Term Exam (Fall 2018). Name: Question 1: (6+3+3+4+4=20 points) For this question, refer to the following pipeline architecture. a) Consider the execution of the following code (5 instructions)

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

Initial Representation Finite State Diagram. Logic Representation Logic Equations

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

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

More information

Department of Electrical Engineering and Computer Sciences Fall 2017 Instructors: Randy Katz, Krste Asanovic CS61C MIDTERM 2

Department of Electrical Engineering and Computer Sciences Fall 2017 Instructors: Randy Katz, Krste Asanovic CS61C MIDTERM 2 University of California, Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences Fall 2017 Instructors: Randy Katz, Krste Asanovic 2017 10 31 CS61C MIDTERM 2 After the

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

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes NAME: STUDENT NUMBER: EE557--FALL 1999 MAKE-UP MIDTERM 1 Closed books, closed notes Q1: /1 Q2: /1 Q3: /1 Q4: /1 Q5: /15 Q6: /1 TOTAL: /65 Grade: /25 1 QUESTION 1(Performance evaluation) 1 points We are

More information

Midterm #2 Solutions April 23, 1997

Midterm #2 Solutions April 23, 1997 CS152 Computer Architecture and Engineering Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Sp97 D.K. Jeong Midterm #2 Solutions

More information

The University of Alabama in Huntsville Electrical & Computer Engineering Department CPE Test II November 14, 2000

The University of Alabama in Huntsville Electrical & Computer Engineering Department CPE Test II November 14, 2000 The University of Alabama in Huntsville Electrical & Computer Engineering Department CPE 513 01 Test II November 14, 2000 Name: 1. (5 points) For an eight-stage pipeline, how many cycles does it take to

More information

CS Computer Architecture

CS Computer Architecture CS 35101 Computer Architecture Section 600 Dr. Angela Guercio Fall 2010 An Example Implementation In principle, we could describe the control store in binary, 36 bits per word. We will use a simple symbolic

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

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

Topic Notes: MIPS Instruction Set Architecture

Topic Notes: MIPS Instruction Set Architecture Computer Science 220 Assembly Language & Comp. Architecture Siena College Fall 2011 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture.

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

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

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

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

Processor (I) - datapath & control. Hwansoo Han

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

More information

Computer Architecture CS372 Exam 3

Computer Architecture CS372 Exam 3 Name: Computer Architecture CS372 Exam 3 This exam has 7 pages. Please make sure you have all of them. Write your name on this page and initials on every other page now. You may only use the green card

More information

Question 1: (20 points) For this question, refer to the following pipeline architecture.

Question 1: (20 points) For this question, refer to the following pipeline architecture. This is the Mid Term exam given in Fall 2018. Note that Question 2(a) was a homework problem this term (was not a homework problem in Fall 2018). Also, Questions 6, 7 and half of 5 are from Chapter 5,

More information

ECE 30, Lab #8 Spring 2014

ECE 30, Lab #8 Spring 2014 ECE 30, Lab #8 Spring 20 Shown above is a multi-cycle CPU. There are six special registers in this datapath: PC, IR, MDR, A, B, and ALUOut. Of these, PC and IR are enabled to change when PCWr and IRWr

More information

Major CPU Design Steps

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

More information

I expect you to understand everything discussed prior to this page. In particular:

I expect you to understand everything discussed prior to this page. In particular: A NOTE TO 259 STUDENTS: Interrupts involve a lot of details. The details presented after this page provide further background on exactly what happens at the CPU logic and assembly code levels. This may

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

CPE 335. Basic MIPS Architecture Part II

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

More information

Lectures 3-4: MIPS instructions

Lectures 3-4: MIPS instructions Lectures 3-4: MIPS instructions Motivation Learn how a processor s native language looks like Discover the most important software-hardware interface MIPS Microprocessor without Interlocked Pipeline Stages

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

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

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

More information

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

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

More information

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

Advanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017

Advanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017 Advanced Parallel Architecture Lessons 5 and 6 Annalisa Massini - Pipelining Hennessy, Patterson Computer architecture A quantitive approach Appendix C Sections C.1, C.2 Pipelining Pipelining is an implementation

More information

Computer Architecture, IFE CS and T&CS, 4 th sem. Single-Cycle Architecture

Computer Architecture, IFE CS and T&CS, 4 th sem. Single-Cycle Architecture Single-Cycle Architecture Data flow Data flow is synchronized with clock (edge) in sequential systems Architecture Elements - assumptions Program (Instruction) memory: All instructions & buses are 32-bit

More information

LECTURE 6. Multi-Cycle Datapath and Control

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

More information

ECE Sample Final Examination

ECE Sample Final Examination ECE 3056 Sample Final Examination 1 Overview The following applies to all problems unless otherwise explicitly stated. Consider a 2 GHz MIPS processor with a canonical 5-stage pipeline and 32 general-purpose

More information

Points available Your marks Total 100

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

More information

OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS.

OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS. CS/ECE472 Midterm #2 Fall 2008 NAME: Student ID#: OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS. Your signature is your promise that you have not cheated and will

More information

Chapter Seven. Large & Fast: Exploring Memory Hierarchy

Chapter Seven. Large & Fast: Exploring Memory Hierarchy Chapter Seven Large & Fast: Exploring Memory Hierarchy 1 Memories: Review SRAM (Static Random Access Memory): value is stored on a pair of inverting gates very fast but takes up more space than DRAM DRAM

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

The Evolution of Microprocessors. Per Stenström

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

More information

RISC Design: Multi-Cycle Implementation

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

More information

Computer System Architecture Midterm Examination Spring 2002

Computer System Architecture Midterm Examination Spring 2002 Computer System Architecture 6.823 Midterm Examination Spring 2002 Name: This is an open book, open notes exam. 110 Minutes 1 Pages Notes: Not all questions are of equal difficulty, so look over the entire

More information

Processor design - MIPS

Processor design - MIPS EASY Processor design - MIPS Q.1 What happens when a register is loaded? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit

More information

University of Toronto Faculty of Applied Science and Engineering

University of Toronto Faculty of Applied Science and Engineering Print: First Name:Solution...................... Last Name:............................. Student Number:............................................... University of Toronto Faculty of Applied Science

More information

CSE 2021 COMPUTER ORGANIZATION

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

More information

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

ECE550 PRACTICE Final

ECE550 PRACTICE Final ECE550 PRACTICE Final This is a full length practice midterm exam. If you want to take it at exam pace, give yourself 175 minutes to take the entire test. Just like the real exam, each question has a point

More information

COSC 6385 Computer Architecture - Pipelining

COSC 6385 Computer Architecture - Pipelining COSC 6385 Computer Architecture - Pipelining Fall 2006 Some of the slides are based on a lecture by David Culler, Instruction Set Architecture Relevant features for distinguishing ISA s Internal storage

More information

University of Toronto Faculty of Applied Science and Engineering

University of Toronto Faculty of Applied Science and Engineering Print: First Name:............ Solutions............ Last Name:............................. Student Number:............................................... University of Toronto Faculty of Applied Science

More information

Do-While Example. In C++ In assembly language. do { z--; while (a == b); z = b; loop: addi $s2, $s2, -1 beq $s0, $s1, loop or $s2, $s1, $zero

Do-While Example. In C++ In assembly language. do { z--; while (a == b); z = b; loop: addi $s2, $s2, -1 beq $s0, $s1, loop or $s2, $s1, $zero Do-While Example In C++ do { z--; while (a == b); z = b; In assembly language loop: addi $s2, $s2, -1 beq $s0, $s1, loop or $s2, $s1, $zero 25 Comparisons Set on less than (slt) compares its source registers

More information

Cache Organizations for Multi-cores

Cache Organizations for Multi-cores Lecture 26: Recap Announcements: Assgn 9 (and earlier assignments) will be ready for pick-up from the CS front office later this week Office hours: all day next Tuesday Final exam: Wednesday 13 th, 7:50-10am,

More information

Introduction to Computers & Programming

Introduction to Computers & Programming 16.070 Introduction to Computers & Programming Computer Architecture, Machine Language, Program Execution Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Chapter Summary This chapter introduces the activities

More information

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

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

More information

Machine Organization & Assembly Language

Machine Organization & Assembly Language Name: CSE 378 Winter 29 Machine Organization & Assembly Language Midterm Exam Solution your answers on these pages. itional pages may be attached (with staple) if necessary. Please ensure that your answers

More information

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

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

More information

CSE 2021 COMPUTER ORGANIZATION

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

More information

UNIT- 5. Chapter 12 Processor Structure and Function

UNIT- 5. Chapter 12 Processor Structure and Function UNIT- 5 Chapter 12 Processor Structure and Function CPU Structure CPU must: Fetch instructions Interpret instructions Fetch data Process data Write data CPU With Systems Bus CPU Internal Structure Registers

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

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals Cache Memory COE 403 Computer Architecture Prof. Muhamed Mudawar Computer Engineering Department King Fahd University of Petroleum and Minerals Presentation Outline The Need for Cache Memory The Basics

More information

CS305, Computer Architecture, End Sem, Sat 21/11/09, 2:30 05:30pm, Max marks: 45

CS305, Computer Architecture, End Sem, Sat 21/11/09, 2:30 05:30pm, Max marks: 45 CS305, Computer Architecture, End Sem, Sat 21/11/09, 2:30 05:30pm, Max marks: 45 Declaration (write by hand and sign): I hereby declare that I hold copying as an act as shameful as stealing, or bribery,

More information

Name: University of Michigan uniqname: (NOT your student ID number!)

Name: University of Michigan uniqname: (NOT your student ID number!) The University of Michigan - Department of EECS EECS370 Introduction to Computer Organization Midterm Exam 1 October 22, 2009 Name: University of Michigan uniqname: (NOT your student ID number!) Open book,

More information

a) Do exercise (5th Edition Patterson & Hennessy). Note: Branches are calculated in the execution stage.

a) Do exercise (5th Edition Patterson & Hennessy). Note: Branches are calculated in the execution stage. CS3410 Spring 2015 Problem Set 2 (version 3) Due Saturday, April 25, 11:59 PM (Due date for Problem-5 is April 20, 11:59 PM) NetID: Name: 200 points total. Start early! This is a big problem set. Problem

More information

A First Look at Microprocessors

A First Look at Microprocessors A First Look at Microprocessors using the The General Prototype Computer (GPC) model Part 2 Can you identify an opcode to: Decrement the contents of R1, and store the result in R5? Invert the contents

More information

Q.1 Explain Computer s Basic Elements

Q.1 Explain Computer s Basic Elements Q.1 Explain Computer s Basic Elements Ans. At a top level, a computer consists of processor, memory, and I/O components, with one or more modules of each type. These components are interconnected in some

More information

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) ELEC 5200-001/6200-001 Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) Victor P. Nelson, Professor & Asst. Chair Vishwani D. Agrawal, James J. Danaher Professor Department

More information

This exam is worth 40 points, or 30% of your total course grade. The exam contains eight

This exam is worth 40 points, or 30% of your total course grade. The exam contains eight CS 61C Final December 6, 1994 Your name login cs61c{ This exam is worth 40 points, or 30% of your total course grade. The exam contains eight questions. This booklet contains ten numbered pages including

More information

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

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

More information

Systems Architecture I

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

More information

Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University. See P&H 2.8 and 2.12, and A.

Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University. See P&H 2.8 and 2.12, and A. Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See P&H 2.8 and 2.12, and A.5 6 compute jump/branch targets memory PC +4 new pc Instruction Fetch

More information

COMPUTER ORGANIZATION AND DESIGN

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

More information

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 8-<1>

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 8-<1> Digital Logic & Computer Design CS 4341 Professor Dan Moldovan Spring 21 Copyright 27 Elsevier 8- Chapter 8 :: Memory Systems Digital Design and Computer Architecture David Money Harris and Sarah L.

More information

Microprogrammed Control Approach

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

More information

CSCE 5610: Computer Architecture

CSCE 5610: Computer Architecture HW #1 1.3, 1.5, 1.9, 1.12 Due: Sept 12, 2018 Review: Execution time of a program Arithmetic Average, Weighted Arithmetic Average Geometric Mean Benchmarks, kernels and synthetic benchmarks Computing CPI

More information

Computer Organization MIPS ISA

Computer Organization MIPS ISA CPE 335 Computer Organization MIPS ISA Dr. Iyad Jafar Adapted from Dr. Gheith Abandah Slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE 232 MIPS ISA 1 (vonneumann) Processor Organization

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 15 Cache II 2005-3-8 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/ Last Time: Locality

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

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit Lecture1: introduction Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit 1 1. History overview Computer systems have conventionally

More information

Chapter 8 :: Topics. Chapter 8 :: Memory Systems. Introduction Memory System Performance Analysis Caches Virtual Memory Memory-Mapped I/O Summary

Chapter 8 :: Topics. Chapter 8 :: Memory Systems. Introduction Memory System Performance Analysis Caches Virtual Memory Memory-Mapped I/O Summary Chapter 8 :: Systems Chapter 8 :: Topics Digital Design and Computer Architecture David Money Harris and Sarah L. Harris Introduction System Performance Analysis Caches Virtual -Mapped I/O Summary Copyright

More information

(1) Using a different mapping scheme will reduce which type of cache miss? (1) Which type of cache miss can be reduced by using longer lines?

(1) Using a different mapping scheme will reduce which type of cache miss? (1) Which type of cache miss can be reduced by using longer lines? (1) Give a one-word definition of coherence. (1) Give a one-word definition of consistency. (1) Using a different mapping scheme will reduce which type of cache miss? (1) Which type of cache miss can be

More information