Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092997
Author: Bryant
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 6.41HW

You are writing a new 3D game that you hope will earn you fame and fortune. You are currently working on a function to blank the screen buffer before drawing the next frame. The screen you are working with is a 640 x 480 array of pixels. The machine you are working on has a 64 KB direct-mapped cache with 4-byte lines The C structures you are using are as follows:

Chapter 6, Problem 6.41HW, You are writing a new 3D game that you hope will earn you fame and fortune. You are currently , example  1

Assume the following:

- size of(char) = 1 and size of(int) = 4.

Homework Problem

- buffer begins at memory address 0.

- The cache is initially empty.

- The only memory accesses are to the entries of the array buffer. Variables l, j, cptr, and iptr are stored in registers.

What percentage of writes in the following code will miss in the cache?

Chapter 6, Problem 6.41HW, You are writing a new 3D game that you hope will earn you fame and fortune. You are currently , example  2

Blurred answer
Students have asked these similar questions
For the following loop, assume the array arr2[][] has never been referenced before in the code. Also assume that a cache line is 32 Bytes, and an int is 4 Bytes. 1. How many memory references are there?2. How many cache misses are there?
Create a program in C++ which simulates a direct cache. The memory array that contains the data to becached is byte addressable and can contain 256 single byte entries or lines. The cache has only 8 entriesor lines. The Data field in each line of the cache is 8 bits. Since the data stored in each line of the cache isonly 8 bits, there is no need for a line field. Only a tag field is needed which is log2(256) = 8 bits.The memory array can be filled with any values of your choice. The program should work by taking userinput of a memory address (index). This input represents the memory data that should be cached.Check the cache to see if the item is already cached. If it is not, your program should counta cache miss, and then replace the item currently in the cache with the data from the inputted address.Allow the user to input addresses (in a loop), until they so choose to end the program. The program should output the number of cache misses upon ending.
instruction is in the first picture please give me only implementation of int L1lookup(u_int32_t address) and int L2lookup(u_int32_t address) cacheSim.h #include<stdlib.h>#include<stdio.h>#define DRAM_SIZE 1048576typedef struct cb_struct {unsigned char data[16]; // One cache block is 16 bytes.u_int32_t tag;u_int32_t timeStamp; /// This is used to determine what to evict. You can update the timestamp using cycles.}cacheBlock;typedef struct access {int readWrite; // 0 for read, 1 for writeu_int32_t address;u_int32_t data; // If this is a read access, value here is 0}cacheAccess;// This is our dummy DRAM. You can initialize this in anyway you want to test.unsigned char * DRAM;cacheBlock L1_cache[2][2]; // Our 2-way, 64 byte cachecacheBlock L2_cache[4][4]; // Our 4-way, 256 byte cache// Trace points to a series of cache accesses.FILE *trace;long cycles;void init_DRAM();// This function print the content of the cache in the following format for an N-way cache with M Sets// Set 0…

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY