TAG SET WORD Main memory address =

Similar documents
Homework # 2. Solutions. 4.1 What are the differences among sequential access, direct access, and random access?

Outline. Cache Parameters. Lecture 5 Cache Operation

Chapter 4: Computer Codes

Board Notes on Virtual Memory

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory

Discussion Session 9. CS/ECE 552 Ramkumar Ravi 26 Mar 2012

Reduced echelon form: Add the following conditions to conditions 1, 2, and 3 above:

Introduction to RISC Processor. ni logic Pvt. Ltd., Pune

Base Conversion written by Cathy Saxton

The Big Picture. Cache Memory CSE Memory Hierarchy (1/3) Disk

Chapter 7 Memory Management

Computer Science 281 Binary and Hexadecimal Review

Socket Services Section 6-6

ERROR DETECTION AND CORRECTION

=

18-548/ Associativity 9/16/98. 7 Associativity / Memory System Architecture Philip Koopman September 16, 1998

Section 1.4 Place Value Systems of Numeration in Other Bases

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy

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

LOCKUP-FREE INSTRUCTION FETCH/PREFETCH CACHE ORGANIZATION

Bindel, Spring 2010 Applications of Parallel Computers (CS 5220) Week 1: Wednesday, Jan 27

Binary, Hexadecimal, Octal, and BCD Numbers

Lesson 3: Calculating Conditional Probabilities and Evaluating Independence Using Two-Way Tables

PARALLEL I/O FOR HIGH PERFORMANCE COMPUTING

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

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

A Predictive Model for Cache-Based Side Channels in Multicore and Multithreaded Microprocessors

Striped Set, Advantages and Disadvantages of Using RAID

Traditional IBM Mainframe Operating Principles

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Disks and RAID. Profs. Bracy and Van Renesse. based on slides by Prof. Sirer

Virtual vs Physical Addresses

Lecture 17: Virtual Memory II. Goals of virtual memory

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

6.033 Computer System Engineering

NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:

Vivek Sarkar Rice University. Work done at IBM during

Chapter 1 Computer System Overview

AMD Processor Recognition Application Note. For Processors Prior to AMD Family 0Fh Processors

Dynamic Slot Tutorial. Condor Project Computer Sciences Department University of Wisconsin-Madison

Introduction. What is RAID? The Array and RAID Controller Concept. Click here to print this article. Re-Printed From SLCentral

2011, The McGraw-Hill Companies, Inc. Chapter 3

1. How many unique network IDs are there in class A addresses? # of unique hosts?

COS 318: Operating Systems. Storage Devices. Kai Li and Andy Bavier Computer Science Department Princeton University

OpenSPARC T1 Processor

Chapter 2 Data Storage

Let s put together a Manual Processor

A PPENDIX G S IMPLIFIED DES

CS321. Introduction to Numerical Methods

The Hexadecimal Number System and Memory Addressing

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

CE363 Data Communications & Networking. Chapter 6 Network Layer: Logical Addressing

Record Storage and Primary File Organization

