第5章アルゴリズムのハードウェアによる実現:コンピューターシステム設計
5.5 Memory Hierarchy5.5 メモリ階層
• We must use different technologies to build a near ideal memory because each technology has some good characteristics and a few shortcomings. Therefore, we use multiple technologies to get the best of all. Various types of memory, such as DRAM and SRAM, are available and differ in access speed and associated costs.
英語のヒント
• それぞれの技術には長所と短所があるため、理想に近いメモリを作るには、異なる技術を使わなければならない。そこで、各技術の長所を得るために、複数の技術を組み合わせる。DRAMやSRAMなど、さまざまなメモリがあり、アクセス速度とそれに伴う費用が異なる。
• Those technologies are organized as a hierarchy. Technologies that are fast but expensive are at the top of the hierarchy, but their storage capacity is not big. As we go down the hierarchy, the technology is slower, but cheaper; hence, we use a lot of storage from it.
英語のヒント
• これらの技術は階層として組織される。高速で高価な技術は階層の上に置くが、容量は大きくない。下へ行くほど低速だが安価になるため、大容量を確保するのに使う。
• That is, characteristics of each technology determine its place in the hierarchy.
• つまり、各技術の特徴によって、階層内での位置が決まる。
• By paying attention to locality in accessing the data, the programmer can get the best performance from the hierarchy.
英語のヒント
• データへのアクセスで局所性に注意すれば、プログラマーはこの階層から最高の性能を引き出せる。
5.6 Processor Architectures5.6 プロセッサアーキテクチャー
• Processors evolved from a single cycle implementation to multicore.
• プロセッサは、単一サイクルの実装からマルチコアへと進化した。
• The norm now is to have a multicore processor working in tandem with one or more accelerator chips.
英語のヒント
• 現在は、マルチコアプロセッサを、一つ以上のアクセラレーターチップと連携させるのが一般的である。
• The norm in software development is to write parallel code for such a heterogeneous system. Sequential programming will soon be dated.
英語のヒント
• ソフトウェア開発では、このような異種混在システム向けの並列コードを書くのが一般的である。逐次プログラミングは、まもなく時代遅れになるだろう。
Review Questions確認問題
Exercises 1–5練習問題 1–5
1. What is the difference between CPU and ALU?
1. CPUとALUの違いは何か。
2. What is the difference between the processor used in your smartphone and the one used in your desktop, tablet, or laptop computer?
2. スマートフォンのプロセッサと、デスクトップ、タブレット、ノートパソコンのプロセッサの違いは何か。
3. What is the definition of abstraction? a. a piece of software that takes a program written in a given HLL and generates another program b. the most evolved method by which a human can direct a computer on how to perform tasks and applications c. the set of instructions recognized by each processor family d. removal of unimportant elements of a program or computer code that distract from its process
3. 抽象化の定義はどれか。a. あるHLLで書かれたプログラムを受け取り、別のプログラムを生成するソフトウェア。b. 人間がコンピューターにタスクやアプリケーションの実行方法を指示する、最も進化した方法。c. 各プロセッサファミリーが認識する命令の集合。d. プログラムやコードから、その処理の理解を妨げる重要でない要素を取り除くこと。
4. What is the term for the technique the OS uses to isolate different programs from each other so they do not overwrite each other’s data or corrupt each other’s files? a. virtual memory b. scheduling c. neuromorphic computer d. assembler
英語のヒント
4. プログラムどうしがデータを上書きしたり、ファイルを破損させたりしないよう、OSが異なるプログラムを分離する技法を何というか。a. 仮想記憶。b. スケジューリング。c. ニューロモーフィックコンピューター。d. アセンブラ。
5. Why do computers only work with 1s and 0s?
5. コンピューターは、なぜ1と0だけを使って動作するのか。
Exercises 6–10練習問題 6–10
6. Why is the OS the only software allowed to access the hardware?
6. ハードウェアへのアクセスを許可されているソフトウェアが、OSだけなのはなぜか。
7. Do a big supercomputer and small budget laptop use the same levels of abstraction?
英語のヒント
7. 大型スーパーコンピューターと小型の低価格ノートパソコンは、同じ抽象化レベルを使うか。
8. What type of number would we need to represent the number of marbles in a bag? a. signed integer b. unsigned integer c. floating point number d. Boolean number
英語のヒント
8. 袋に入っているビー玉の個数を表すには、どの種類の数が必要か。a. 符号付き整数。b. 符号なし整数。c. 浮動小数点数。d. ブール値。
9. What type of number would we need to represent the temperature outside to the nearest whole number? a. signed integer b. unsigned integer c. floating point number d. Boolean number
英語のヒント
9. 外の気温を最も近い整数で表すには、どの種類の数が必要か。a. 符号付き整数。b. 符号なし整数。c. 浮動小数点数。d. ブール値。
10. What type of number would we need to represent the amount of money in a bank account? a. signed integer b. unsigned integer c. floating point number d. Boolean number
10. 銀行口座の金額を表すには、どの種類の数が必要か。a. 符号付き整数。b. 符号なし整数。c. 浮動小数点数。d. ブール値。
Exercises 11–15練習問題 11–15
11. What is the two’s complement of the binary number 11100101? a. 01100101 b. 11100100 c. 00011010 d. 00011011
11. 2進数11100101の2の補数はどれか。a. 01100101b. 11100100c. 00011010d. 00011011
12. What is the one’s complement of the binary number 10100010? a. 00100010 b. 10100011 c. 01011101 d. 01011110
12. 2進数10100010の1の補数はどれか。a. 00100010b. 10100011c. 01011101d. 01011110
13. If you see a series of bits, can you know whether they present a signed or an unsigned integer, a floating point, or a character?
13. ビットの並びを見ただけで、それが符号付き整数、符号なし整数、浮動小数点数、文字のどれを表すかわかるか。
14. Why do we need unsigned integers?
14. 符号なし整数は、なぜ必要なのか。
15. What is the purpose of a linker? a. A linker puts the executable into memory and arranges its content in a specific way to make it ready for execution by the processor. b. A linker tells a program if a condition has been met. c. A linker takes all the generated object files, looks for needed libraries, and then links everything together in one executable file. d. A linker is a register that keeps track of instructions to be executed.
英語のヒント
15. リンカーの目的は何か。a. 実行可能プログラムをメモリに入れ、プロセッサが実行できるように内容を所定の形に配置する。b. 条件が満たされたかどうかをプログラムに伝える。c. 生成されたすべてのオブジェクトファイルを受け取り、必要なライブラリを探し、すべてを結合して一つの実行可能ファイルにする。d. 実行する命令を把握するレジスタである。
Exercises 16–20練習問題 16–20
16. What is the output of the assembler called? a. object code b. source code c. dynamic library d. static library
16. アセンブラの出力を何というか。a. オブジェクトコード。b. ソースコード。c. 動的ライブラリ。d. 静的ライブラリ。
17. What stores dynamically allocated data? a. stack b. register c. bus d. heap
17. 動的に割り当てられたデータを保存するのはどれか。a. スタック。b. レジスタ。c. バス。d. ヒープ。
18. Why do you need to learn assembly programming?
18. アセンブリプログラミングを学ぶ必要があるのはなぜか。
19. What is the main philosophy behind CISC?
19. CISCの基本となる考え方は何か。
20. What is the main philosophy behind RISC?
20. RISCの基本となる考え方は何か。
Exercises 21–25練習問題 21–25
21. What technology do we use to build a cache? a. static random access memory (SRAM) b. NAND gate c. dynamic random access memory (DRAM) d. solid state drive (SSD)
21. キャッシュを作るために使う技術はどれか。a. スタティックランダムアクセスメモリ(SRAM)。b. NANDゲート。c. ダイナミックランダムアクセスメモリ(DRAM)。d. ソリッドステートドライブ(SSD)。
22. What technology do we use to build memory? a. static random-access memory (SRAM) b. NAND bate c. dynamic random-access memory (DRAM) d. solid state drive (SSD)
22. メモリを作るために使う技術はどれか。a. スタティックランダムアクセスメモリ(SRAM)。b. NAND bate。c. ダイナミックランダムアクセスメモリ(DRAM)。d. ソリッドステートドライブ(SSD)。
23. What term means that, when the cache is empty, it does not have the needed data? a. cache hit b. cache memory c. cache miss d. cache reset
23. キャッシュが空で、必要なデータがないことを表す語はどれか。a. キャッシュヒット。b. キャッシュメモリ。c. キャッシュミス。d. キャッシュリセット。
24. Why is it necessary to have multiple levels of cache memory? a. to make it harder for the CPU to obtain instructions from RAM b. to make it faster for the CPU to obtain data from RAM c. just in case one level of cache fails d. to be able to execute instructions in parallel
英語のヒント
24. 複数の階層のキャッシュメモリが必要なのはなぜか。a. CPUがRAMから命令を取得しにくくするため。b. CPUがRAMからデータを取得する速度を高めるため。c. 一つの階層のキャッシュが故障した場合に備えるため。d. 命令を並列実行できるようにするため。
25. Is programming a single core or multicore easier? Why?
25. シングルコアとマルチコアでは、どちらのプログラミングが容易か。それはなぜか。
Exercises 26–27練習問題 26–27
26. Why did the industry move to multicore?
26. 業界がマルチコアへ移行したのはなぜか。
27. What is the term used to describe when two or more programs execute on the processor at the same time? a. temporal parallelism b. spatial parallelism c. simultaneous multithreading (SMT) d. superscalar capability
27. 二つ以上のプログラムが同じプロセッサで同時に実行されることを表す語はどれか。a. 時間的並列性。b. 空間的並列性。c. 同時マルチスレッディング(SMT)。d. スーパースカラー能力。