![EBK COMPUTER SYSTEMS](https://www.bartleby.com/isbn_cover_images/8220101459107/8220101459107_largeCoverImage.jpg)
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;
}
}
![Check Mark](/static/check-mark.png)
Want to see the full answer?
Check out a sample textbook solution![Blurred answer](/static/blurred-answer.jpg)
Chapter 6 Solutions
EBK COMPUTER SYSTEMS
- solve this questions for me .arrow_forwarda) first player is the minimizing player. What move should be chosen?b) What nodes would not need to be examined using the alpha-beta pruning procedure?arrow_forwardConsider the problem of finding a path in the grid shown below from the position S to theposition G. The agent can move on the grid horizontally and vertically, one square at atime (each step has a cost of one). No step may be made into a forbidden crossed area. Inthe case of ties, break it using up, left, right, and down.(a) Draw the search tree in a greedy search. Manhattan distance should be used as theheuristic function. That is, h(n) for any node n is the Manhattan distance from nto G. The Manhattan distance between two points is the distance in the x-directionplus the distance in the y-direction. It corresponds to the distance traveled along citystreets arranged in a grid. For example, the Manhattan distance between G and S is4. What is the path that is found by the greedy search?(b) Draw the search tree in an A∗search. Manhattan distance should be used as thearrow_forward
- whats for dinner? pleasearrow_forwardConsider the follow program that prints a page number on the left or right side of a page. Define and use a new function, isEven, that returns a Boolean to make the condition in the if statement easier to understand. ef main() : page = int(input("Enter page number: ")) if page % 2 == 0 : print(page) else : print("%60d" % page) main()arrow_forwardWhat is the correct python code for the function def countWords(string) that will return a count of all the words in the string string of workds that are separated by spaces.arrow_forward
- Consider the following program that counts the number of spaces in a user-supplied string. Modify the program to define and use a function, countSpaces, instead. def main() : userInput = input("Enter a string: ") spaces = 0 for char in userInput : if char == " " : spaces = spaces + 1 print(spaces) main()arrow_forwardWhat is the python code for the function def readFloat(prompt) that displays the prompt string, followed by a space, reads a floating-point number in, and returns it. Here is a typical usage: salary = readFloat("Please enter your salary:") percentageRaise = readFloat("What percentage raise would you like?")arrow_forwardassume python does not define count method that can be applied to a string to determine the number of occurances of a character within a string. Implement the function numChars that takes a string and a character as arguments and determined and returns how many occurances of the given character occur withing the given stringarrow_forward
- Consider the ER diagram of online sales system above. Based on the diagram answer the questions below, a) Based on the ER Diagram, determine the Foreign Key in the Product Table. Just mention the name of the attribute that could be the Foreign Key. b) Mention the relationship between the Order and Customer Entities. You can use the following: 1:1, 1:M, M:1, 0:1, 1:0, M:0, 0:M c) Is there a direct relationship that exists between Store and Customer entities? Answer Yes/No? d) Which of the 4 Entities mention in the diagram can have a recursive relationship? e) If a new entity Order_Details is introduced, will it be a strong entity or weak entity? If it is a weak entity, then mention its type?arrow_forwardNo aiarrow_forwardGiven the dependency diagram of attributes {C1,C2,C3,C4,C5) in a table shown in the following figure, (the primary key attributes are underlined)arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningPrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781305971776Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305971776/9781305971776_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305627482/9781305627482_smallCoverImage.gif)