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 1.7 GHz clock (i.e., th

ID: 3768001 • Letter: S

Question

Suppose that you are working with a CISC machine using a 1.7 GHz clock (i.e., the clock ticks 1.7 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.1 ms? Round your answer to the nearest integer.

Explanation / Answer

Consider the following data:

·         A 1.7GHz Processor.

·         1.7 billion Clock tick = 1,700,000,000 cycles per second.

·         Each iteration of the loop require (4+3+5) = 12 cycles to execute.

A 1.7GHz Processor can do 1,700,000,000 cycles per second

In 2.1ms, processor can do 1,700,000,000 * 0.0021 cycles = 3,570,000cycles

Each iteration of the loop requires 12 cycles to execute.

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

·         first add (register to register): 5 cycles

·         second add (immediate to register): 3 cycle

·         loop: 4 cycles

Thus, 3,570,000 cycles available / 12 cycles per iteration = 297,500 iterations

Hence, 297,500 elements can be processed in 2.1 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