CS 351 Exam 3, Fall 2013

Similar documents
CS 351 Exam 3, Fall 2011

CS 351 Exam 1, Fall 2010

CS 351 Exam 2, Fall 2012

Computer Architecture CS372 Exam 3

CS 351 Exam 3 Mon. 5/11/2015

CS 351 Exam 4, Fall 2010

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

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design

CSE 141 Computer Architecture Spring Lectures 17 Virtual Memory. Announcements Office Hour

Why memory hierarchy

ECE232: Hardware Organization and Design

Memory Hierarchies. Instructor: Dmitri A. Gusev. Fall Lecture 10, October 8, CS 502: Computers and Communications Technology

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.

CS399 New Beginnings. Jonathan Walpole

ELE 375 Final Exam Fall, 2000 Prof. Martonosi

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

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

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

CS 351 Exam 2 Mon. 11/2/2015

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

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

Final Exam Fall 2008

14:332:331. Week 13 Basics of Cache

EXAM 1 SOLUTIONS. Midterm Exam. ECE 741 Advanced Computer Architecture, Spring Instructor: Onur Mutlu

Improving Memory Access The Cache and Virtual Memory

And in Review! ! Locality of reference is a Big Idea! 3. Load Word from 0x !

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

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

EECS151/251A Spring 2018 Digital Design and Integrated Circuits. Instructors: John Wawrzynek and Nick Weaver. Lecture 19: Caches EE141

Computer Architecture and Engineering. CS152 Quiz #2. March 3rd, Professor Krste Asanovic. Name:

www-inst.eecs.berkeley.edu/~cs61c/

CS 450 Exam 2 Mon. 11/7/2016

CS 61C: Great Ideas in Computer Architecture. Virtual Memory

ADDRESS TRANSLATION AND TLB

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

V. Primary & Secondary Memory!

CPSC 330 Computer Organization

UCB CS61C : Machine Structures

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Chapter 7 Large and Fast: Exploiting Memory Hierarchy. Memory Hierarchy. Locality. Memories: Review

ADDRESS TRANSLATION AND TLB

Q3: Block Replacement. Replacement Algorithms. ECE473 Computer Architecture and Organization. Memory Hierarchy: Set Associative Cache

Main Memory Supporting Caches

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

EEC 170 Computer Architecture Fall Cache Introduction Review. Review: The Memory Hierarchy. The Memory Hierarchy: Why Does it Work?

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

ELE 375 / COS 471 Final Exam Fall, 2001 Prof. Martonosi

10/16/17. Outline. Outline. Typical Memory Hierarchy. Adding Cache to Computer. Key Cache Concepts

NAME: Problem Points Score. 7 (bonus) 15. Total

data block 0, word 0 block 0, word 1 block 1, word 0 block 1, word 1 block 2, word 0 block 2, word 1 block 3, word 0 block 3, word 1 Word index cache

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

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

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

UC Berkeley CS61C : Machine Structures

ISA Instruction Operation

COSC 3406: COMPUTER ORGANIZATION

CSE 2021: Computer Organization

CIS Operating Systems Memory Management Cache. Professor Qiang Zeng Fall 2015

Intro to Computer Architecture, Spring 2012 Midterm Exam II. Name:

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY

Block Size Tradeoff (1/3) Benefits of Larger Block Size. Lecture #22 Caches II Block Size Tradeoff (3/3) Block Size Tradeoff (2/3)

Lecture 33 Caches III What to do on a write hit? Block Size Tradeoff (1/3) Benefits of Larger Block Size

Virtual Memory, Address Translation

CS/CoE 1541 Exam 2 (Spring 2019).

CSE 2021: Computer Organization

Solutions for Chapter 7 Exercises

CIS Operating Systems Memory Management Cache. Professor Qiang Zeng Fall 2017

CS 537 Lecture 6 Fast Translation - TLBs

Tutorial 11. Final Exam Review

Translation Buffers (TLB s)

UCB CS61C : Machine Structures

The Processor Memory Hierarchy

Question Points Score Total 100

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory Review. Page faults. Paging system summary (so far)

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

Memory Hierarchy Design (Appendix B and Chapter 2)

ECE331: Hardware Organization and Design

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Cache Optimization. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

SE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Page 1. Memory Hierarchies (Part 2)

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

1" 0" d" c" b" a" ...! ! Benefits of Larger Block Size. " Very applicable with Stored-Program Concept " Works well for sequential array accesses

CHAPTER 4 MEMORY HIERARCHIES TYPICAL MEMORY HIERARCHY TYPICAL MEMORY HIERARCHY: THE PYRAMID CACHE PERFORMANCE MEMORY HIERARCHIES CACHE DESIGN

Cache Memory and Performance

MEMORY HIERARCHY BASICS. B649 Parallel Architectures and Programming

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture

Virtual Memory, Address Translation

Final Exam Fall 2007

CIS Operating Systems Memory Management Cache and Demand Paging. Professor Qiang Zeng Spring 2018

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit.

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

CS 450 Exam 2 Mon. 4/11/2016

