Question
Suppose you have a RISC machine with a 2.3 GHz clock (i.e., the clock ticks 2.3 billion times per second). This particular computer uses an
Suppose you have a RISC machine with a 2.3 GHz clock (i.e., the clock ticks 2.3 billion times per second). This particular computer uses an instruction cache, a data cache, an operand fetch unit, and an operand store unit. The instruction set includes simple instructions with the following timings:
set reg, immed 3 clock cycle loop label 1 clock cycles add reg, immed 2 clock cycle add reg, reg 3 clock cycles load reg, mem 3 clock cycles
Assume that the following code fragment is used to sum the element of a numeric array. If the initialization code has already executed (i.e. the SET instructions have already finished execution) how many array elements can be processed in 2 ms? Round your answer to the nearest integer. Recall that 1 ms = 0.001 seconds. Also assume that there are no physical memory limitations, implying that the array can be as large as desired.
set r1, 0 ;initialize sum set r2, MAX_SIZE ;initialize loop counter set r3, @list ;initialize array pointer more: load r4, 2 ;fetch current list element add r1, r4 ;add current list element add r3, 4 ;move array pointer to next element loop more ;auto-decrement r2, jump to more if r2 != 0
Answer = 511111.0, please show show we got this answer. thank you!
r3]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started