1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
azamat
3 years ago
12

How many total bits are required for a direct mapped cache with 16 KB of data and 4 word blocks Assuming a 32 bit address

Computers and Technology
1 answer:
Wittaler [7]3 years ago
8 0

Answer:

147 Kibibits or 18.4 KiB

Explanation:

Given that KiB = kibibyte = 2^10 bytes

Hence 16 KiB is 16384 (2^14) bytes = 4096 (2^12) words.

Therefore, with a block size of 4 words (2^2), we have 1024 (2^10) blocks

Given 32 bits address

We have 4 x 32 = 128 bits of data

The total bits is calculated as (number of blocks) * (data (32 * 4) + tag and validation bits)

Where index part = 10 bits, Offset = 2 bits

2^10 * (4 x 32 + (32–10–2 - 2) + 1)

=> 2^10 * 147 = 147 kibibits

=> 18.4 KiB

You might be interested in
Hyper-v enables windows server 2008 to operate as a _____ server.
lianna [129]
 Answer: Virtual                                                                                                     <span>Hyper-V enables Windows Server 2008 to operate as a virtual server.</span>
3 0
3 years ago
What is the most significant result based on the development of windmills and water wheels?
daser333 [38]
Power both wind mills and water wheels produced power which was used for textile factories ect
6 0
3 years ago
What should an administrator use to more easily assign database access permissions to multiple users?
Kruka [31]

Answer:

to allow administrators to assign rights and permissions to multiple users

Explanation:

8 0
3 years ago
Each of the following code fragments contains a number of security vulnerabilities. For each fragment, identify these security v
Trava [24]

Answer:

Check the explanation

Explanation:

a)

1) int main(int argc, char *argv){

argv has always been an array of pointer whereby each and every element points to the command line argument that is passed to the program.

int main(int argc, char *argv[]) {

2) passwords = fopen(filePath, "r");

argv[0] always holds the name of the program currently running i.e. itself

So you shouldn't even try not to open a executable file for reading. since doing this will not give error but you won't be able to read the file as it is a binary file.

it is god to always check whether the file was opened successfully or not after opening the file. If file was not opened successfully fopen will return NULL.

passwords = fopen(filePath, "r");

if(passwords == NULL)

{

printf(“\n Unable to open file”);

return -1;

}

3) execl(shellPath, "shell", NULL);

Before making a call to execl you should close the open file

close(passwords);

b)

1) char itemID[9];

After creating a char array one should always initialize the array as it may contain some garbage value.

char itemID[9] = “”;

2) scanf("%d", &unitsOrdered);

Since unitOrdered represents the quantity, it should always be non zero and non negative

c)

1) char fullName[MAX_LEN];

MAX_LEN should not be zero or negative as it used to define the size.

If ( MAX_LEN <=0 )

{

return error;

}

else

{

char fullName[MAX_LEN]

}

2) strcpy(fullName, firstName);

Before using the string functions you're expected to always make sure that the pointer that you are passing to the functions should not be NULL i.e. the pointers should always pass to certain memory location.

if (firstName && lastName)

{

strcpy(fullName, firstName);

strcat(fullName, " ");

strcat(fullName, lastName);

return fullName;

}

else

{

return error;

}

5 0
3 years ago
Give an example of an operationin a programming languagethat is implemented.
Shtirlitz [24]

answer:  

(i) #include <iostream>  

using namespace std;  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

if(n1>n2)//finding maximum between n1 and n2 in the program directly.  

max=n1;  

else  

max=n2;  

cout<<max;  

return 0;  

}  

(ii)  

#include <iostream>  

using namespace std;  

int maximum(int n1 ,int n2)  

{  

if(n1>n2)//finding maximum between n1 and n2 using function.  

return n1;  

else  

return n2;  

}  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

max=maximum(n1,n2);  

cout<<max;  

return 0;  

}  

(iii)  

#include <iostream>  

using namespace std;  

inline int maximum(int n1 ,int n2)  

{  

return (n1>n2)? n1:n2;  

}  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

max=maximum(n1,n2);//Finding maximum using inline function.  

cout<<max;  

return 0;  

}  

Output:-  

54 78  

78  

all three codes give the same output.  

Explanation:  

In part (i) I have done the operation in the main function directly.  

In part(ii) I have used function to calculate the maximum.  

In part(iii) I have used inline function to calculate maximum.  

4 0
3 years ago
Other questions:
  • Which tool relies on the logged on user's certificate details to encrypt or decrypt files and folders? powershell bitlocker encr
    12·1 answer
  • You are replacing the toner cartridge for an old laser printer. You are concerned that several internal components are reaching
    8·1 answer
  • If the number 30 is in a cell, what number will be displayed after you format the cell in percent format? 30% 3000% 300% .003%
    15·1 answer
  • Learning in a digital environment is also called learning.
    6·2 answers
  • I like potatoes do you like potatoes
    15·2 answers
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
  • Inputting a range of numbers comprising a batch and then inputting each serially numbered document is characteristic of the cont
    11·1 answer
  • What is the georgia connections academy administrative password? i want to install something.
    5·1 answer
  • How do you make someone the Brainliest?
    13·1 answer
  • 3. Output the following:<br>a.<br>21%4​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!