ECE331 Homework 4. Due Monday, August 13, 2018 (via Moodle)

Similar documents
CS 433 Homework 5. Assigned on 11/7/2017 Due in class on 11/30/2017

6.004 Tutorial Problems L14 Cache Implementation

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

ECE 30 Introduction to Computer Engineering

Project: Visual Cache Simulator Input: Real Addresses Outputs: 1. Number of Hits 2. Number of Misses 3. Hit Ratio 4. Visual Representation of Cache

Virtual Memory Worksheet

CAM Content Addressable Memory. For TAG look-up in a Fully-Associative Cache

ECE331: Hardware Organization and Design

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

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

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

Virtual Memory Overview

Write only as much as necessary. Be brief!

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

6.004 Tutorial Problems L20 Virtual Memory

Binghamton University. CS-220 Spring Cached Memory. Computer Systems Chapter

Exercises 6 - Virtual vs. Physical Memory, Cache

EE 3613: Computer Organization Homework #2

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Caches III. CSE 351 Autumn Instructor: Justin Hsia

What is Cache Memory? EE 352 Unit 11. Motivation for Cache Memory. Memory Hierarchy. Cache Definitions Cache Address Mapping Cache Performance

CSE 141 Spring 2016 Homework 5 PID: Name: 1. Consider the following matrix transpose code int i, j,k; double *A, *B, *C; A = (double

Homework 3 (r1.1) Due: Part (A) -- Apr 29, 2016, 11:55pm Part (B) -- Apr 29, 2016, 11:55pm Part (C) -- Apr 29, 2016, 11:55pm

6.004 Tutorial Problems L14 Cache Implementation

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

ICS 51: Introduction to Computer Organization

University of Toronto Faculty of Applied Science and Engineering

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

ECE473 Computer Architecture and Organization. Memory Hierarchy: Set Associative Cache

CPE 631 Advanced Computer Systems Architecture: Homework #2

Prerequisite Quiz September 3, 2003 CS252 Computer Architecture and Engineering

ECE331: Hardware Organization and Design

Problem 1 (logic design)

Second Midterm Exam March 21, 2017 CS162 Operating Systems

ECE232: Hardware Organization and Design

ASSIGNMENT 9: CACHE MEMORY NAME. Assume we are building a cache for a memory system that s just 16 bytes big 4 address bits.

Question F5: Caching [10 pts]

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

1 /20 2 /18 3 /20 4 /18 5 /24

Structure of Computer Systems

CSE351: Memory, Data, & Addressing I

Review: Computer Organization

Question 6: Cache in While You Can (17 points, 26 Minutes)

Memory Hierarchy. Mehran Rezaei

SLCD Technical Note TN-100. Programming the SLCD bitmap / macro flash memory in an embedded system

ECE232: Hardware Organization and Design

CS 351 Exam 2 Mon. 11/2/2015

Midterm #2 Solutions April 23, 1997

CS350 Midterm Spring 2012 Page 1

Memory Hierarchy & Caches Worksheet

CS152 Computer Architecture and Engineering

ECE260: Fundamentals of Computer Engineering

ECE 3056: Architecture, Concurrency, and Energy of Computation. Sample Problem Set: Memory Systems

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.

ECE 411 Exam 1 Practice Problems

Last class. Caches. Direct mapped

and data combined) is equal to 7% of the number of instructions. Miss Rate with Second- Level Cache, Direct- Mapped Speed

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

indicates problems that have been selected for discussion in section, time permitting.

复旦大学软件学院 2017~2018 学年第一学期期中考试试卷

Write only as much as necessary. Be brief!

CSCI 2212: Intermediate Programming / C Chapter 15

Computer System Architecture Midterm Examination Spring 2002

Computer Architecture: Optional Homework Set

UW CSE 351, Winter 2013 Final Exam

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

