University of Western Ontario, Computer Science Department CS3350B, Computer Architecture Quiz 1 (30 minutes) January 21, 2015

Similar documents
University of Western Ontario, Computer Science Department CS3350B, Computer Architecture Quiz 1 (30 minutes) January 21, 2015

Final Exam Fall 2007

Computer Architecture CS372 Exam 3

ECE331: Hardware Organization and Design

Final Exam Fall 2008

ECE 30, Lab #8 Spring 2014

CSE 410 Computer Systems. Hal Perkins Spring 2010 Lecture 12 More About Caches

CISC 360. Cache Memories Exercises Dec 3, 2009

ECE 30 Introduction to Computer Engineering

Cache Memory and Performance

Solutions for Chapter 7 Exercises

Main Memory Supporting Caches

ECE331: Hardware Organization and Design

CS3350B Computer Architecture CPU Performance and Profiling

CS 61C: Great Ideas in Computer Architecture. Cache Performance, Set Associative Caches

ECE232: Hardware Organization and Design

COSC 6385 Computer Architecture - Exercises

COSC3330 Computer Architecture Lecture 19. Cache

Cache memories are small, fast SRAM-based memories managed automatically in hardware. Hold frequently accessed blocks of main memory

COSC 3406: COMPUTER ORGANIZATION

ECE7995 (6) Improving Cache Performance. [Adapted from Mary Jane Irwin s slides (PSU)]

CS 251, Winter 2018, Assignment % of course mark

CPSC 3300 Spring 2016 Final Exam Version A No Calculators

Review: Computer Organization

ECE331: Hardware Organization and Design

Computer Systems Architecture

CSF Improving Cache Performance. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches, Set Associative Caches, Cache Performance

Figure 1: Organisation for 128KB Direct Mapped Cache with 16-word Block Size and Word Addressable

Pick a time window size w. In time span w, are there, Multiple References, to nearby addresses: Spatial Locality

Alexandria University

registers data 1 registers MEMORY ADDRESS on-chip cache off-chip cache main memory: real address space part of virtual addr. sp.

Final Exam Spring 2017

EEC 170 Computer Architecture Fall Improving Cache Performance. Administrative. Review: The Memory Hierarchy. Review: Principle of Locality

5008: Computer Architecture HW#2

The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 2 solutions April 5, 2011

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

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

Page 1. Memory Hierarchies (Part 2)

Cache Memory and Performance

ELE 758 * DIGITAL SYSTEMS ENGINEERING * MIDTERM TEST * Circle the memory type based on electrically re-chargeable elements

CS 2506 Computer Organization II Test 2. Do not start the test until instructed to do so! printed

ECSE 425 Lecture 21: More Cache Basics; Cache Performance

Q1: Finite State Machine (8 points)

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Memory Technology. Caches 1. Static RAM (SRAM) Dynamic RAM (DRAM) Magnetic disk. Ideal memory. 0.5ns 2.5ns, $2000 $5000 per GB

Cache Memories. From Bryant and O Hallaron, Computer Systems. A Programmer s Perspective. Chapter 6.

CS 2506 Computer Organization II Test 2. Do not start the test until instructed to do so! printed

ECE331: Hardware Organization and Design

Exam-2 Scope. 3. Shared memory architecture, distributed memory architecture, SMP, Distributed Shared Memory and Directory based coherence

Caches Concepts Review

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2

Cache and Memory. CS230 Tutorial 07

ELEC3441: Computer Architecture Second Semester, Homework 3 (r1.1) SOLUTION. r1.1 Page 1 of 12

MIPS Pipelining. Computer Organization Architectures for Embedded Computing. Wednesday 8 October 14

ECE 2300 Digital Logic & Computer Organization. More Caches Measuring Performance

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

EEC 483 Computer Organization

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

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

CS61C : Machine Structures

CENG 3420 Computer Organization and Design. Lecture 08: Cache Review. Bei Yu

Lecture 19: Memory Hierarchy Five Ways to Reduce Miss Penalty (Second Level Cache) Admin

Memory System Design Part II. Bharadwaj Amrutur ECE Dept. IISc Bangalore.

Review: Performance Latency vs. Throughput. Time (seconds/program) is performance measure Instructions Clock cycles Seconds.

Computer Architecture

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements

CS 433 Homework 4. Assigned on 10/17/2017 Due in class on 11/7/ Please write your name and NetID clearly on the first page.

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

Chapter 4. The Processor

