Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm sorry for the length of this one, but this is really hard for me to understand. My book doesn't do well in explaining this

I'm sorry for the length of this one, but this is really hard for me to understand. My book doesn't do well in explaining this either.

Assume that a system employs two caches (L1 and L2). Assume that accessing L1 requires 5 nsec (nanoseconds), accessing L2 requires 20 nsec (including the previous attempt with L1), and accessing memory requires 500 nsec (including previous attempts with L1 & L2). If the hit ratio for L1 is 90%, and the hit ratio for L2 is 50%, what is the average length (in nanoseconds) of a memory access?

Hint: Note exactly how I am describing the times.

The following information is pertinent for question #10.

Binary Operations

Though the text discusses shift operations, it does not really address binary operations. There are four major binary operations that I believe you should understand: NOT, AND, OR, and XOR (exclusive or).

Operations can be on single bits. When done with multiple bits, only the bits of the corresponding 'places' (2, 4, 8, ...) are compared.

The NOT operation is unary. It takes the value of a bit and flips (or negates) it. This is the one's complement.

NOT 1 is 0, NOT 0 is 1

NOT 01 is 10, NOT 01010111 is 10101000, NOT 11110000 is 00001111.

The AND, OR, and XOR operations are binary.

The AND operation is true (1) only if << both >> values are true (1).

0 AND 0 is 0, 1 AND 0 is 0, 0 AND 1 is 0, 1 AND 1 is 1

0011 AND 0101 is 0001

The OR operation is true (1) if << either >> value is true (1).

0 OR 0 is 0, 1 OR 0 is 1, 0 OR 1 is 1, 1 OR 1 is 1

0011 AND 0101 is 0111

The XOR (exclusive OR) is true if << one but not both >> values are true (1).

0 XOR 0 is 0, 1 XOR 0 is 1, 0 XOR 1 is 1, 1 XOR 1 is 0

0011 XOR 0101 is 0110.

Precedence refers to the order in which operations are executed. Operations in parentheses ('(' and ')') are done first. In C++, the precedence of the four operators (barring the use of parentheses) from first to last is NOT (~), AND (&), XOR (^), and OR (|). Hence NOT 0101 AND 1100 may be correctly rewritten as (NOT 0101) AND 1100. Also NOT A OR B AND C XOR D would be properly rewritten as [(NOT A) OR ({B AND C} XOR D)] since the order of execution is NOT, AND, XOR, and then OR. I believe this is the most common order of precedence. Lastly, operations that are the same (or of equal precedence) are commonly executed from left to right.

(I'll include the original problem again, especially if you read this far down.)

Assume that a system employs two caches (L1 and L2). Assume that accessing L1 requires 5 nsec (nanoseconds), accessing L2 requires 20 nsec (including the previous attempt with L1), and accessing memory requires 500 nsec (including previous attempts with L1 & L2). If the hit ratio for L1 is 90%, and the hit ratio for L2 is 50%, what is the average length (in nanoseconds) of a memory access?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

do our persusive tactics ever backfire

Answered: 1 week ago