Anda di halaman 1dari 4

Agenda

ARSITEKTUR • Organisasi Komputer


KOMPUTER • Instruksi dan CPU

julio@bima.ipb.ac.id

Gambaran Umum Fungsi Komponen


Sejak 1946, semua komputer memiliki LIMA komponen: • datapath – melakukan operasi aritmatik dan logik
Contoh: adders, multipliers, shifters
Processor • memory – menyimpan data dan instruksi
Input Contoh: cache, main memory, disk
• input – mengirim data ke komputer
Control
Contoh: keyboard, mouse
Memory
• output – mengambil data dari komputer
Contoh: screen, sound card
Datapath • control – memberikan arah ke komponen lainnya
Output
Contoh: bus controller, memory interface unit

Komponen Detil
CPU Memory
…..
Register
PC MAR
…..
Instruction
Instruction
IR MBR Instruction • MAR, menentukan alamat memori
I/O AR ….. untuk baca atau tulis berikutnya.
…..
I/O BR
Data • MBR, berisi data untuk ditulis kedalam
Data
Data memori atau menerima data yang
Data
I/O Module
…..
dibaca dari memori.
….. • I/O AR, menentukan peralatan I/O
PC = Program Counter khusus.
IR = Instruction Register
…. MAR = Memory Address Register • I/O BR, untuk pertukaran data antara
…. MBR = Memory Buffer Register
Buffers I/O AR = I/O Address Register
modul I/O dengan CPU
I/O BR = I/O Buffer Register

1
Siklus Instruksi Siklus Instruksi

• Fungsi dasar komputer adalah


memproses (execute) program, yang
berisi gugus instruksi yang disimpan
Fetch Cycle Execute Cycle
dalam memori.
• Dua tahap utama:
Fetch-Next Execute
– FETCH : processor membaca instruksi START Fetch-Next
Instruction
Instruction
Fetch-Next
Instruction
Instruction
HALT
dari memori pada satu waktu.
– EXECUTE : processor memproses setiap
instruksi yang ada.

Instruksi Komputer
Instruction
Fetch
Mengambil instruksi dari program storage INSTRUKSI
Instruction Menentukan aksi yang dibutuhkan dan ukuran dan
Decode instruksi
CPU
Operand Memperoleh dan menempatkan operand
Fetch

Execute Menghitung nilai hasil atau status


julio@bima.ipb.ac.id
Result Menyimpan hasil dalam storage untuk
Store digunakan pada proses berikutnya

Next
Instruction Menentukan instruksi berikutnya

Memproses Instruksi Contoh Instruksi

1. Ambil instruksi dari memori ke IR. C := A + B;


2. Ubah PC ke instruksi berikutnya. • LOAD A
3. Menentukan jenis instruksi. • ADD B
4. Jalankan instruksi. • STORE C
5. Kembali ke langkah (1).

2
Contoh Instruksi Contoh Instruksi
Memory CPU Registers Memory CPU Registers

300 1 9 4 0 3 0 0 PC 300 1 9 4 0 3 0 1 PC
301 5 9 4 1 AC 301 5 9 4 1 0 0 0 3 AC
302 2 9 4 1 1 9 4 0 IR 302 2 9 4 1 1 9 4 0 IR

940 0 0 0 3 Tahap 1 940 0 0 0 3


941 0 0 0 2 Catatan: Peran MAR dan MBR tidak 941 0 0 0 2
digambarkan. Tahap 2

LOAD A LOAD A

Contoh Instruksi Contoh Instruksi


Memory CPU Registers Memory CPU Registers

300 1 9 4 0 3 0 1 PC 300 1 9 4 0 3 0 2 PC
301 5 9 4 1 0 0 0 3 AC 301 5 9 4 1 0 0 0 5 AC
302 2 9 4 1 5 9 4 1 IR 302 2 9 4 1 5 9 4 1 IR

3 + 2 = 5
940 0 0 0 3 940 0 0 0 3
941 0 0 0 2 941 0 0 0 2
Tahap 3 Tahap 4

ADD B ADD B

Contoh Instruksi Contoh Instruksi


Memory CPU Registers Memory CPU Registers

300 1 9 4 0 3 0 2 PC 300 1 9 4 0 3 0 3 PC
301 5 9 4 1 0 0 0 5 AC 301 5 9 4 1 0 0 0 5 AC
302 2 9 4 1 2 9 4 1 IR 302 2 9 4 1 2 9 4 1 IR

3 + 2 = 5
940 0 0 0 3 940 0 0 0 3
941 0 0 0 2 941 0 0 0 5
Tahap 5 Tahap 6

STORE C STORE C

3
Simulasi Cara Kerja Bahasa Assembly

• Melihat bagaimana cara kerja mesin • Bahasa pemrograman dimana setiap


komputer dan sistem operasi. instruksinya sangat dekat dengan bahasa
mesin komputer.
• Mengetahui bagaimana program
• Secara langsung terkait dengan instruksi
aplikasi berkomunikasi dengan sistem mesin dan arsitektur komputer.
operasi.
• User harus mengetahui organisasi mesin
• Î menggunakan bahasa Assembly komputer.
• Diinterpretasikan oleh Assembler, misalnya
TASM, MASM, etc.

DEBUG Register 80xxx


• Cara sederhana untuk menyusun instruksi assembly. • 16-bit, tetapi dapat diakses 8-bit atas (higher) dan 8-bit
• Contoh DEBUG: bawah (lower).
A 100
mov ax, 5
add ax,10 • Ada 5 register:
add ax,20 – Data Registers AX, BX, CX, DX (16-bit)
mov [0120], ax
int 20 AH, AL, BH, BL, CH, CL, DH, DL (8-bit)
<enter> – Segment Registers CS, DS, SS, ES
R
T – Index Registers SI, DI, BP
T – Special Registers IP, SP
T – Flags Register Overflow, Direction, Interrupt, Trap, Sign,
G
Q Zero, Aux Carry, Parity, Carry

Register Data Register Data

• Disebut juga sebagai general-purpose


registers. 15 ….. ….. 0
16-bit _X register
• Digunakan untuk aritmatika dan data _H register _L register
movement. 7 ….. ….. 0 7 ….. ….. 0

AX BX CX DX
AH AL BH BL CH CL DH DL

Anda mungkin juga menyukai