A)
Given Information:
The given code is:
// define structure
square point_color
{
// variable declaration
int c;
int m;
int y;
int k;
};
// declare structure array
struct point_color square[16][16];
int i,j;
// traverse through the array
for(i=0;i<16;i++)
{
//traverse through elements
for(j=0;j<16;j++)
{
//square all elements of the 2-D array
square[i][j].c=0;
square[i][j].m=0;
square[i][j].y=1;
square[i][j].k=0;
}
}
Write hit:
If the information in the cache is reserved or in dirty state then the cache line is updated in its place without updating memory set from its state to dirty.
- If the state of information is in valid state then it executes a write-through operation.
- It then updates the memory and block and changes its blocked state to reserved state.
Write miss:
A partial cache line write is handed as a read miss followed by a write hit. All the other caches are left in the invalid state and the reserved state is occupied by the current state.
B)
Given Information:
The given code is:
// define structure
square point_color
{
// variable declaration
int c;
int m;
int y;
int k;
};
// declare structure array
struct point_color square[16][16];
int i,j;
// traverse through the array
for(i=0;i<16;i++)
{
//traverse through elements
for(j=0;j<16;j++)
{
//square all elements of the 2-D array
square[i][j].c=0;
square[i][j].m=0;
square[i][j].y=1;
square[i][j].k=0;
}
}
Write hit:
If the information in the cache is reserved or in dirty state then the cache line is updated in its place without updating memory set from its state to dirty.
- If the state of information is in valid state then it executes a write-through operation.
- It then updates the memory and block and changes its blocked state to reserved state.
Write miss:
A partial cache line write is handed as a read miss followed by a write hit. All the other caches are left in the invalid state and the reserved state is occupied by the current state.
C)
Given Information:
The given code is:
//define structure
square point_color
{
// variable declaration
int c;
int m;
int y;
int k;
};
// declare structure array
struct point_color square[16][16];
int i,j;
// traverse through the array
for(i=0;i<16;i++)
{
//traverse through elements
for(j=0;j<16;j++)
{
//square all elements of the 2-D array
square[i][j].c=0;
square[i][j].m=0;
square[i][j].y=1;
square[i][j].k=0;
}
}
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
- A cache is set up with a block size of 32 words. There are 64 blocks in cache and set up to be 4-way set associative. You have byte address 0x8923. Show the word address, block address, tag, and index Show each access being filled in with a note of hit or miss. You are given word address and the access are: 0xff, 0x08, 0x22, 0x00, 0x39, 0xF3, 0x07, 0xc0.arrow_forwardIn a computer with a 32-bit data-bus, how many 4-bit wide memory components are used? the answer to this part is 32/4 = 8 components (2-bit wide) I need the answer to part two, please If the size of each 4-bit memory component is 4 x n cells where n = 1G (i.e., 4 x n uniquely addressable locations-n: row, 4:2 column/width), what is the total capacity of the memory system? Show your answer in power of 2. (hint: 1000 ~ 210)arrow_forwardI have a little bit problem with my late quiz for computer architecture, I get the answer from my lecturer but I still don't feel fully understand, can I ask for some help: In a computer system, the memory has 32 blocks and the cache has 8 blocks. Assume there is only one word per block with 4 bytes in one word. The reference sequence in terms of word location is 0, 2, 4, 10, 5, 12, 8, 18, 13. If the cache is direct-mapped, how many misses do we have if the cache is initially empty? Can you give the hit or miss for each reference?arrow_forward
- Below is a list of 32-bit memory address references, given as memory addresses. 12, 720, 172, 8, 764, 352, 760, 56, 724, 176, 744You would like to access a cache with the given memory addresses. The size of cache is 23 = 8-blocks. Your task is to: (1) find out the binary address, (2) fill out the tag and index for each memory address and (3) indicate whether the access is hit or miss in the following table:arrow_forwardQ1- Write a program in assembly language for the 8085 microprocessor to send 10 bytes of data located at the memory address (3000H to 3009H) using SOD at a baud rate of 1200. Information: The 8085 processor operates at a frequency of 3.072 MHz. When sending each of the required bytes, you must adhere to the following: The two high bits of the start bits must be sent, after that the data bits are sent, after that the low bit of the stop bit is sent. The following flowchart will help you, but you should notice that this flowchart deals with one byte, and you are required to deal with 10 bytes. The solution must be integrated and include the calculation of the baudrate delay time Transmit No Set up Character Bit Counter Send Start Bit Wait Bit Time Get Character in Accumulator Output Bit Using Do Wait Bit Time Rotate Next Bit in Do Decrement Bit Counter Is It Last Bit? Yes Add Parity if Necessary • Send Two Stop Bits Return (a)arrow_forwardHD Video C x 3ll al N X Ue G X ogle agi X Microsoft moodle.nct.edu.om/pluginfile.php/67858/mod_resource 100% 212 2. A singer voice is sampled for 4 second by an 8-bit ADC at a sampling frequency of 10 kHz. The samples are stored on a memory chip. What is the minimum memory size both in [bits and bytes] required to store all the samples? i. How long the signal must be sampled to store the samples in 100Mbytes CD- ROM iii. What should be the highest frequency component of the signal? iv.If sampling frequency is doubled then how long the signal must be sampled to store samples in 100Mbytes CD-ROM 14 Marksarrow_forward
- A 32-bit computer has a memory of 256 KB and a cache line size of 64 bytes. The memory cache access time is 5ns. This cache is 4-way associative and use LRU as a replacement algorithm. a) What is the number of lines and sets of this memory cache? b) What is the block size transferred between the cache memory and the main memory? c) If the time to transfer a line to cache memory is 200 ns, what is the hit ratio needed to obtain an average access time of 20 ns?arrow_forwardHi, professor! I'm not sure about the following question. Consider a cache memory that provides three hundred 16-byte blocks. Now consider that you are processing all the data in a two-dimensional array of, say, four hundred rows by four hundred columns, using a pair of nested loops. Assume that the program stores the array column by column. You can write your program to nest the loops in either direction, that is, process row by row or column by column. Explain which way you would choose to process the data. What is the advantage? Conversely, what is the disadvantage of processing the data the other way? What effect does choosing the incorrect way have on system performance?arrow_forwardGiven that a 4-way set associative cache memory has 64 KB data and each block contains 32 bytes. The main memory capacity is 4 GB. a. Find the number of bits for the main memory address. ANSWER: bits b. How many blocks are there in a set? ANSWER: blocks c. How many sets the cache has? ANSWER: d. The main memory address format is => | Tag: e. Which set will be mapped by the main memory address 458195h. ANSWER: sets bits | Set: bits | Word: bits | (in decimal)arrow_forward
- Suppose a byte-addressable computer using set-associative cache has 216 bytes of main memory and a cache of 32 blocks, and each cache block contains 8 bytes.Q.) If this cache is 2-way set associative, what is the format of a memory address as seen by the cache; that is, what are the sizes of the tag, set, and offset fields?arrow_forwardPlease let me know if these are true or false! In multiprocessors with a shared physical main memory, an access to a word of main memory always takes about the same amount of time no matter which word is being accessed and by which processor: T/F? When reading data from a magnetic disk, the rotational latency increases linearly with the size of the request: T/F? SSD is faster to access than magnetic disk, but slower than DRAM main memory: T/F? The primary purpose of RAID is for data backups: T/F? Typically, data parallelism offers greater opportunities for achieving highly-parallel execution than does functional parallelism: T/F? In MIPS systems, one way to implement locks is with the MIPS test-and-set machine language instruction: T/F?arrow_forwardSuppose a computer using fully associative cache has 224224 words of main memory and a cache of 512 blocks, where each cache block contains 16 words. a. How many blocks of main memory are there? b. What is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag and offset fields? c. To which cache block will the memory reference 1604181616041816 map? Also... Suppose a computer using set associative cache has 216216 words of main memory and a cache of 128 blocks, and each cache block contains 8 words. a. If this cache is 2-way set associative, what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, set, and offset fields? b. If this cache is 4-way set associative, what is the format of a memory address as seen by the cache?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education