RISC, CISC and pipelining
導入済み
14:50
RISC、パイプライン & ロジック
2人のチップデザイナーが同じ問題に直面しています:プログラムを高速に実行することです。一人はこう言います——強力な命令を作成して、1つの命令で多くの作業を行わせることです。もう一人はこう言います——keep…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| processors/ˈprəʊsesəz/ | The component that executes instructions and performs the operations of a computer or similar system. |
| instructions/ɪnˈstrʌkʃnz/ | Commands that tell a computer what actions to perform. |
| memory/ˈmeməri/ | Circuits that store data, such as registers, RAM and ROM. |
| CISC/sɪsk/ | 複合命令セット |
| RISC/rɪsk/ | 単純命令セット |
| pipelining/ˈpaɪplaɪnɪŋ/ | パイプライン |
| Flynn's taxonomy/flɪnz tækˈsɒnəmi/ | フリン分類 |
| memory accesses | Operations that read data from or write data to memory. |
| decoding | The process of working out what an instruction tells the processor to do. |
| hardware/ˈhɑːdweə/ | The physical parts of a computer system that can be touched. |
| decode | To work out what an instruction tells the processor to do. |
| load/ləʊd/ | To copy data from memory into a processor register. |
| store/stɔː/ | To move data from a register into a memory location. |
| register/ˈredʒɪstə/ | レジスタ |
| instruction length | The number of bits used to represent a single instruction. |
| cycles per instruction | The number of processor clock cycles needed to complete an instruction. |
| micro-operations | Simple internal operations into which a processor can break down instructions. |
| fetch | To get an instruction from memory for the processor to use. |
| execute/ˈeksɪkjuːt/ | To carry out the operation that an instruction tells the processor to do. |
| ALU/ˌeɪ el ˈjuː/ | ALU(演算論理回路) |
| write back | To write the result of an instruction into a register. |
| throughput/ˈθruːpʊt/ | The amount of useful work or data completed per unit of time, rather than the time for one individual operation. |
| fetch unit | The part of a processor that gets instructions for it to process. |
| hazard/ˈhæzəd/ | ハザード |
| data hazard | A delay when an instruction needs a result that is not yet available. |
| control hazard | A possible delay when the processor does not yet know which instruction comes next. |
| branch/bræntʃ/ | A path of instructions chosen according to a condition or value. |
| instruction streams | Sequences of instructions that processors read and carry out. |
| data streams | Sequences of data items that processors receive and process. |
| SISD | One instruction stream, one data stream, a traditional single core . |
| single core | A processor with one core that executes a stream of instructions. |
| SIMD/ˈsɪmdiː/ | SIMD(単一命令多データ) |
| GPU | A processor designed to perform many similar operations on different data items at once. |
| CPU/ˌsiː piː ˈjuː/ | The part of a computer that carries out program instructions. |
| vector unit | A part of a processor that applies one instruction to several data items. |
| MISD | Several operations on the same data. |
| MIMD/ˈmɪmdiː/ | MIMD(複数命令多データ) |
| multi-core | Describes a processor with two or more cores that can process instructions independently. |
| cluster/ˈklʌstə/ | A group of connected computers that work together on tasks. |
| massively parallel/ˈmæsɪvli ˈpærəlel/ | 大規模並列処理 |
| messages | Pieces of information sent between processors to exchange data. |
| supercomputers/ˌsuːpəkəmˈpjuːtəz/ | スーパーコンピュータ |
| graphics card/ˈɡræfɪks kɑːd/ | Hardware that processes graphics and produces display output, commonly containing a graphics processing unit and memory. |
| pixels/ˈpɪkslz/ | An individual picture element in a digital image or display. |
| compiler/kəmˈpaɪlə/ | Software that translates a program from a source language into another form, commonly machine or intermediate code. |
| distributed memory/ˈdɪstrɪbjuːtɪd ˈmeməri/ | An architecture in which processing units have separate local memories and exchange data through communication. |
| message passing | The exchange of data between processors by sending and receiving messages. |
ポケットの中の電話はIntelではない
- 30年間、最速のプロセッサほど複雑であった:命令を追加すれば、各命令がより多くの作業を行う。Intelはこの考え方に基いて帝国を築いた。
- その後、小さなイギリス企業が意図的に単純なプロセッサを電話に搭載した。命令数が少なく、すべて同じ長さで、メモリのほとんどに触れない。命令あたりの処理能力は少なかったが、それでも勝った。
- 勝ったのは、単純で均一な命令が**重なり合わせ(オーバーラップ)**できるからであり、重なり合わせの方が複雑さよりも価値があるからだ。
- この教訓はCISCとRISC、パイプライン、Flynnの分類法の4つのアーキテクチャ、そしてプロセッサの発熱と速度制限が導き出すものに関するものである。
CISCとRISC
- CISC(Complex Instruction Set Computer:複雑指令セットコンピュータ)は、多く、かつ複雑な命令を持つ:1つの命令が複数のメモリアクセスと操作を行うことがある。命令長は可変長のため、デコードは複雑である。ハードウェア上で命令あたり多くの処理を行う。例:Intel x86
- RISC(Reduced Instruction Set Computer、簡素命令セットコンピュータ)は、少量の単純な命令を持ち、それぞれが1つの基本操作を行い、すべて固定長でデコードが速い。メモリにアクセスするのはロードとストアのみであり、それ以外の処理はすべてレジスタ同間で行われる。例:ARM。
- RISCプログラムは長いが、各命令は速く予測可能であるため、パイプラインに最適である。

