RISC, CISC and pipelining
Diperkenalkan
14:50
RISC, Pipelines & Logika
Dua desainer chip menghadapi masalah yang sama: membuat program berjalan cepat. Satu berkata — bangun instruksi yang kuat, sehingga setiap instruksi melakukan banyak pekerjaan. Yang lain berkata — pertahankan…
Narasi bahasa Inggris · takarir bahasa Inggris dan 中文 yang dapat dipilih
Dalam pelajaran ini
| English | Makna |
|---|---|
| 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/ | taksonomi Flynn |
| 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ː/ | |
| 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ː/ | |
| 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ː/ | |
| 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/ | paralel skala besar |
| messages | Pieces of information sent between processors to exchange data. |
| supercomputers/ˌsuːpəkəmˈpjuːtəz/ | komputer super |
| 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. |
Ponsel di saku Anda tidak menjalankan Intel
- Selama tiga puluh tahun prosesor tercepat adalah yang paling rumit: tambahkan instruksi, dan setiap satu melakukan lebih banyak pekerjaan. Intel membangun kekaisaran atas itu.
- Kemudian sebuah perusahaan kecil dari Inggris memasukkan prosesor yang sengaja sederhana ke dalam ponsel. Lebih sedikit instruksi, semua panjangnya sama, hampir tidak ada menyentuh memori. Tidak bisa melakukan sebanyak per instruksi, namun tetap menang.
- Ia menang karena instruksi sederhana dan seragam dapat ditumpuk (overlapped), dan penumpukan bernilai lebih tinggi daripada kerumitan.
- Pelajaran ini adalah CISC dan RISC, pipelining, empat arsitektur taksonomi Flynn, dan di mana batas panas dan kecepatan prosesor mengarah.
CISC dan RISC
- CISC, Komputer Set Instruksi Kompleks, memiliki banyak, seringkali kompleks instruksi: satu mungkin melakukan beberapa akses memori dan operasi. Mereka berpanjang variabel, sehingga dekoding rumit. Ini lebih banyak per instruksi, dalam perangkat keras. Contoh: Intel x86.
- RISC, Reduced Instruction Set Computer, memiliki himpunan instruksi sederhana yang kecil, masing-masing melakukan satu operasi dasar, semuanya dengan panjang tetap dan cepat didekode. Hanya load (memuat) dan store (menyimpan) yang mengakses memori; segalanya lainnya adalah register ke register. Contoh: ARM.
- Program RISC lebih panjang, tetapi setiap instruksi cepat dan dapat diprediksi, yang merupakan persis apa yang dibutuhkan oleh sebuah pipeline.

Lebih banyak per instruksi, atau lebih cepat dan lebih dapat diprediksi per instruksi
A RISC processor is characterised by:
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
RISC keeps instructions few, simple and fixed-length (usually 1 cycle); CISC has many complex variable-length ones.
Perbedaan yang ingin diujikan
| Fitur | CISC | RISC |
|---|---|---|
| himpunan instruksi | banyak, kompleks | sedikit, sederhana |
| panjang instruksi | variabel | tetap |
| akses memori | banyak instruksi mungkin mengakses memori | hanya load dan store |
| register | lebih sedikit | banyak |
| siklus per instruksi | bervariasi | biasanya satu |
| pipelining | lebih sulit | alami |
- Chip Intel modern menerjemahkan instruksi CISC mereka menjadi mikro-operasi RISC-like yang lebih sederhana secara internal, yang merupakan bukti paling jelas dari desain mana yang memenangkan perdebatan tersebut.
Match each term to its description.
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
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 ____.
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Everything else is register to register. That restriction is what makes instructions fixed-length, uniform in timing and easy to pipeline.
Pipelining
- Sebuah pipeline memproses instruksi dalam tahap-tahap yang tumpang tindih, seperti jalur perakitan: fetch (pengambilan), decode (dodekoding), eksekusi di ALU, akses memori, write back (penulisan kembali).
- Setiap tahap bekerja pada instruksi yang berbeda pada saat yang sama, jadi begitu pipeline penuh, satu instruksi selesai per siklus.
- Hal ini tidak membuat satu instruksi pun menjadi lebih cepat. Ini meningkatkan throughput: lebih banyak instruksi selesai per detik.
- Instruksi RISC dengan panjang tetap dan sederhana membuat setiap tahap memakan waktu yang sama, itulah sebabnya pipeline RISC berjalan mulus dan CISC tidak.

