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

Question 2 2 pts Suppose that you are working with a CISC machine using a 1.5 GH

ID: 3732442 • Letter: Q

Question

Question 2 2 pts Suppose that you are working with a CISC machine using a 1.5 GHz clock (i.e., the clock ticks 1.5 billion times per second). This particular computer uses MASM-like instructions with the following timings: add reg, mem 7 clock cycles (i.e., the ADD micro-program has 7 instr uctions) add reg, immed 2 clock cycles loop label 6 clock cycles 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 mov bx, 0 mov ecX, MAX SIZE mov esi, OFFSET list ;initialize array pointer ;initialize sum ;initialize loop counter more: add bx, esi add esi, 2 loop ; add current list element move array pointer to next element ; auto-decrement ecx, jump to more if ecx # 0 more After initialization, how many array elements can be processed in 3.9 ms? Round your answer to the nearest integer. Note that 1 ms. - 0.001 second

Explanation / Answer

A 1.5GHz Processor can do 1,500,000,000 cycles per second

In 3.9ms, processor can do 1,500,000,000 * 0.0039 cycles = 5,850,000 cycles

Each iteration of the loop requires 15 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: 6 cycles

=> 5,850,000 cycles available / 15 cycles per iteration => 390,000 iterations

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