Answer:
Using C++ to solve the problem as given below
Explanation:
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
string salsa_name[5]={"mild","medium","sweet","hot","zesty"};
int jar_sale[5]={0,0,0,0,0};
int i;
int total=0;
int high=0;
int high_index=0;
int low=0;
int low_index=0;
int temp=0;
for(i=0;i<5;i++)
{
while(temp<=0)
{
cout<<"enter the number of jars sold for "<<salsa_name[i]<<" ";
cin>>temp;
if(temp<=0)
cout<<"invalid data. please try again\n";
}
jar_sale[i]=temp;
temp=0;
}
cout<<"name\t jars sold\n";
cout<<"\n---------------------------\n";
for(i=0;i<5;i++)
{
cout<<" "<<salsa_name[i]<<"\t\t"<<jar_sale[i]<<"\n";
}
low=jar_sale[0];
for(i=0;i<5;i++)
{
total=total+jar_sale[i];
if(jar_sale[i] >= high)
{
high_index=i;
high=jar_sale[i];
}
if(jar_sale[i]<=low)
{
low_index=i;
low=jar_sale[i];
}
}
cout<<"\n total sale : "<<total;
cout<<"\n high seller : "<<salsa_name[high_index];
cout<<"\n low seller : "<<salsa_name[low_index];
}
Answer:
Network administrator use the open system interconnection model to isolate the network problem as, the network administrator can easily find the problem in the system.
Network administrator regularly depicts issues by the layer number and in many cases the network problem required the network administrator to isolate the issue in which layer the maximum number of issue occurred.
By using the OSI layer, we can easily add protocols to its higher to lower layers without any type of interruption.
Answer:
The answer is The Cache Sets (S) = 32, Tag bits (t)=24, Set index bits(s) = 5 and Block offset bits (b) = 3
Explanation:
Solution
Given Data:
Physical address = 32 bit (memory address)
Cache size = 1024 bytes
Block size = 8 bytes
Now
It is a 4 way set associative mapping, so the set size becomes 4 blocks.
Thus
Number of blocks = cache size/block size
=1024/8
=128
The number of blocks = 128
=2^7
The number of sets = No of blocks/set size
=128/4
= 32
Hence the number of sets = 32
←Block ←number→
Tag → Set number→Block offset
←32 bit→
Now, =
The block offset = Log₂ (block size)
=Log₂⁸ = Log₂^2^3 =3
Then
Set number pc nothing but set index number
Set number = Log₂ (sets) = log₂³² =5
The remaining bits are tag bits.
Thus
Tag bits = Memory -Address Bits- (Block offset bits + set number bits)
= 32 - (3+5)
=32-8
=24
So,
Tag bits = 24
Therefore
The Cache Sets = 32
Tag bits =24
Set index bits = 5
Block offset bits = 3
Note: ←32 bits→
Tag 24 → Set index 5→Block offset 3
Answer:
Sure, what do you need help with
Explanation: