クロック周波数が 1.6 GHz の CPU は, 4 クロックで処理される命令を 1 秒間に何回実行できるか。
平成23年度 特別試験 ITパスポート試験 問60
This question's explanation and your answers so far.
問 60
Incorrectア
400 thousand = 4 × 10^5 is the value obtained by mistaking 1.6 GHz for 1.6 MHz (1.6 × 10^6 Hz) and then dividing by the 4 clocks (1.6 × 10^6 ÷ 4 = 4 × 10^5). Dividing by 4 clocks is itself the correct step, but G (giga, 10^9) has been confused with M (mega, 10^6), so the result is only one thousandth of the actual value. It is worth confirming that the unit prefixes k (10^3), M (10^6), G (10^9) and T (10^12) each grow by a factor of 1,000.
Incorrectイ
1.6 million = 1.6 × 10^6 comes from confusing G with M, reading the frequency as 1.6 MHz, and then treating the number of clocks directly as the number of executions without using the condition that one instruction takes 4 clocks. It contains a double error: the wrong unit prefix, and the missing division by 4 clocks. Even if only the prefix were corrected, the result would be 1.6 billion times, which is the value for the case where one instruction completes in a single clock and does not match the condition of this question.
- ウ
正解 The correct answer is ウ (400 million). Clock frequency is the number of timing signals (clocks) per second that a CPU generates to keep its operations in step, and it is expressed in Hz. The G (giga) in 1.6 GHz means 10^9, so this CPU generates 1.6 × 10^9 = 1.6 billion clocks per second. Each execution of this instruction, on the other hand, consumes 4 clocks. Therefore the number of instructions that can be executed per second is the total number of clocks available in one second divided by the number of clocks one instruction consumes: 1.6 × 10^9 ÷ 4 = 4 × 10^8 = 400 million times. Thinking in terms of the clock cycle (the time taken by one clock) gives the same result. The clock cycle is the reciprocal of the frequency, so it is 1 ÷ (1.6 × 10^9) = 0.625 nanoseconds, and one instruction takes four times that, 4 × 0.625 = 2.5 nanoseconds. Dividing 1 second = 10^9 nanoseconds by 2.5 nanoseconds per instruction gives 10^9 ÷ 2.5 = 4 × 10^8 = 400 million times, which matches the earlier calculation. The key points are to hold the value of the prefix giga (10^9) correctly in mind, and, when one instruction takes several clocks, to divide the frequency rather than multiply it. Hence the number of executions per second is 400 million, that is, ウ is correct.
Incorrectエ
6.4 billion = 6.4 × 10^9 is the value obtained by multiplying the 1.6 × 10^9 clocks per second by 4. The fact that one instruction takes 4 clocks means the time required per instruction becomes four times longer, so the number of executions per second instead drops to one quarter. Multiplying gives 6.4 billion times, which exceeds the 1.6 billion total clocks available in one second, and the contradiction of executing more instructions than there are usable clocks also shows that this choice is wrong.
- Clock frequency and instructions executed per second — Clock frequency is the number of clocks generated per second (Hz). When one instruction takes n clocks, executions per second = clock frequency ÷ n. Note that you divide rather than multiply. In this question, 1.6 × 10^9 ÷ 4 = 4 × 10^8 times.
- SI prefixes and the clock cycle — k (10^3), M (10^6), G (10^9) and T (10^12) each grow by a factor of 1,000. Also, the clock cycle (the time of one clock) is the reciprocal of the frequency, so at 1.6 GHz it is 1 ÷ (1.6 × 10^9) = 0.625 ns. The relation instruction time = clock cycle × number of clocks required leads to the same answer.