プリンキピア

第5章アルゴリズムのハードウェアによる実現:コンピューターシステム設計

Problem Set A問題集A

Exercises 1–5練習問題 1–5
1. A cache has an access time of 1 cycle. The computer with that cache experienced an average memory access time of 4 cycles, and the hit rate is 70%. What is the access time of the main memory? Did we benefit from having a cache in this system?
英語のヒント
1. あるキャッシュのアクセス時間は1サイクルである。そのキャッシュを持つコンピューターの平均メモリアクセス時間は4サイクルで、ヒット率は70%だった。主記憶のアクセス時間はいくらか。このシステムにキャッシュを設けた効果はあったか。
2. Research and explain a few key responsibilities of operating systems.
2. オペレーティングシステムの重要な役割をいくつか調べ、説明しなさい。
Given X = 01100110,
X = 01100110とする。
3. What is the value of X once you logically shift X to the right by two digits?
3. Xを右へ2桁、論理シフトした後の値はいくらか。
4. What is the value of X once you arithmetically shift X to the right by two digits?
4. Xを右へ2桁、算術シフトした後の値はいくらか。
Given X = 10100110,
X = 10100110とする。
5. What is the value of X once you logically shift X to the right by two digits?
5. Xを右へ2桁、論理シフトした後の値はいくらか。
Exercises 6–10練習問題 6–10
6. What is the value of X once you arithmetically shift X to the right by two digits?
6. Xを右へ2桁、算術シフトした後の値はいくらか。
7. What is the value of X if you arithmetically shift it to the right by eight digits?
7. Xを右へ8桁、算術シフトした場合の値はいくらか。
Perform the following number conversions:
次の数の変換を行いなさい。
8. hexadecimal value 40A5F916 to binary
8. 16進数40A5F916を2進数へ。
9. binary value 11011010011010111010 to hexadecimal
9. 2進数11011010011010111010を16進数へ。
10. Considering the arguments passed in, what does the following assembly language program do?
英語のヒント
10. 渡される引数を考慮すると、次のアセンブリ言語プログラムは何をするか。
Register
レジスタ
Use(s)
用途
%rdi
Argument x
引数x
%rsi
Argument y
引数y
%rax
Return value
戻り値
movq
%rdi, %rax
subq
%rsi, %rax
movq
%rsi, %rdx
subq
%rdi, %rdx
cmpq
%rsi, %rdi
cmovle
%rdx, %rax
ret
Exercises 11–12練習問題 11–12
11. Suppose that we have a system with memory access time of 8 cycles. We need to add to that system a cache with 2 cycles access time. What is the smallest hit rate needed to make that cache beneficial? (Hint: avg access time must always be an integer number not floating point.)
11. メモリアクセス時間が8サイクルのシステムがあるとする。このシステムに、アクセス時間2サイクルのキャッシュを追加したい。キャッシュに効果を持たせるために必要な最小ヒット率はいくらか。(ヒント:平均アクセス時間は、浮動小数点数ではなく、必ず整数でなければならない。)
12. A cache has an access time of 1 cycle. The computer with that cache experienced an average memory access time of 4 cycles, and the hit rate is 70%. What is the access time of the main memory? Did we benefit from having a cache in this system?
12. あるキャッシュのアクセス時間は1サイクルである。そのキャッシュを持つコンピューターの平均メモリアクセス時間は4サイクルで、ヒット率は70%だった。主記憶のアクセス時間はいくらか。このシステムにキャッシュを設けた効果はあったか。

Problem Set B問題集B

