Computers and Technology
Computers and Technology, 10.11.2019 02:31, Jxsolvez

Assume that the 100,000 element integer array that you allocated starts at address 0x5 in memory, the size of an integer is 4 bytes and the d-cache is initially empty. as you read the integers in the array one-by-one, starting at index 0, how many d-cache misses will you see for reading the first 40 integers when the cache block size is (to be answered without running pin): a) 4 bytes: b) 32 bytes: c) 64 bytes:

answer
Answers: 3

Similar questions

Предмет
Computers and Technology, 20.09.2019 22:20, titalili0204
Program description: in this recitation assignment, will write a complete c program that accepts as input any two integers from the user and swaps both integers using bitwise operators only without a third variable. early on in your programming career, you were told that you need to use a third variable in order to swap two variables, but in this assignment, you will accomplish this task without the extra variable. we will use the bitwise xor operator to swap the integers as the bitwise xor operator evaluates each bit of the result to 1 if the corresponding bits of the operands are different and 0 otherwise. programming with c and unix optional reference textbook by adam hoover to be . your ta or fellow students although not required, you may find chapter 2 on bits, bytes, and data types in the system for this recitation assignment, complete the following tasks. you may receive guidance frorm 1. declare an integer pointer and then request memory using malloc () for an array of 2 integers. this means that you should request memory for a size of 2 times the size of an integer and assign it to int_ptr. use man 3 malloc for details on this system call 2. if the malloc ) system call failed to return memory, print out a meaningful error message and terminate the program 3. prompt the user to enter the first integer using printf and then read in the user's response using scanf, storing the integer in the first element of the integer array allocated in step 1. 4. prompt the user to enter the second integer using printf and then read in the user's response using scanf, storing the integer in the second element of the integer array allocated in step 1. 5. now, print out the original values of both the integers input by the user. 6. this next step is where the swapping is done: a. use the bitwise xor operator on both the array elements and assign the result to the first element. b. use the bitwise xor operator on both the array elements and assign the result to the second element. c. use the bitwise xor operator on both the array elements and assign the result to the first element. 7. now, print out the swapped values of both the integers input by the user. 8. finally, release the allocated memory using free () sample output (user input shown in bold): $ . /a.out enter first integer: 571 enter second integer: 18 original values: 1st 571 2nd18 swapped values: 1st- 18 2nd571 $ . /a.out enter first integer: -4 enter second integer: 288 original values: 1st -4 2nd288 swapped values: 1st 288 2nd - -4
Answers: 1
Do you know the correct answer?
Assume that the 100,000 element integer array that you allocated starts at address 0x5 in memory, th...

Questions in other subjects:

Konu
Mathematics, 29.01.2020 20:03