*Enam instruksi sedang diproses, satu selesai setiap siklus
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:
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Overlapping the stages means a new instruction finishes each cycle once the pipeline is full.
Pipelining speeds up a processor by:
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Stages of different instructions run at the same time.
Contoh terpecahkan: mengapa pipelining lebih cepat
- Sebuah pipeline lima tahap berjalan dengan satu siklus per tahap. Jelaskan mengapa hal itu lebih cepat daripada mengeksekusi instruksi satu per satu.
- Tanpa pipeline, setiap instruksi menempati prosesor untuk kelima tahap, sehingga satu selesai setiap lima siklus.
- Dengan pipeline, unit fetch mulai instruksi berikutnya sementara yang saat ini masih dalam proses dodecoding, sehingga lima instruksi sedang diproses sekaligus dan, begitu penuh, satu selesai setiap siklus.
- Tidak ada instruksi individu yang dieksekusi lebih cepat; throughput meningkat sekitar lima kali lipat. Katakan secara eksplisit: itu adalah poin nilai yang paling sering terlewatkan.

What does pipelining actually improve?
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Stages overlap, so five instructions are in progress at once and one completes per cycle. No individual instruction is executed any faster.
Hazards
- Sebuah hazard (gangguan) menghentikan pipeline. Data hazard terjadi ketika sebuah instruksi memerlukan hasil yang belum dihasilkan oleh instruksi sebelumnya, sehingga harus menunggu.
- Control hazard terjadi pada percabangan: hingga percabangan diselesaikan, prosesor tidak tahu instruksi apa yang akan diambil selanjutnya.
- Keduanya membuang siklus, itulah mengapa prosesor memprediksi percabangan dan meneruskan hasil antar tahap.

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.
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
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.
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
Both stall the pipeline and waste cycles, which is why processors forward results between stages and predict branches.
Taksonomi Flynn
- Taksonomi Flynn mengelompokkan komputer berdasarkan berapa banyak instruksi stream dan data stream yang dimilikinya.
- SISD: satu stream instruksi, satu stream data, inti tunggal tradisional.
- SIMD: satu instruksi beroperasi pada banyak item data sekaligus. Ini adalah GPU atau unit vektor CPU, dan cocok untuk gambar, video, dan array ilmiah.
- MISD: beberapa operasi pada data yang sama; jarang dan sebagian besar teoritis. MIMD: banyak prosesor menjalankan instruksi berbeda pada data berbeda, yang merupakan CPU multi-core atau klaster, dan ini yang paling umum.

*Satu instruksi, banyak item data
Which describe SIMD? Select semua that apply.
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
Different programs on different data is MIMD, the multi-core case. SIMD is one instruction stream over many data streams.
Komputer paralel masif
- Sistem paralel masif menggunakan ribuan prosesor yang terhubung melalui jaringan cepat, masing-masing dengan memori sendiri, bertukar data melalui pesan alih-alih berbagi memori.
- Ini adalah MIMD, dan membutuhkan perangkat lunak khusus, karena pemrogram harus membagi masalah dan mengelola komunikasi.
- Inilah superkomputer terbesar: simulasi iklim, pelatihan machine-learning, dan astrofisika semuanya berjalan dengan cara ini.

A massively parallel computer's processors share one block of memory.
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Each processor has its own memory, and they exchange data by messages over a fast network. That distributed memory is what the term means.
Contoh terpecahkan: tentukan jenis mesin
- Kartu grafis menerapkan penyesuaian kecerahan yang sama pada dua juta piksel. SIMD: satu instruksi, banyak item data, yang merupakan tujuan dari ribuan inti kecil pembangun GPU.
- Laptop empat-inte menjalankan browser, compiler, dan pemutar musik sekaligus. MIMD: instruksi berbeda pada data berbeda, satu stream per inti.
- Pusat cuaca membagi atmosfer menjadi grid di atas sepuluh ribu prosesor, masing-masing dengan memori sendiri, melewati nilai batas sebagai pesan. Paralel masif, yang merupakan bentuk MIMD.
- Sebutkan kategorinya, lalu justifikasikan dengan jumlah stream instruksi dan data.

Nilai yang mudah terlewat
- Pipelining meningkatkan throughput; itu tidak memperpendek satu instruksi pun. Katakan demikian.
- Dalam RISC, hanya load dan store yang menyentuh memori. Fakta tunggal ini menjelaskan panjang tetap, banyak register, dan pipeline yang bersih.
- SIMD adalah satu instruksi pada banyak data; MIMD adalah banyak instruksi pada banyak data. Hitung stream sebelum menjawab.
- Paralel masif berarti ribuan prosesor dengan memori terdistribusi dan pertukaran pesan, bukan sekadar "komputer cepat".
Anda telah memahaminya
- CISC: banyak instruksi kompleks variabel-length, lebih banyak per instruksi · RISC: sedikit instruksi sederhana fixed-length, load and store only, banyak register, satu siklus per instruksi
- pipeline tumpang tindih antara fetch, decode, execute, memory dan write-back, sehingga satu instruksi selesai per siklus setelah penuh: throughput lebih tinggi, bukan instruksi yang lebih cepat; data hazards dan control hazards menghentikannya
- Flynn: SISD, SIMD (GPU), MISD, MIMD (multi-core)
- massively parallel: ribuan prosesor, memori terdistribusi, pesan antar-prosesor, MIMD, digunakan oleh superkomputer
Apa yang salah? Hanya tim situs yang dapat melihatnya.