MIPS) ( MUX

CS 4400 Fall 2018 Midterm Exam 2 Practice (Version 2)

Department of Electrical Engineering and Computer Sciences Fall 2016 Instructors: Randy Katz, Bernhard Boser

Computer Architecture EE 4720 Final Examination

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

Changelog. Virtual Memory (2) exercise: 64-bit system. exercise: 64-bit system

c. What are the machine cycle times (in nanoseconds) of the non-pipelined and the pipelined implementations?

Full Name: CS Account:

UW CSE 351, Summer 2013 Final Exam

We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -

Slide Set 9. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Cache Memory Mapping Techniques. Continue to read pp

Direct Mapped Cache Hardware. Direct Mapped Cache. Direct Mapped Cache Performance. Direct Mapped Cache Performance. Miss Rate = 3/15 = 20%

Caches II. CSE 351 Spring Instructor: Ruth Anderson

ECE Lab 8. Logic Design for a Direct-Mapped Cache. To understand the function and design of a direct-mapped memory cache.

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Next Generation Intelligent LCDs

1 /15 2 /20 3 /20 4 /25 5 /20

CS 251, Winter 2019, Assignment % of course mark

Virtual Memory 1. Virtual Memory

Problem 9. VM address translation. (9 points): The following problem concerns the way virtual addresses are translated into physical addresses.

CS 251, Winter 2018, Assignment % of course mark

Memory, Data, & Addressing I

Virtual Memory 1. Virtual Memory

ECE 30, Lab #8 Spring 2014

CPSC 3300 Spring 2016 Final Exam Version A No Calculators

Cache and Virtual Memory Simulations

Associative. Associative. Number of Bits Group or Set Tag

ISA Instruction Operation

Computer Organization and Architecture (CSCI-365) Sample Final Exam

Page 1. Multilevel Memories (Improving performance using a little cash )

Part I: Pen & Paper Exercises, Cache

Translation Buffers (TLB s)

Virtual Memory (2) 1

Transcription:

ECE331 Homework 4 Due Monday, August 13, 2018 (via Moodle) 1. Below is a list of 32-bit memory address references, given as hexadecimal byte addresses. The memory accesses are all reads and they occur in the order given 0xA00, 0x864, 0x50234, 0xA00, 0xF0C, 0x50234, 0x63C, 0x128, 0x3C4, 0x34B4, 0x50234 a. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 16 one-word blocks. Also list if each reference is a hit or miss, assuming the cache is initially empty b. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 8 two-word blocks. Also list if each reference is a hit or miss, assuming the cache is initially empty c. For each of these references, identify the binary address, the tag, and the index given a two-way set-associative cache with 16 one-word blocks (Hint: there are 8 sets). Also list if each reference is a hit or miss, assuming the cache is initially empty. Use a LRU replacement strategy. d. Calculate the total number of bits required for the cache listed in (c). Include tag storage, dirty bit storage, valid bit storage, and the data storage

2. Given the following assumptions, fill out the table of data cache content on the next two pages based on memory access sequence shown in the following table. Cache is initially empty The data cache is a direct mapped cache The width of memory address is 8-bit and it is a byte address The cache block size is 4 bytes Write through strategy is used in this cache Memory Accesses # Access Size Access Type Byte Address in Binary 1 Byte Read 1000 0101 2 Byte Read 1101 0111 3 Byte Read 0011 0110 4 Word Write 1010 0100 5 Byte Read 1000 0111 6 Word Write 0101 0100 7 Word Read 0001 1100 8 Byte Read 0100 0101 9 Byte Read 1010 0110 10 Byte Read 1010 1101

Data Cache Content Note: a.) For locations never accessed, leave the corresponding tag and data boxes blank. b.) Indicate the valid bit for each cache block. Use V for valid and I for invalid. c.) The block data should be given in the format of M [block address]. d.) Mark each access in order for up to 4 accesses. The first access should be the first one listed. Index V Tag Data 0000 0001 0010 0011 0100 0101 0110 0111

1000 1001 1010 1011 1100 1101 1110 1111 (b) What is the miss rate of the cache for the memory accesses in question (a)?

3. The following C program is run on a machine with a data cache that has two-word (8 bytes) blocks and the data capacity of the data cache is 128 bytes. Assume that only references to the array incur memory accesses and the cache is empty at the very beginning. Hint: a variable with int type contains four bytes and the MIPs uses byte addresses int i, c, array[128]; c = 0; for (i=0; i<128; i++) { c = c+array[i]; } (a) How many cache lines are there if the cache is direct mapped? Show your work. (b) How many sets are there if the cache is two-way associative? Which address bits are used for indexing the set in a 32-bit address? Please present the result in Addr[x:y] format (for example, Addr[8:5] means that bit 8 to bit 5 in the address are used for indexing). Show your work. (c) If a direct mapped cache is used, what is the expected miss rate after program execution. Show your work.

(d) If a two-way associative cache is used, what is the expected miss rate after program execution. Show your work. (e) If a four-way associative cache is used, what is the expected miss rate after execution the program. Show your work. 4. The diagram below illustrates a blocked, direct-mapped cache for 32-bit data words with 32-bit byte addresses

(a) What is the maximum number of words of data from the main memory that can be stored in the cache at any one time? (b) How many bits of the address are used to select which line of the cache is accessed? (c) How many bits wide is the tag field?

(d) Briefly explain the purpose of the one-bit V field associated with each cache line (e) Assume that location 0xCF120 was present in the cache. Using the row and column labels from the figure, in what location(s) could we find the data from that location? What would the value of the tag field have to be for the cache row in which the data appears? (f) Can data from location 0xF6768 and 0xF67F8 be present in the cache at the same time? What about the data from locations 0xB20738 and 0x2034? Explain? (g) When an access causes a cache miss, how many words need to be fetched from memory to fill the appropriate cache location?