Title: Pengantar Organisasi Komputer
1IKI10230Pengantar Organisasi KomputerBab 10
Micro Architecture
Sumber1. Paul Carter, PC Assembly Language2.
Hamacher. Computer Organization, ed-53. Materi
kuliah CS61C/2000 CS152/1997, UCB
5 Mei 2004 L. Yohanes Stefanus (yohanes_at_cs.ui.ac.i
d)Bobby Nazief (nazief_at_cs.ui.ac.id) bahan
kuliah http//www.cs.ui.ac.id/kuliah/POK/
2Prosesor Control Datapath
3Organisasi Prosesor (Single-bus)
Control Unit
DatapathUnit
4Legenda
- PC Program Counter
- MAR Memory Address Register
- MDR Memory Data Register
- ALU Arithmetic Logic Unit
- IR Instruction Register
- SP Stack Pointer
5Siklus Eksekusi Instruksi
- Eksekusi instruksi yang ukurannya tetap
- do
- 1. IR ? PC // Fetch instruksi
- 2. PC ? PC d // Tunjuk ke lokasi instruksi
berikutnya - 3. Eksekusi instruksi
- while (!stop)
- Eksekusi instruksi yang ukurannya bervariasi
- do
- do // Fetch instruksi
- IR ? PC
- PC ? PC d
- while (!end-of-instruction)
- Eksekusi instruksi
- while (!stop)
6Operasi-operasi Dasar Dalam Eksekusi Instruksi
- Pertukaran Data Antar-Register
- Operasi Aritmatika Logika di Datapath
- Mengambil (fetching) Data dari Memori
- Menyimpan (storing) Data ke Memori
7Pertukaran Data Antar-Register
R1in
- Instruksi
- MOV R4,R1 R4 ? R1
- Langkah-langkah
- Enable output of R1// setting R1out to 1
- Enable input of R4 // setting R4in to 1
X
R1
X
R1out
R4in
X
R4
X
R4out
8Operasi Aritmatika dan Logika
- Instruksi
- ADD R1,R2 R1 ? R1 R2
- Langkah-langkah
- R1out, Yin
- R2out, Add, Zin
- Zout, R1in
9Mengambil Data dari Memori
- Instruksi
- MOV R2,R1 R2 ? R1
- Langkah-langkah
- MAR ? R1
- Read
- Tunggu sinyal MFC// MFC Memory Function
Completed// Pada saat MFC aktif// MDR ? MMAR - R2 ? MDR
10Menyimpan Data ke Memori
- Instruksi
- MOV R1,R2 R1 ? R2
- Langkah-langkah
- MAR ? R1
- MDR ? R2, Write
- Tunggu sinyal MFC// MFC Memory Function
Completed// Pada saat MFC aktif// MMAR ? MDR
11- Langkah-langkah
- Pengeksekusian Instruksi
12Tahapan Eksekusi Instruksi
- Instruksi
- Add R1,R3 R1 ? R1 R3
- Langkah-langkah
- Fetch instruksi
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- Fetch operand (isi lokasi memori yg ditunjuk oleh
R3) - R3out, MARin, Read
- R1out, Yin, WMFC
- Lakukan operasi penjumlahan
- MDRout, Add, Zin
- Simpan hasil penjumlahan di R1
- Zout, R1in, End
131. Fetch instruksi
- PCout, MARin, Read, Clear Y, Set carry-in to
ALU, Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
Control lines
Address lines
Data lines
00000000
Add
1
Carry-in
PC1
142. Fetch operand
- R3out, MARin, Read
- R1out, Yin, WMFC
Address lines
Data lines
153. Lakukan operasi penjumlahan
Address lines
Data lines
Add
Carry-in
Zin
164. Simpan hasil penjumlahan
Address lines
Data lines
17Tahapan Eksekusi Branching
- Unconditional (JMP Loop)
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- PCout, Yin
- Offset-field-of-IRout, Add, Zin // PC ? PC
Offset - Zout, PCin, End
- Conditional (contoh JS Loop)
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- PCout, Yin , If SF0 then End // take the branch?
- Offset-field-of-IRout, Add, Zin // PC ? PC
Offset - Zout, PCin, End
18 19Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
Read
Address lines
PCout
MARin
Data lines
Clear Y
00000000
Add
1
Set Carry-in
PC1
20Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
WMFC
Address lines
PCin
Data lines
Zout
21Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
Address lines
Data lines
22Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
Read
Address lines
Data lines
23Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
WMFC
Address lines
Data lines
24Tahapan Eksekusi Instruksi MOV EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EBXout, MARin, Read
- WMFC
- MDRout, EAXin, End
Control lines
Address lines
Data lines
25 26Tahapan Eksekusi Instruksi ADD EAX,EBX
- Instruksi
- ADD EAX,EBX EAX ? EAX EBX
- Langkah-langkah
- Fetch instruksi
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- Fetch operand ke-1 (EAX)
- EAXout, Yin
- Fetch operand ke-2 (EBX) dan Lakukan operasi ALU
- EBXout, Add, Zin
- Simpan hasil penjumlahan di EAX
- Zout, EAXin, End
27Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
Read
Address lines
PCout
MARin
Data lines
Clear Y
00000000
Add
1
Set Carry-in
PC1
Zin
28Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
WMFC
Address lines
PCin
Data lines
Zout
29Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
Address lines
Data lines
30Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
Address lines
Data lines
31Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
Instruction Decoder
PC1
Address lines
MAR
IR
Data lines
MDR
EBX
YEAX
EAX
ALU
Z
TEMP
32Tahapan Eksekusi Instruksi ADD EAX,EBX
- PCout, MARin, Read, Clear Y, Set carry-in to ALU,
Add, Zin - Zout, PCin, WMFC
- MDRout, IRin
- EAXout, Yin
- EBXout, Add, Zin
- Zout, EAXin, End
Control lines
Address lines
Data lines
33- Peningkatan Kinerja Prosesor
34Multiple-bus salah satu cara peningkatan kinerja
Add R1,R2,R3 R1?R2R3
35Bandingkan dengan Organisasi Single-bus
Add R1,R2,R3 R1?R2R3
36Beberapa Teknik Peningkatan Kinerja Prosesor
Lainnya
- Pre-fetchinginstruksi berikutnya (i1) di-fetch
pada waktu pengeksekusian instruksi (i) - Perlu teknik Branch Prediction
- Pipeliningeksekusi instruksi dipecah kedalam
tahap-tahap yang dapat dilakukan secara overlap - Fetch Instruksi
- Decode Instruksi
- Baca Operand (dari register asal)
- Lakukan Operasi
- Tulis Hasil (ke register tujuan)
- On-chip Cachemempercepat akses data dari/ke
memori
37 38- Gating
- Controlling Data Access from/to a Gate
39Input Output Gating
operasi tulis baca dilakukan secara bergantian
memungkinkan peranti lain menggunakan bus
Operasi Baca
Operasi Tulis
Zout Q output 0 X 3-state 1 1 1
1 0 0
- 1-bit bus Zin Q
- X 0 Q
- 0 1 0
- 1 1 1
40- Komponen-komponen Waktu Eksekusi
41Komponen-komponen Waktu Eksekusi
- Waktu Eksekusi Ditentukan Oleh
- Gate Delay
- Waktu yang dibutuhkan output suatu gerbang logika
berubah sesuai kondisi inputnya - Registers Delay
- Waktu yang dibutuhkan isi register berubah sesuai
inputnya
42Waktu Eksekusi Gate Delay
- When input 0 ? 1, output 1 ? 0 but NOT instantly
- Output goes 1 ? 0 output voltage goes from Vdd
(5v) to 0v - When input 1 ? 0, output 0 ? 1 but NOT instantly
- Output goes 0 ? 1 output voltage goes from 0v to
Vdd (5v) - Voltage does not like to change instantaneously
Voltage
1 gt Vdd
0 gt GND
Time
43Waktu Eksekusi Series Connection
Vdd
V1
Vin
G1
G2
G1
G2
C1
Voltage
Vdd
V1
Vout
Vin
Vdd/2
d1
d2
GND
Time
- Total Propagation Delay Sum of individual
delays d1 d2 - Capacitance C1 has two components
- Capacitance of the wire connecting the two gates
- Input capacitance of the second inverter
44Waktu Eksekusi Registers Delay
Clk
- Setup Time Input must be stable BEFORE the
trigger clock edge - Hold Time Input must REMAIN stable after the
trigger clock edge - Clock-to-Q time
- Output cannot change instantaneously at the
trigger clock edge
45Waktu Eksekusi
R2out, Add, Zin
Turn-on time for 3-state driver
Transmission time
Propagation delay through ALU
Setup time
Hold time