Transcription:

CS 351 Exam 3, Fall 2013 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 in your answers in order to maximize your partial credit. However, you will be penalized for giving extraneous incorrect information. You may use the backs of these pages if you need more space, but make it clear where to find your answer to each question. Unless otherwise specified, you do not need to work out the arithmetic on math problems. Just do enough algebra to set up an answer of the form: Answer = [arithmetic expression] [units] Grade (instructor use only) Your Score Max Score Problem 1: Short answer 20 Problem 2: AMAT 15 Problem 3: Cache sizing 20 Problem 4: Cache mappings 15 Problem 5: Page table sizing 15 Problem 6: Virtual memory mappings 15 Total 100

Problem 1: Short-answer (20 points) a) [1 point + 1 bonus point if everyone gets it right] How many bits are in a byte? b) [3 points] Which can store more data, a systemʼs L2 cache or its main memory? Explain. c) [4 points] What write policy (write-back or write-through) is used for pages in physical memory, and why? d) [4 points] What kind of access (e.g. write/read, hit/miss) triggers a write to memory in a write-back cache? a write-through cache? Be as specific as possible. Page 2 of 11

e) [4 points] The x86 MOV instruction can be used to copy the value of the page table base register into a general-purpose register. Assuming that this instruction does not trap when executed in user mode, is it safe to let the guest OS directly execute it? Specifically, why or why not? f) [4 points] What does physical memory refer to in a virtualized environment? Is this different from physical memory in a non-virtualized environment? Page 3 of 11

Problem 2: Average memory access time (15 points) Assume that a program is executed on a system with the following memory hierarchy and hit rates. L1 cache: 95% hit rate, 1-cycle access time L2 cache: 90% hit rate, 5-cycle access time Main memory: 100% hit rate, 80-cycle access time A write buffer eliminates all of the stalls from writing back to memory. The program has the following characteristics: 25% of instructions are loads 10% of instructions are stores A. [5 points] What is the average memory access time of this program? B. [5 points] The base CPI of this hardware is 1. This number assumes that all memory accesses are L1 hits. Given the actual memory access patterns above, what is the true CPI for this program on this hardware? Page 4 of 11

C. [5 points] Consider the L2 hit rate. Instead of fixing it at 90%, letʼs call it H. So now we have: L1 cache: 95% hit rate, 1-cycle access time L2 cache: H hit rate, 5-cycle access time Main memory: 100% hit rate, 80-cycle access time A write buffer eliminates all of the stalls from writing back to memory. If H is 0%, itʼs easy to show that having this L2 cache is worse than not having one at all. If H is 100%, then having an L2 cache is extremely helpful. Show an expression that is true if and only if having an L2 cache with hit rate H improves the average memory access time for this system. (For example: 0.4H > 0.2 + 0.1/5) Page 5 of 11

Problem 3: Cache sizing (20 points) A byte-addressable machine with 64-bit memory addresses has a cache with the following properties: 16-byte cache blocks 16KB of data in the cache 2-way set-associative Write-back A. [3 points] How many cache blocks are there? B. [3 points] How many cache sets are there? C. [3 points] Given a memory address, how many cache blocks could it possibly map to? D. [3 points] How many memory addresses could possibly map to a given byte in the cache? Page 6 of 11

E. [5 points] How many bits of metadata are required for each cache block? Explain what each is for. F. [3 points] How many bits are needed to implement the cache (data and metadata)? Page 7 of 11

Problem 4: Cache mappings (15 points) For each of the following caches, show the cache contents after memory references to addresses 01110110 and 10001010. Include any necessary metadata. The main memory has 8-bit addresses. Be sure you show at LEAST the valid bit and tag of each block. A. [5 points] The cache has: 8B of data (total) 1-byte blocks Direct mapping Page 8 of 11

B. [5 points] The cache has: 8B of data (total) 4-byte blocks Direct mapping C. [5 points] Which of these two caches would perform better for a program with lots of spatial locality but low temporal locality? Explain. Page 9 of 11

Problem 5: Page table sizing (15 points) A byte-addressable memory system has 64-bit virtual addresses and 33-bit physical addresses, with 16 KB pages. A. How many virtual pages does each process have? B. How many physical pages does the system have? C. If we were to use flat, per-process page tables, how many page table entries would each process need to store? D. How many bits (data and metadata) are needed at minimum for each page table entry? E. How many bits (data and metadata) are needed at minimum for each TLB entry? Assume that the TLB gets flushed on a context switch. Page 10 of 11

Problem 6: Virtual memory mapping (15 points) A certain system has an unrealistically tiny physical memory with 8 pages. The OS has mapped these pages to processes as follows: Physical page 0 is reserved for the OS Physical pages 1, 2, 4, and 6 are used by Process A Physical pages 3, 5 and 7 are used by Process B A. [8 points] If processes have 4 virtual pages, show plausible page tables for processes A and B. B. [7 points] If the page size is 32B, how would you translate a request from Process A for virtual address 1001010? Explain. What about Process B? Page 11 of 11