Answer:
Offset bits: 3-bits
Set number of cache: 12-bits
Tag bits: 7-bits
22-bit physical address
Explanation:
Since the system is 32K so,
=2⁵.2¹⁰
=2¹⁵
As we know that it is 8-way set associative so,
=2¹⁵/2³
=2¹⁵⁻³
=2¹²
2¹² are cache blocks
22-bit physical address
Off-set bits are 3 as they are calulated from 8-way set associative information.
Set number of cache : 12-bits
For tag-bits:
Add off-set bits and cache bits and subtract from the total bits of physical address.
=22 - (12+3)
=22 - 15
=7
Answer:
Explanation:
A relational database is designed to enforce the uniqueness of primary keys by allowing only one row with a given primary key value in a table. A foreign key is a column or a set of columns in a table whose values correspond to the values of the primary key in another table.
Answer:
C++ code explained below
Explanation:
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
int FiboNR(int n)
{
int max=n+1;
int F[max];
F[0]=0;F[1]=1;
for(int i=2;i<=n;i++)
{
F[i]=F[i-1]+F[i-2];
}
return (F[n]);
}
int FiboR(int n)
{
if(n==0||n==1)
return n;
else
return (FiboR(n-1)+FiboR(n-2));
}
int main()
{
long long int i,f;
double t1,t2;
int n[]={1,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75};
cout<<"Fibonacci time analysis ( recursive vs. non-recursive "<<endl;
cout<<"Integer FiboR(seconds) FiboNR(seconds) Fibo-value"<<endl;
for(i=0;i<16;i++)
{
clock_t begin = clock();
f=FiboR(n[i]);
clock_t end = clock();
t1=double(end-begin); // elapsed time in milli secons
begin = clock();
f=FiboNR(n[i]);
end = clock();
t2=double(end-begin);
cout<<n[i]<<" "<<t1*1.0/CLOCKS_PER_SEC <<" "<<t2*1.0/CLOCKS_PER_SEC <<" "<<f<<endl; //elapsed time in seconds
}
return 0;
}