Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose that you are working with a CISC machine using a 2.6 GHz clock (i.e., th

ID: 3732117 • Letter: S

Question

Suppose that you are working with a CISC machine using a 2.6 GHz clock (i.e., the clock ticks 2.6 billion times per second). This particular computer uses MASM-like instructions with the following timings:


Suppose that the following code fragment is used to sum elements of a numeric array. For this problem, assume that memory limitations are non-existent and that there is no limit to the size of the array.


After initialization, how many array elements can be processed in 2.8 ms? Round your answer to the nearest integer. Note that 1 ms. = 0.001 second.

esl

Explanation / Answer

ANSWER:

Consider the following data:

·         A 2.6GHz Processor.

· 2.7 billion Clock tick = 2,600,000,000 cycles per second.

·         Each iteration of the loop require (7+2+5) = 14 cycles to execute.

A 2.6GHz Processor can do 2,600,000,000 cycles per second

In 2.8ms, processor can do 2,600,000,000 * 0.0028 cycles = 72,80,000cycles

Each iteration of the loop requires 14 cycles to execute.

You only count the last four instructions after the label more where it's looping to:

·         first add (register to register): 7 cycles

·         second add (immediate to register): 2 cycle

·         loop: 5 cycles

Thus, 7,280,000 cycles available / 14 cycles per iteration = 5,20,000 iterations

Hence, 5,20,000 elements can be processed in 2.8 ms.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote