230k views
3 votes
When we were discussing floating point addition, we made the simplifying assumption that each of the functional units took the same amount of time. Suppose that fetch and store each take 2 nanoseconds and the remaining operations each take 1 nanosecond. a. How long does a floating point addition take with these assumptions?b. How long will an unpipelined addition of 1000 pairs of floats take with these assumptions?c. How long will a pipelined addition of 1000 pairs of floats take with these assumptions? d. The time required for fetch and store may vary considerably if the operands/ results are stored in different levels of the memory hierarchy. Suppose that a fetch from a level 1 cache takes two nanoseconds, while a fetch from a level 2 cache takes five nanoseconds, and a fetch from main memory takes fifty nanoseconds. What happens to the pipeline when there is a level 1 cache miss on a fetch of one of the operands? What happens when there is a level 2 miss?

User Wiero
by
4.6k points

1 Answer

4 votes

Answer:

The solution the given problem is done below.

Step-by-step explanation:

a. How long does a floating point addition take with these assumptions?

The seven operations that are performed for the floating point sum are: Fetch operands, Compare exponents, Move an operand, Add, Normalize the result, Round the result, Store the result.

Assuming Fetch and store operations take 2 nanoseconds and the rest operations take 1 nanosecond, the total time elapsed would be: 2 + 1 + 1 + 1 + 1 + 1 + 2 = 9 nanoseconds.

b. How long will an unpipelined addition of 1000 pairs of floats take with these assumptions?

A sum of 1000 pairs of floats done normally and in sequence would take 1000 times the time of a single sum: 9 * 1000 = 9000 nanoseconds.

c. How long will a pipelined addition of 1000 pairs of floats take with these assumptions?

For the pipeline operation on the operations in question. They are divided into seven units functional. The units operate in sequence and the output of a functional unit is the input of the next. After making the first addition, which lasts 9 nanoseconds, 1 result is produced every 2 nanoseconds.

Therefore, the total execution time of the loop is 2 * 999 + 9 = 2007 nanoseconds.

d. The time required for fetch and store may vary considerably if the operands/ results are stored in different levels of the memory hierarchy. Suppose that a fetch from a level 1 cache takes two nanoseconds, while a fetch from a level 2 cache takes five nanoseconds, and a fetch from main memory takes fifty nanoseconds. What happens to the pipeline when there is a level 1 cache miss on a fetch of one of the operands? What happens when there is a level 2 miss?

The order in which data is fetched from the cache is from the fastest to the slowest level.

When a level 1 cache miss occurs:

Search operation = 2 nanoseconds to search the cache level 1 + 5 nanoseconds to search the cache level 2 = 7 nanoseconds .

When a level 2 cache miss occurs:

Search operation = 2 nanoseconds to search the cache level 1 + 5 nanoseconds to search the cache level 2 + 50 nanoseconds to search the main memory = 57 nanoseconds.

User Alisia
by
4.5k points