Exercises 1–4練習問題 1–4
1. Suppose that we have a system with memory access time of 8 cycles. We need to add to that system a cache with 2 cycles access time. What is the smallest hit rate needed to make that cache beneficial?
1. メモリアクセス時間が8サイクルのシステムがあるとする。このシステムに、アクセス時間2サイクルのキャッシュを追加したい。キャッシュに効果を持たせるために必要な最小ヒット率はいくらか。
2. Explain how there are multiple levels of abstraction in a computer and explain how at each level, complex implementation knowledge of the lower levels is not needed.
2. コンピューターには複数の抽象化レベルがあることを説明し、各レベルで、下位レベルの複雑な実装知識が不要になる仕組みを説明しなさい。
3. Calculate 0 1000 0001 110…0 plus 0 1000 0010 00110…0. Both are single-precision IEEE 754 representations.
3. 0 1000 0001 110…0と0 1000 0010 00110…0の和を計算しなさい。どちらも単精度IEEE 754表現である。
4. We derived the equation m + (1 – p)M for average access latency when we have one cache and memory. Extend this equation to include two-level cache followed by memory.
英語のヒント
4. キャッシュが一つとメモリがある場合の平均アクセスレイテンシーについて、式m + (1 − p)Mを導いた。この式を、2階層のキャッシュと、その後にメモリがある場合へ拡張しなさい。

Thought Provokers考えてみよう

Exercises 1–5練習問題 1–5
1. What are the desired characteristics of a good computer system, aside from speed?
英語のヒント
1. よいコンピューターシステムに求められる性質は、速度以外に何があるか。
2. When a company decides to design a new processor to compete in the market, what are the criteria that this company needs to tackle to be competitive? Be careful—speed is not enough.
英語のヒント
2. ある企業が、市場で競争するために新しいプロセッサを設計すると決めた。競争力を持つために、どのような基準に取り組む必要があるか。速度だけでは十分でないことに注意しなさい。
3. Consider our startup company that is 100% committed to leveraging innovative technologies as a business growth facilitator. Describe at a high-level how it could combine the use of Unicode and Large Language Models to translate documents in any language. What would be some of the limitations of such a solution using existing technology?
英語のヒント
3. 革新的な技術を事業成長の促進に活用することに、100%取り組む本書のスタートアップ企業を考えよう。Unicodeと大規模言語モデルを組み合わせ、どんな言語の文書も翻訳する仕組みを、概要として説明しなさい。現在の技術でこの方法を実現する場合、どのような限界があるだろうか。
4. With several levels of cache, the data in L1 is a subset of the data in L2 which is a subset of L3. This is called the inclusion property. This makes the data a bit redundant and loses chip area to store repetitive data. Do we gain anything from violating this inclusion property? If yes, what do we gain? What are the challenges? If no, why not?
英語のヒント
4. キャッシュが複数の階層に分かれているとき、L1のデータはL2のデータの部分集合であり、L2はL3の部分集合である。これを包含特性という。このため、データがやや重複し、同じデータを保存するためにチップ面積が使われる。この包含特性を破ることで得られるものはあるか。あるなら、何が得られ、どのような課題があるか。ないなら、なぜか。
5. Now that Moore’s Law is coming to an end, how do you think the computer industry can get more performance from computer systems? Suggest several solutions.
英語のヒント
5. ムーアの法則が終わりに近づいている今、コンピューター産業は、どうすればシステムからさらに性能を引き出せると思うか。複数の解決策を提案しなさい。

Labs実習

1. Make a list of the I/O devices on your laptop, and another list of the software programs installed on your laptop. This second list is a bit tricky.
英語のヒント
1. 自分のノートパソコンの入出力機器の一覧と、インストールされているソフトウェアの一覧を、それぞれ作りなさい。二つ目の一覧は、少し難しい。
2. Find out the type of processor on your computer or laptop. Once you get the type, find out the following information about it:
2. 自分のコンピューターやノートパソコンのプロセッサの種類を調べなさい。種類がわかったら、それについて次の情報を調べなさい。
• Which company designed it?
• どの企業が設計したか。
• How many transistors does it have?
• トランジスタは何個あるか。
• What ISA does it use?
• どのISAを使うか。
3. Using the link provided earlier in this section about translating from HLL to assembly, write a sample program and generate its assembly. Look at the assembly generate, understand it well, and then write yourself another version of this assembly that does the same thing.
英語のヒント
3. この節で先に示した、HLLからアセンブリへ翻訳するリンクを使い、サンプルプログラムを書いてアセンブリを生成しなさい。生成されたアセンブリをよく読んで理解し、同じ処理を行う別のアセンブリを自分で書きなさい。