命令あたり多くの処理、または命令あたり高速かつ予測可能

A RISC processor is characterised by:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
RISC keeps instructions few, simple and fixed-length (usually 1 cycle); CISC has many complex variable-length ones.
試験で問われる違い
| 特徴 | CISC | RISC |
|---|---|---|
| 命令セット | 多く、複雑 | 少なく、単純 |
| 命令長 | 可変 | 固定 |
| メモリアクセス | 多くの命令がメモリにアクセスする | ロードとストアのみ |
| レジスタ | 少ない | 多い |
| 命令あたりのクロック数 | 変動する | 通常1つ |
| パイプライン化 | 難しい | 自然 |
- 現代のIntelチップは、内部でCISC命令をより単純なRISC類似のマイクロオペレーションに変換しており、これがどの設計が議論に勝利したかの最も明確な証拠である。
Match each term to its description.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
RISC = simple + fixed-length + load/store; CISC = complex + variable-length; pipelining overlaps stages for speed.
In a RISC processor, the only instructions that access memory are load and ____.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Everything else is register to register. That restriction is what makes instructions fixed-length, uniform in timing and easy to pipeline.
パイプライン化
- パイプラインは重なり合う段階で命令を処理し、組立ラインのような動作をする:フェッチ、デコード、ALU内での実行、メモリアクセス、書き戻し。
- 各フェーズが同時に異なる命令を処理するため、パイプラインが満たされると、サイクルごとに1つの命令が完了します。
- 個々の命令を高速化するものではありません。スループットを増加させます:毎秒完了する命令数が増えます。
- RISCの固定長・単純な命令により各段階の時間が同じになるため、RISCはきれいにパイプライン化でき、CISCはできない。

6つの命令が飛行中、各サイクルで1つ完了

How pipelining fills up
Step through the clock cycles. Once the pipeline is full, a new instruction finishes every cycle — even though each one still takes several stages — because the stages of different instructions overlap.
When a pipeline is full, it completes about:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Overlapping the stages means a new instruction finishes each cycle once the pipeline is full.
Pipelining speeds up a processor by:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Stages of different instructions run at the same time.
演習例:なぜパイプライン化が速いか
- 5段階のパイプラインは1クロック/段階で動作する。なぜ命令を順次実行するよりも速いか説明せよ。
- パイプラインがない場合、各命令はプロセッサの全5段階を占有するため、5クロックに1回完了する。
- パイプラインがある場合、フェッチユニットは現在の命令がまだデコード中であっても次の命令を開始するため、一度に5つの命令が進行中となり、パイプラインが満たされると1クロックごとに1つ完了する。
- No individual instruction is executed faster; the throughput rises about fivefold. Say that explicitly: it is the mark most often missed.

