「AP過去問 令和7年度春期 午前 問8」の版間の差分
編集の要約なし |
(→回答・解説) |
||
(同じ利用者による、間の6版が非表示) | |||
1行目: | 1行目: | ||
<freescript></script><script type="text/x-mathjax-config"> | |||
MathJax.Ajax.config.path["Contrib"]="https://wiki.yo-net.jp/mathjax/"; | |||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function (){ | |||
MathJax.Hub.Insert( | |||
MathJax.InputJax.TeX.Definitions.macros,{ | |||
cancel: ["Extension","cancel"], | |||
bcancel: ["Extension","cancel"], | |||
xcancel: ["Extension","cancel"], | |||
cancelto: ["Extension","cancel"] | |||
} | |||
); | |||
}); | |||
MathJax.Hub.Config({ | |||
tex2jax:{ | |||
displayMath: [['′,′ '],['\\[', '\\]']], //displayスタイル数式に利用する記号の指定 | |||
inlineMath: [['\\@', '\\@'],['\\(', '\\)']],//inlineスタイル数式に利用する記号の指定 | |||
//ここは使う人が自由に設定する部分です。 | |||
processEscapes: true | |||
}, | |||
TeX:{ | |||
// equationNumbers:{autoNumber: "AMS"}, | |||
extensions: ["[Contrib]/physics/physics.js","[Contrib]/siunitx/siunitx.js", "color.js", "cancel.js"] | |||
}, | |||
"HTML-CSS": { | |||
availableFonts: [], | |||
preferredFont: null, | |||
webFont: "Neo-Euler" | |||
}, | |||
}); | |||
</script> | |||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS_HTML-full"></script> | |||
<script></freescript> | |||
<freescript></script> | |||
<style> | |||
.table-container { | |||
display: inline-block; | |||
text-align: left; | |||
margin: 20px; | |||
} | |||
.table-header { | |||
display: flex; | |||
justify-content: space-between; | |||
margin-bottom: 5px; | |||
} | |||
</style> | |||
<style> | |||
div.imadake-left mjx-container[jax="CHTML"][display="true"]{text-align: left;} | |||
.imadake-left .MathJax_Display { | |||
text-align: left !important; | |||
font-size: 0.9rem; | |||
} | |||
</style> | |||
<script></freescript> | |||
[[AP過去問 令和7年度春期 午前#問題|AP過去問 令和7年度春期 午前 問題]]に戻る | [[AP過去問 令和7年度春期 午前#問題|AP過去問 令和7年度春期 午前 問題]]に戻る | ||
9行目: | 63行目: | ||
=='''問8(問題文)'''== | =='''問8(問題文)'''== | ||
同じ命令セットをもつコンピュータAとBとがある。それぞれのCPUクロック周期、及びあるプログラムを実行したときのCPI(Cycles Per Instruction)は、表のとおりである。そのプログラムを実行したとき、コンピュータAの処理時間は、コンピュータBの処理時間の何倍になるか。 | 同じ命令セットをもつコンピュータAとBとがある。それぞれのCPUクロック周期、及びあるプログラムを実行したときのCPI(Cycles Per Instruction)は、表のとおりである。そのプログラムを実行したとき、コンピュータAの処理時間は、コンピュータBの処理時間の何倍になるか。 | ||
<yjavascript> | |||
</script> | |||
<style> | |||
.table-container { | |||
display: inline-block; | |||
text-align: left; | |||
margin: 20px; | |||
} | |||
.table-header { | |||
display: flex; | |||
justify-content: space-between; | |||
margin-bottom: 5px; | |||
} | |||
</style> | |||
<div><div class="table-container"><div class="table-header"><span class="table-title"></span><span class="table-unit"></span></div> | |||
<table border="0" style="border-collapse: collapse;border-style: solid"> | |||
<tr> | |||
<td align="center" style="border: 0px;"></td> | |||
<td align="center" style="border: 2px solid; width: 9em;">CPUクロック周期</td> | |||
<td align="center" style="border: 2px solid; width: 5em;">CPI</td> | |||
</tr> | |||
<tr> | |||
<td align="center" style="border: 2px solid; width: 7em;">コンピュータA</td> | |||
<td align="center" style="border: 2px solid;">1ナノ秒</td> | |||
<td align="center" style="border: 2px solid;">4.0</td> | |||
</tr> | |||
<tr> | |||
<td align="center" style="border: 2px solid;">コンピュータB</td> | |||
<td align="center" style="border: 2px solid;">4ナノ秒</td> | |||
<td align="center" style="border: 2px solid;">0.5</td> | |||
</tr> | |||
</table> | |||
</div> | |||
</div> | |||
<script> | |||
</yjavascript> | |||
22行目: | 115行目: | ||
=='''回答・解説'''== | =='''回答・解説'''== | ||
この問題では、処理時間の比を求めるために、各コンピュータのプログラム実行時間を比較する必要があります。 | |||
処理時間は、次の式で求められます。 | |||
'''<span style="font-size: 0.9rem;">処理時間=命令数×CPI×クロック周期</span>''' | |||
ここで、命令数は同じであると仮定されているので、比較するのは '''CPI × クロック周期''' の値になります。 | |||
コンピュータA: | |||
*CPI: 4.0 | |||
*クロック周期: 1ナノ秒 | |||
*<span style="font-size: 0.9rem;">処理時間比に関係する値=4.0×1=4.0</span> | |||
コンピュータB: | |||
*CPI: 0.5 | |||
*クロック周期: 4ナノ秒 | |||
*<span style="font-size: 0.9rem;">処理時間比に関係する値=0.5×4=2.0</span> | |||
したがって、コンピュータAの処理時間はコンピュータBの処理時間の、 | |||
<span style="font-size: 0.9rem;">4.0÷2.0=2[倍]</span> | |||
2025年4月23日 (水) 23:46時点における最新版
AP過去問 令和7年度春期 午前 問7前の問題へ
AP過去問 令和7年度春期 午前 問9次の問題へ
問8(問題文)
同じ命令セットをもつコンピュータAとBとがある。それぞれのCPUクロック周期、及びあるプログラムを実行したときのCPI(Cycles Per Instruction)は、表のとおりである。そのプログラムを実行したとき、コンピュータAの処理時間は、コンピュータBの処理時間の何倍になるか。
CPUクロック周期 | CPI | |
コンピュータA | 1ナノ秒 | 4.0 |
コンピュータB | 4ナノ秒 | 0.5 |
ア 132
イ 12
ウ 2
エ 8
回答・解説
この問題では、処理時間の比を求めるために、各コンピュータのプログラム実行時間を比較する必要があります。
処理時間は、次の式で求められます。
処理時間=命令数×CPI×クロック周期
ここで、命令数は同じであると仮定されているので、比較するのは CPI × クロック周期 の値になります。
コンピュータA:
- CPI: 4.0
- クロック周期: 1ナノ秒
- 処理時間比に関係する値=4.0×1=4.0
コンピュータB:
- CPI: 0.5
- クロック周期: 4ナノ秒
- 処理時間比に関係する値=0.5×4=2.0
したがって、コンピュータAの処理時間はコンピュータBの処理時間の、
4.0÷2.0=2[倍]
AP過去問 令和7年度春期 午前 問7前の問題へ
AP過去問 令和7年度春期 午前 問9次の問題へ