COS 318: Operating Systems. Storage Devices. Kai Li Computer Science Department Princeton University. (

Chapter 5 Instructor's Manual

(Refer Slide Time: 00:01:16 min)

Type 2 Tag Operation Specification. Technical Specification T2TOP 1.1 NFC Forum TM NFCForum-TS-Type-2-Tag_

GPU Hardware Performance. Fall 2015

MADR Algorithm to Recover Authenticity from Damage of the Important Data

361 Computer Architecture Lecture 14: Cache Memory

The finite field with 2 elements The simplest finite field is

Decimal form. Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw. Horizontal

Binary Adders: Half Adders and Full Adders

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

4 RISC versus CISC Architecture

Solutions to Math 51 First Exam January 29, 2015

Compiler I: Syntax Analysis Human Thought

The mathematics of RAID-6

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

M6800. Assembly Language Programming

Exercise 2 : checksums, RAID and erasure coding

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

Hardware Configuration Guide

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging

GSM/GPRS PHYSICAL LAYER ON SANDBLASTER DSP

CRI RAID. Robert A. Albers, Jr., Cray Research, Inc., Eagan, Minnesota 1 INTRODUCTION 4 HARDWARE RAID 2 RAID LEVELS 3 SOFTWARE RAID

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

High-speed image processing algorithms using MMX hardware

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Kenken For Teachers. Tom Davis June 27, Abstract

AsicBoost A Speedup for Bitcoin Mining

BPMN Business Process Modeling Notation

A Short Guide to Significant Figures

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

Definition of RAID Levels

CHAPTER 4 RAID. Section Goals. Upon completion of this section you should be able to:

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

Intel StrongARM SA-110 Microprocessor

Database Management Systems

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Memory Management CS 217. Two programs can t control all of memory simultaneously

Physical Data Organization

AN MIFARE DESFire as Type 4 Tag. Rev May Application note COMPANY PUBLIC. Document information.

Lecture 2. Binary and Hexadecimal Numbers

EE361: Digital Computer Organization Course Syllabus

Written examination in Computer Networks

SD Specifications Part A2 SD Host Controller Simplified Specification

Transcription:

The following questions is about chapter 4 "Cache Memory": 1. A set-associative cache consists of 64 lines, or slots, divided into four-line sets. Main memory contains 4K blocks of 128 words each. Show the format of main memory addresses. The cache is divided into 16 sets of 4 lines each. Therefore, 4 bits are needed to identify the set number. Main memory consists of 4K = 2 12 blocks. Therefore, the set plus tag lengths must be 12 bits and therefore the tag length is 8 bits. Each block contains 128 words. Therefore, 7 bits are needed to specify the word. Main memory address = TAG SET WORD 8 4 7 2. A two-way set-associative cache has lines of 16 bytes and a total size of 8 kbytes. The 64-Mbyte main memory is byte addressable. Show the format of main memory addresses. There are a total of 8 kbytes/16 bytes = 512 lines in the cache. Thus the cache consists of 256 sets of 2 lines each. Therefore 8 bits are needed to identify the set number. For the 64-Mbyte main memory, a 26- bit address is needed. Main memory consists of 64-Mbyte/16 bytes = 2 22 blocks. Therefore, the set plus tag lengths must be 22 bits, so the tag length is 14 bits and the word field length is 4 bits. Main memory address = TAG SET WORD 14 8 4 3. For the hexadecimal main memory addresses 111111, 666666,BBBBBB, show the following information, in hexadecimal format: a. Tag, Line, and Word values for a direct-mapped cache, using the format of Figure 4.10. b. Tag and Word values for an associative cache, using the format of Figure 4.12. c. Tag, Set, and Word values for a two-way set-associative cache, using the format of Figure 4.15. Address 111111 666666 BBBBBB a.tag/line/word 11 / 444 / 1 66 / 1999 / 2 BB / 2EEE / 3 b.tag /Word 44444 / 1 199999 / 2 2EEEEE / 3 c.tag/set/word 22 / 444 / 1 CC / 1999 / 2 177 / EEE / 3 4. Consider a machine with a byte addressable main memory of 2 16 bytes and block size of 8 bytes. Assume that a direct mapped cache consisting of 32 lines is used with this machine. a. How is a 16-bit memory address divided into tag, line number, and byte number? b. Into what line would bytes with each of the following addresses be stored? 0001 0001 0001 1011 1100 0011 0011 0100 1101 0000 0001 1101 1010 1010 1010 1010 c. Suppose the byte with address 0001 1010 0001 1010 is stored in the cache. What are the addresses of the other bytes stored along with it?

d. How many total bytes of memory can be stored in the cache? e. Why is the tag also stored in the cache? a. 8 leftmost bits = tag; 5 middle bits = line number; 3 rightmost bits = byte number. TAG LINE WORD 8 5 3 b. Line 3. Line 6. Line 3. Line 21. c. Bytes with addresses 0001 1010 0001 1000 through 0001 1010 0001 1111 are stored in the cache. d. 256 bytes. e. Because two items with two different memory addresses can be stored in the same place in the cache. The tag is used to distinguish between them. 5. Consider a memory system that uses a 32-bit address to address at the byte level, plus a cache that uses a 64-byte line size. a. Assume a direct mapped cache with a tag field in the address of 20 bits. Show the address format and determine the following parameters: number of addressable units, number of blocks in main memory, number of lines in cache, size of tag. b. Assume an associative cache. Show the address format and determine the following parameters: number of addressable units, number of blocks in main memory, number of lines in cache, size of tag. c. Assume a four-way set-associative cache with a tag field in the address of 9 bits. Show the address format and determine the following parameters: number of addressable units, number of blocks in main memory, number of lines in set, number of sets in cache, number of lines in cache, size of tag. a. Address format: Tag = 20 bits; Line = 6 bits; Word = 6 bits. Number of addressable units = 2 s+w = 2 32 bytes; number of blocks in main memory = 2 s = 2 26 ; Number of lines in cache 2 r = 2 6 = 64; size of tag = 20 bits. b. Address format: Tag = 26 bits; Word = 6 bits. Number of addressable units = 2 s+w = 2 32 bytes; number of blocks in main memory = 2 s = 2 26 ; Number of lines in cache = undetermined; size of tag = 26 bits. c. Address format: Tag = 9 bits; Set = 17 bits; Word = 6 bits. Number of addressable units = 2 s+w = 2 32 bytes; Number of blocks in main memory = 2 s = 2 26 ; Number of lines in set = k = 4; Number of sets in cache = 2 d = 2 17 ; Number of lines in cache = k 2 d =2 19 ; Size of tag = 9 bits.

6. Consider a computer with the following characteristics: total of 1Mbyte of main memory; word size of 1 byte; block size of 16 bytes; and cache size of 64 Kbytes. a. For the main memory addresses of F0010, 01234, and CABBE, give the corresponding tag, cache line address, and word offsets for a direct-mapped cache. b. Give any two main memory addresses with different tags that map to the same cache slot for a direct-mapped cache. c. For the main memory addresses of F0010 and CABBE, give the corresponding tag and offset values for a fully-associative cache. d. For the main memory addresses of F0010 and CABBE, give the corresponding tag, cache set, and offset values for a two-way set-associative cache. a. Because the block size is 16 bytes and the word size is 1 byte, this means there are 16 words per block. We will need 4 bits to indicate which word we want out of a block. Each cache line/slot matches a memory block. That means each cache line contains 16 bytes. If the cache is 64Kbytes then 64Kbytes/16 = 4096 cache lines. To address these 4096 cache lines, we need 12 bits (212 = 4096). Consequently, given a 20 bit (1 MByte) main memory address: Bits 0-3 indicate the word offset (4 bits). Bits 4-15 indicate the cache line/slot (12 bits). Bits 16-19 indicate the tag (remaining bits). F0010 = 1111 0000 0000 0001 0000 Word offset = 0000 = 0 line = 0000 0000 0001 = 001 Tag = 1111 = F 01234 = 0000 0001 0010 0011 0100 Word offset = 0100 = 4 Line = 0001 0010 0011 = 123 Tag = 0000 = 0 CABBE = 1100 1010 1011 1011 1110 Word offset = 1110 = E Line = 1010 1011 1011 = ABB Tag = 1100 = C b. We need to pick any address where the line is the same, but the tag (and optionally, the word offset) is different. Here are two examples where the line is 1111 1111 1111 Address 1: Word offset = 1111 Line = 1111 1111 1111 Tag = 0000 Address = 0FFFF Address 2: Word offset = 0001 Line = 1111 1111 1111 Tag = 0011 Address = 3FFF1

c. With a fully associative cache, the cache is split up into a TAG and a WORDOFFSET field. We no longer need to identify which line a memory block might map to, because a block can be in any line and we will search each cache line in parallel. The word-offset must be 4 bits to address each individual word in the 16-word block. This leaves 16 bits leftover for the tag. F0010 Word offset = 0h Tag = F001h CABBE Word offset = Eh Tag = CABBh d. As computed in part a, we have 4096 cache lines. If we implement a two way set associative cache, then it means that we put two cache lines into one set. Our cache now holds 4096/2 = 2048 sets, where each set has two lines. To address these 2048 sets we need 11 bits (211 = 2048). Once we address a set, we will simultaneously search both cache lines to see if one has a tag that matches the target. Our 20-bit address is now broken up as follows: Bits 0-3 indicate the word offset Bits 4-14 indicate the cache set Bits 15-20 indicate the tag F0010 = 1111 0000 0000 0001 0000 Word offset = 0000 = 0 Cache Set = 000 0000 0001 = 001 Tag = 11110 = 1 1110 = 1E CABBE = 1100 1010 1011 1011 1110 Word offset = 1110 = E Cache Set = 010 1011 1011 = 2BB Tag = 11001 = 1 1001 = 19 The following questions is about chapter 5 "Internal Memory": 1. For the Hamming code shown in Figure 5.10, show what happens when a check bit (of bit position 8) rather than a data bit is in error? The stored word is 001101001111, as shown in Figure 5.10. Now suppose that the only error is in C8, so that the fetched word is 001111001111. Then the received block results in the following table: Poistion 12 11 10 9 8 7 6 5 4 3 2 1 Bits D8 D7 D6 D5 C8 D4 D3 D2 C4 D1 C2 C1 Block 0 0 1 1 1 1 0 0 1 1 1 1 Codes 1010 1001 0111 0011 The check bit calculation after reception: Position Code Hamming 1111 10 1010 9 1001 7 0111 3 0011 XOR = syndrome 1000 The nonzero result detects and error and indicates that the error is in bit position 8, which is check bit C8.

2. Suppose an 8-bit data word stored in memory is 11000010. Using the Hamming algorithm, determine what check bits would be stored in memory with the data word. Show how you got your answer. Data bits with value 1 are in bit positions 12, 11, 5, 4, 2, and 1: Poistion 12 11 10 9 8 7 6 5 4 3 2 1 Bits D8 D7 D6 D5 C8 D4 D3 D2 C4 D1 C2 C1 Block 1 1 0 0 0 0 1 0 Codes 1100 1011 0101 The check bits are in bit numbers 8, 4, 2, and 1. Check bit 8 calculated by values in bit numbers: 12, 11, 10 and 9 Check bit 4 calculated by values in bit numbers: 12, 7, 6, and 5 Check bit 2 calculated by values in bit numbers: 11, 10, 7, 6 and 3 Check bit 1 calculated by values in bit numbers: 11, 9, 7, 5 and 3 Thus, the check bits are: 0 0 1 0 3. For the 8-bit word 00111001, the check bits stored with it would be 0111. Suppose when the word is read from memory, the check bits are calculated to be 1101.What is the data word that was read from memory? The Hamming Word initially calculated was: bit number: 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 1 0 1 0 0 1 1 1 1 Doing an exclusive-or of 0111 and 1101 yields 1010 indicating an error in bit 10 of the Hamming Word. Thus, the data word read from memory was 00011001. 4. How many check bits are needed if the Hamming error correction code is used to detect single bit errors in a 1024-bit data word? Need K check bits such that 2 K 1 >= 1024 + K. The minimum value of K that satisfies this condition is 11.