Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

R 0x XXXXXXXXXX ------------------------------------------------------------------- Char op; Long long int add; While(inp.eof()) { Inp>>op>>hex>>add; // Simulation...

1 answer below »
R 0x XXXXXXXXXX
-------------------------------------------------------------------
Char op;
Long long int add;
While(inp.eof())
{
Inp
op
hex
add;
Simulation begins
Simulate_access(op,add);
simulation ends
}
Print out the statistics
-------------------------------------------------------------------------
Long long int tag_a
ay[num_sets][assoc];
Long long int lru_position[num_sets][assoc];
ool dirty[num_sets][assoc];
Void Simulate_access(char op, long long int add)
{
Int set = (add/64)%num_sets;
Long long int tag = add/64;
For(int i=0; i< assoc; i++)
{
If(tag==tag_a
ay[set][i])
{Hit++;
If(lru)
Update_lru(add);
Else
Update_fifo(add);
}
Else
{
Miss++;
}
}
}
Answered 4 days After Mar 25, 2023

Solution

Aditi answered on Mar 27 2023
41 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here