What does pipelining actually improve?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Stages overlap, so five instructions are in progress at once and one completes per cycle. No individual instruction is executed any faster.
ハザード
- ハザードはパイプラインを停止させる。データハザードとは、命令が前段の命令によってまだ生成されていない結果を必要とする場合に発生し、待たねばならない。
- 制御ハザードとは分岐点で発生し、分岐が解決されるまでプロセッサは次にフェッチすべき命令を知らない。
- どちらもクロックを浪費するため、プロセッサは分岐を予測し、段階間で結果を転送する。

A data hazard stalls the pipeline when an instruction needs a result that is not ready yet; a control hazard comes from a branch changing which instruction runs next.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Hazards force the pipeline to stall (or flush), which is why they reduce the ideal one-per-cycle throughput.
Match each pipeline hazard to what causes it.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Both stall the pipeline and waste cycles, which is why processors forward results between stages and predict branches.
フラインの分類法
- フラインの分類法は、コンピュータが持つ命令ストリームとデータストリームの数に基づいて分類する。
- SISD:1つの命令ストリーム、1つのデータストリーム、従来の単一コア。
- SIMD:1つの命令が多数のデータ項目を一度に処理する。これはGPUやCPUのベクトル単位であり、画像、動画、科学計算配列に適している。
- MISD:同一データに対して複数の操作を行う;希で主に理論的。MIMD:多数のプロセッサが異なるデータを異なる命令で処理するものであり、マルチコアCPUやクラスターに相当し、最も汎用的である。

1つの命令、多数のデータ項目

Which describe SIMD? Select すべて that apply.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Different programs on different data is MIMD, the multi-core case. SIMD is one instruction stream over many data streams.
大規模並列コンピュータ
- 大規模並列システムは、高速ネットワークで接続された数千のプロセッサを使用し、各プロセッサは独自のメモリを持ち、メモリ共有ではなくメッセージによるデータ交換を行う。
- MIMDであり、特別に書かれたソフトウェアが必要である。なぜなら、プログラマーは問題を分割し通信を管理しなければならないからである。
- これが最大級のスーパーコンピュータである:気候シミュレーション、機械学習のトレーニング、天体物理学など、これらすべての分野でこの方式が用いられている。

A massively parallel computer's processors share one block of memory.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Each processor has its own memory, and they exchange data by messages over a fast network. That distributed memory is what the term means.
演習例:マシンのカテゴリを指定
- A graphics card applies the same brightness adjustment to two million pixels. SIMD: one instruction, many data items, which is precisely what the GPU's thousands of small cores are built for.
- 4コアのラップトップがブラウザ、コンパイラ、音楽プレーヤーを同時に動作させる。MIMD:異なるデータに対する異なる命令、コアごとに1つのストリーム。
- 気象センターは大気をグリッドに分割し、一万個のプロセッサに割り当て、それぞれが独自のメモリを持ち、境界値をメッセージとして伝達します。 Massively parallelであり、これはMIMDの一種です。
- カテゴリ名を答え、命令ストリームとデータストリームの数に基づいて根拠を示せ。

見落としやすいポイント
- パイプライン化はスループットを上げます。単一の命令の短縮ではありません。そう答えてください。
- RISCではロードとストアのみがメモリにアクセスします。この事実こそが、固定長、多数のレジスタ、そしてスムーズなパイプラインを説明するものです。
- SIMDは1つの命令に多数のデータです。MIMDは多数の命令に多数のデータです。回答前にストリームの数を数えましょう。
- 大規模並列とは、「高速なコンピュータ」ではなく、分散メモリとメッセージパッシングを持つ数千のプロセッサを指します。
理解できましたか
- CISC:多数の複雑な可変長命令、命令あたり多い · RISC:少数の単純な固定長命令、ロードとストアのみ、多量のレジスタ、各命令1クロック
- a pipeline overlaps fetch, decode, execute, memory and write-back, so one instruction completes per cycle once full: higher throughput, not faster instructions; data and control hazards stall it
- Flynn: SISD、SIMD(GPUなど)、MISD、MIMD(マルチコア)
- 大規模並列処理: 数千のプロセッサ、分散メモリ、メッセージパッシング、MIMD方式を用い、スーパーコンピュータで採用されている。
何が問題でしたか?この内容はサイトの運営チームだけが確認します。