Lecture 17 Introduction to Memory Hierarchies" Why it s important " Fundamental lesson(s)" Suggested reading:" (HP Chapter

6.004 Tutorial Problems L14 Cache Implementation

Improving Cache Performance

Lecture 29 Review" CPU time: the best metric" Be sure you understand CC, clock period" Common (and good) performance metrics"

Consider the following 16-bit machine (datapath and register width is 2B).

CS 2410 Mid term (fall 2015) Indicate which of the following statements is true and which is false.

EEM478-WEEK7 PART B Bootloader

Caches and Memory Hierarchy: Review. UCSB CS240A, Winter 2016

Introduction to cache memories

registers data 1 registers MEMORY ADDRESS on-chip cache off-chip cache main memory: real address space part of virtual addr. sp.

Inside out of your computer memories (III) Hung-Wei Tseng

Question 1 (5 points) Consider a cache with the following specifications Address space is 1024 words. The memory is word addressable The size of the

Improving Cache Performance

CS3350B Computer Architecture

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Corso Architetture Avanzate dei Calcolatori

CS152 Computer Architecture and Engineering

CS152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Spring Caches and the Memory Hierarchy

3Introduction. Memory Hierarchy. Chapter 2. Memory Hierarchy Design. Computer Architecture A Quantitative Approach, Fifth Edition

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

LECTURE 3: THE PROCESSOR

Course on Advanced Computer Architectures

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

The Memory Hierarchy & Cache Review of Memory Hierarchy & Cache Basics (from 350):

ADVANCED COMPUTER ARCHITECTURES: Prof. C. SILVANO Written exam 11 July 2011

CSE 431 Computer Architecture Fall Chapter 5A: Exploiting the Memory Hierarchy, Part 1

Memory Hierarchy Design (Appendix B and Chapter 2)

What is Pipelining? RISC remainder (our assumptions)

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

Chapter Seven. Large & Fast: Exploring Memory Hierarchy

Transcription:

University of Western Ontario, Computer Science Department CS3350B, Computer Architecture Quiz (30 minutes) January 2, 205 Student ID number: Student Last Name: Exercise. In the following list of performance metrics, identify those that can be used to calculate the CPU execution time of a program. For each such performance metric, indicate a formula estimating CPU execution time where this performance metric is used. Your formulas should be as simple as possible, that is, should not contain any unnecessary variables. Cycles per instruction (CPI), Clock rate (CR in Hz), Clock cycle time (CC in sec.), Instruction count (IC). Answer: All the above variables are performance metrics. Corresponding formulas are shown below: CPU time = IC CPI CC, CPU time = IC CPI CR.

Exercise 2. To capture the fact that the time to access data for both hits and misses affects performance, designers use average memory access time (AMAT) as a way to examine alternative cache designs. Average memory access time is the average time to access memory considering both hits and misses and the frequency of different accesses. In the list below, please circle the correct formula for calculating the AMAT of a program on a computer with one level cache (L) and a main memory (DRAM). Answer box: AMAT = L hit time + L miss rate * L miss penalty AMAT = L miss penalty + L hit rate * L hit time AMAT = L miss penalty + L miss rate * L hit time Answer: AMAT = L hit time + L miss rate * L miss penalty Exercise 3. Computing the overall effective CPI is done by looking at the different types of instructions and their individual cycle counts and averaging. Please use the information in the table to answer questions: Operation F requency CP I i ALU 50% Load 20% 5 Store 0% 3 Branch 20% 2 Question : What is the overall effective CPI of the machine according to the table? Answer: The overall effective is given by n CPI = (CPI i IC i ), where i= IC i is the percentage of the number of instructions of class i executed, CPI i is the (average) number of clock cycles per instruction for that instruction class, n is the number of instruction classes. Therefore, from the above data, we have CPI = 50% + 20% 5 + 0% 3 + 20% 2 = 2.2 2

Questing 2: What is the overall effective CPI of the machine if a better data cache reduces the average load time from 5 to 2 cycles? Answer: CPI = 50% + 20% 2 + 0% 3 + 20% =.6 Question 3: What if two ALU instructions could be executed at once? Answer: CPI = 50% /2 + 20% 5 + 0% 3 + 20% 2 =.95 3

Exercise 4. In this exercise, we consider a direct-mapped cache memory where each cache block holds two words. We assume that each word is a one byte and that each memory address is a 4-bit number where the first 2 bits (from left to right) are the tag bits, the third bit is the set address (index), and the last bit is the offset from the beginning of the block. Hence, the main memory of this computer holds 8 blocks, thus, 6 words (or bytes). We assume that the following words are accessed in sequence, according to the following access pattern (from left to right): Word number: 0 2 3 4 3 4 5 Memory address: 0000 000 000 00 000 00 000 Table : Sequence of accessed words We start with an empty cache and all blocks initially marked as not valid. (Valid bits are not shown on the pictures below.) 0 Table 2: Initially, the cache is empty. Questions: Use Table 3 to Table 0 to depict the contents of the cache when the processor requests the 8 words, in sequence, as specified in Table. For each request of the processor to the cache, indicate whether this is a cache miss or cache hit. Calculate the cache miss rate. Important remark: In the above statement, the endianess was left unspecified, on purpose, for simplicity. In the correction below, we first use the Bigendian system. Then, as an alternative solution, we use the Little-endian version. For learning about endianess, please refer to http://en.wikipedia.org/ wiki/endianness. Both systems yield, of course, the same requests: 4 hits, 4 misses. Thus a 50% hit rate! 4

Big-endian answer: 0 00 Mem(0) Mem() Table 3: Accessing word number 0 : miss 0 00 Mem(0) Mem() Table 4: Accessing word number : hit 0 00 Mem(0) Mem() Table 5: Accessing word number 2 : miss 5

0 00 Mem(0) Mem() Table 6: Accessing word number 3 : hit 0 0 Mem(4) Mem(5) Table 7: Accessing word number 4: miss 0 0 Mem(4) Mem(5) Table 8: Accessing word number 3: hit 0 0 Mem(4) Mem(5) Table 9: Accessing word number 4 : hit 0 0 Mem(4) Mem(5) 0 Mem(4) Mem(5) Table 0: Accessing word number 5 : miss 6

Little-endian answer: 0 00 Mem() Mem(0) Table : Accessing word number 0 : miss 0 00 Mem() Mem(0) Table 2: Accessing word number : hit 0 00 Mem() Mem(0) Table 3: Accessing word number 2 : miss 7

0 00 Mem() Mem(0) Table 4: Accessing word number 3 : hit 0 0 Mem(5) Mem(4) Table 5: Accessing word number 4: miss 0 0 Mem(5) Mem(4) Table 6: Accessing word number 3: hit 0 0 Mem(5) Mem(4) Table 7: Accessing word number 4 : hit 0 0 Mem(5) Mem(4) 0 Mem(5) Mem(6) Table 8: Accessing word number 5 : miss 8