IKI10230 Pengantar Organisasi Komputer Kuliah no

Slides:



Advertisements
Presentasi serupa
Struktur CPU Delta Ardy Prima, S.ST.
Advertisements

PENGANTAR TEKNOLOGI INFORMASI
Organisasi dan Arsitektur Komputer
Struktur CPU.
Organisasi Komputer : Struktur dan Fungsi Komputer 2
Arsitektur Komputer “Instruksi Set Arsitektur”
ARSITEKTUR SET INSTRUKSI
1 IKI20210 Pengantar Organisasi Komputer Kuliah no. 2: Stored Program Computers 19 Februari 2003 Bobby Nazief Qonita Shahab
ARSITEKTUR SET INSTRUKSI
Central Processing Unit
ARSITEKTUR SET INSTRUKSI
10. Set Intruksi : Karakteristik dan Fungsi
Perkembangan Mikrokomputer
LOKASI DAN OPERASI MEMORI
Organisasi dan Arsitektur Komputer Pertemuan I : Pendahuluan Organisasi dan Arsitektur Komputer.
Sistem Pengolahan Data Komputer bag.1
ORGANISASI & ARSITEKTUR KOMPUTER 2 STRUKTUR & FUNGSI CPU IBP WIDJA, MT
Pertemuan 4 (Set Instruksi ARM)
Reduced Instruction Set Computers
Instruksi dalam CPU.
ARCHITECTURE COMPUTER
Desain Unit Pemrosesan
SISTEM PENGOLAHAN DATA (Arsitektur Komputer)
Pengenalan Assembler.
ARSITEKTUR SET INSTRUKSI
Set Instruksi:.
ARSITEKTUR INSTRUCTION SET
PENGANTAR TEKNOLOGI KOMPUTER & INFORMASI – A
SISTEM KOMPUTER Departement of Computer Science
Oleh : Maskie Z. Oematan Teknik Informatika UNIKOM 2010
Pertemuan 3 (Bahasa Assembly)
Pertemuan III SET Instruksi.
Perkembangan Mikrokomputer
IKI10230 Pengantar Organisasi Komputer Kuliah no
Sistem Pengolahan Data Komputer
IKI20210 Pengantar Organisasi Komputer Kuliah no
ARSITEKTUR SET INSTRUKSI
Representasi Data.
Mode Pengalamatan &Jenis-Jenis Instruksi
ORGANISASI & ARSITEKTUR KOMPUTER 2 SET INSTRUKSI IBP WIDJA, MT
Sistem Pengolahan Data Komputer
Pengenalan Assembler.
ARITMATIKA DAN UNIT PENGOLAHAN DASAR
Struktur Interkoneksi Antar-Komponen
Set Instruksi:.
William Stallings Computer Organization and Architecture
Reduced Instruction Set Computers
evolusi dan kinerja komputer
BAB I SEJARAH KOMPUTER GENERASI PERTAMA TABUNG VAKUM ENIAC
ASSEMBLER #1 MK. PEMROGRAMAN SISTEM
Perkembangan Mikrokomputer
Computer Organization and Architecture
Pertemuan 2 (INSTRUKSI MESIN DAN PROGRAM)
Organizes Sistem Komputer
ARSITEKTUR SET INSTRUKSI
PENGANTAR LOGIKA & TEKNIK PEMROGRAMAN
Organisasi Sistem Komputer
Organisasi Komputer II
Organisasi dan Arsitektur Komputer
STRUKTUR KOMPUTER DASAR
Pertemuan ke - 5 Struktur CPU
Organisasi Komputer II
Pertemuan ke 3 Struktur CPU
ARSITEKTUR SET INSTRUKSI
Copyright © Wondershare Software -m.erdda habiby.SST Central Processing Unit.
Arsitektur Komputer Pertemuan - 1 Oleh : Tim Pengajar.
SISTEM OPERASI Desi Ramayanti, S.Kom 11/16/2018
ARSITEKTUR SET INSTRUKSI
Karakteristik Set Instruksi 14 JP. Karakteristik Set Instruksi Pengertian Set Instruksi Set instruksi adalah kumpulan dari instruksi yang dapat dijalankan.
PEMROGRAMAN MIKROPROSESOR DAN MIKROKONTROLER ICHSAN R, S.PD | ARSITEKTUR MIKROPROSESOR.
Transcript presentasi:

bahan kuliah: http://www.cs.ui.ac.id/kuliah/POK/ IKI10230 Pengantar Organisasi Komputer Kuliah no. 02: Stored Program Computers Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization, ed-5 3. Materi kuliah CS61C/2000 & CS152/1997, UCB 18 Februari 2004 L. Yohanes Stefanus (yohanes@cs.ui.ac.id) Bobby Nazief (nazief@cs.ui.ac.id) bahan kuliah: http://www.cs.ui.ac.id/kuliah/POK/

Review

Review: Organisasi Sistem Komputer Application (Netscape) Operating 10230 Compiler System (Windows 98) Software Assembler Instruction Set Architecture Hardware Processor Memory I/O system Datapath & Control Digital Design Circuit Design transistors Koordinasi dari berbagai tingkat “abstraksi”

Review: Tingkat-tingkat Bahasa Pemrograman C = A * B; High Level Language Program (e.g., C) 10230 Compiler A dw 25 B dw 8 C resw 1 mov eax, [A] mov ebx, [B] add eax, ebx mov [C], eax Assembly Language Program Assembler Machine Language Program (80x86) 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Machine Interpretation Control Signal Specification °

Review: 5 Komponen Utama Komputer Processor (active) Computer Control (“brain”) Datapath (“brawn”) Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display, Printer Disk (where not running) That is, any computer, no matter how primitive or advance, can be divided into five parts: 1. The input devices bring the data from the outside world into the computer. 2. These data are kept in the computer’s memory until ... 3. The datapath request and process them. 4. The operation of the datapath is controlled by the computer’s controller. All the work done by the computer will NOT do us any good unless we can get the data back to the outside world. 5. Getting the data back to the outside world is the job of the output devices. The most COMMON way to connect these 5 components together is to use a network of busses. “CPU”

Koreksi: Processor Responsible of executing program stored in memory read instructions & input data execute store results (output data) Datapath (“otot”): ALU: Aritmetic & Logical Unit Exposed register Size of register determines processor smallest data unit (i.e., 8-bit, 16-bit, 32-bit, 64-bit computers) Hidden register Control Unit (“otak”): interprete instruction control data transfer between registers define processsor’s ‘language’ complexity (e.g., RISC vs. CISC)

Koreksi: Tren Teknologi: Kapasitas Mikroprosesor Pentium 4: 42 million Pentium III: 9.5 million Alpha 21264: 15 million Pentium Pro: 5.5 million PowerPC 620: 6.9 million Alpha 21164: 9.3 million Sparc Ultra: 5.2 million Moore’s Law 2X transistors/Chip Every 1.5 years Called “Moore’s Law”

Komputer Digital

Komputer Digital Komputer Digital: Hanya mengenal dua status (mis. ada / tidak ada tegangan) Sangat sederhana hanya dapat bernilai: 1 atau 0  biner Operasi hanya dapat dilakukan pada bit; yang dapat bernilai 1 atau 0. Contoh operasi mengubah (flip, switch) nilai bit, menjadikan bit tertentu 0; test bit jika 0 atau bukan. 100101 switch bit ini menjadi 0 100001 100001 Test bit ini jika 0, switch bit pertama 0 100000

Komputer & “things” … jadi, apa yang membuat komputer (yang hanya mengenal bits dengan nilai: 0 dan 1) demikian “powerful”? Apakah (dengan “mengandalkan” 0 & 1) komputer dapat merepresentasikan apa saja? ..hello buzz simulasi mobil

Bit Dengan bit, bagaimana komputer dapat merepresentasikan: Bilangan (numerik)? Alfabet ? Kata? Alamat? Gambar? Contoh: Bilangan Manusia lebih mudah menggunakan representasi/ notasi desimal. Misalkan: 1, 25, 125, 3896754321 Disebut basis 10, dengan simbol: Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ..tapi komputer hanya mengenal 2 simbol (0 dan 1) Bagaimana melakukan representasi bilangan yang dikenal manusia?

Bit  Bilangan Bilangan Basis B  B simbol per digit: Basis 10 (Decimal): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Basis 2 (Binary): 0, 1 Komputer menyimpan dan beroperasi dalam “binary”  Basis 2 Dapat melakukan konversi (representasi) bilangan dari basis 10 ke basis 2 (dan sebaliknya). Decimal: 0,1,2,3,4,5,6,7,8,9 90 = 9x101 + 0x100 Binary: 0,1 1011010 = 1x26 + 0x25 + 1x24 + 1x23 + 0x22 + 1x2 + 0x20 = 64 + 16 + 8 + 2 = 90

Bit dapat mepresentasikan “apa saja” !!! Bits dapat merepresentasikan apapun! Karakter? Latin: 26 huruf => 5 bits Huruf besar/kecil + tanda lain => 7 bits, berapa simbol huruf? Karakter, bahasa lain => 16 (unicode) Logical values? 0 -> False, 1 => True Warna ? Berapa banyak warna => berapa bits? Alamat? (berapa karakter alfabet ..) .. Tapi N bits  hanya dapat merepresentasikan 2N sesuatu

Apa lagi (sesuatu yang berguna) yang dapat dilakukan? Apa yang dapat dilakukan dengan “bilangan”? … umumnya semua operasi (instruksi) yang biasa dilakukan pada bilangan! Tambahkan, Kurangkan, Kalikan, Bagikan, Bandingkan! Contoh: 10 + 7 = 17 1 0 1 0 + 0 1 1 1 ------------------------- 1 0 0 0 1 1  10 Bagaimana instruksi +, diwakili oleh bits?  7  17

Bit  Instruksi Instruksi (Operasi). Apakah dapat diwakili oleh bit? Contoh: 0 => tepuk tangan 1 => snap jari jempol dan telunjuk Eksekusi Instruksi: 1 0 1 1 0 0 Contoh instruksi operasi bilangan: Misalkan 3 bit (berapa banyak instruksi?): 000 => tambahkan 001 => kurangkan 010 => kalikan 011 => bagikan 100 => bandingkan dst. Jadi bit (data) dapat diartikan sebagai instruksi!

Memori

Pengalamatan Memori 1 i 2k-1 Alamat n bits Byte 0 Byte 1 Byte i Byte 2k-1 k menentukan besarnya ruang alamat (address space) memori: k = 16  ruang alamat = 216 (64536) lokasi k = 32  ruang alamat = 232 (4 G) lokasi n menentukan besarnya suatu word (jumlah bit) n = 8, 16, 32, 64 Umumnya ukuran peng-alamatan terkecil adalah dalam orde byte  byte addressable

Bilangan (data) disimpan di memori Alamat Memori adalah tempat menyimpan bit data Suatu “word” adalah sejumlah bit data tetap, (mis. 16, atau 32 bit) pada satu lokasi di memori Byte-addressable memory menyimpan data multi-byte pada lokasi memori yang berurutan Alamat menunjuk ke lokasi “word” (byte-1) disimpan. Alamat dapat direpresen-tasikan oleh bit Alamat juga sebagai “bilangan” (yang dapat dimanipulasikan) 00000 data 01110 101101100110 11111 = 2k - 1

Pengalamatan Data: Endianess (1/2)  alamat data multi-byte adalah: Big Endian: alamat dari most significant byte IBM 360/370, Motorola 68k, MIPS, Sparc, HP PA Little Endian: alamat dari least significant byte Intel 80x86, DEC Vax, DEC Alpha msb lsb 1 4 5 lsb msb 1 4 5

Pengalamatan Data: Endianess (2/2) 1500 Big Endian Little Endian Alamat 1 2 3 i 2k-1 Alamat 5 1 2 3 4 5 6 7 i 2k-1 1 5 2 6

Apa saja yang dapat disimpan? Apa yang dapat disimpan? Bilangan Karakter Alamat data Representasi “sesuatu” di dunia luar .. 00000 01110 101101100110 11111 = 2k - 1 anything Big Idea: Komputer dapat menyimpan apapun.

Stored Program

The Stored Program Computer (1/2) Konsep Kunci: Data dapat diartikan sebagai instruksi! Data di komputer mampu merepresentasikan sesuatu (thing, anything)! Tergantung intrepetasi dan operasi yang diinginkan. BIG IDEA: STORED PROGRAM  program dapat disimpan sebagai data dan dijalankan oleh komputer Merupakan konsep awal komputer  Von Neumann Architecture (1955).

The Stored Program Computer (2/2) Memori menyimpan instruksi dan data sebagai bit. Instruksi diambil oleh prosesor dari memori, diartikan, dan, dieksekusi (operands/data diambil, diolah, dan disimpan ke memori). Contoh Instruksi 4-digit (á 4 bit)  16 bit (2 byte) ≈ 2 lokasi memori digit-1: Operasi: 0 => add, 1 => sub, ... digit-2: Alamat hasil digit-3: Alamat op1 digit-4: Alamat op2 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 0 0 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 data instruksi 0: 0846 0=add (jenis instruksi), 8=addr. result, 4=addr op1, 6=addr op2 instruksi Apa yang berada di lokasi 4,6,8 setelah eksekusi instruksi ke-1, ke-2?

0846: Add (8),(4),(6) ; M[8]  M[4] + M[6] Operasi pada Memori 0846: Add (8),(4),(6) ; M[8]  M[4] + M[6] 0846 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 7 8 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 0 0 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 Processor (active) Control (“brain”) Datapath (“brawn”) 0061 0017 0078 Instruction Fetch Data Read Data Store (write)

Jadi, apa artinya? Program adalah kumpulan bit yang tersimpan di memori merepresentasikan instruksi & data Program tersebut dijalankan oleh prosesor: untuk mengolah/manipulasi bilangan, karakter, pixels … (Aplikasi, Software) untuk mengontrol penggunaan sumber daya komputer dan menjalankan program lain (Operating Systems)

Bahasa Rakitan (Assembly Language)

Bahasa Mesin  Bahasa Rakitan Bahasa Mesin  kumpulan bit yang merepresentasikan Operasi & Operand Bahasa Rakitan  representasi dari Bahasa Mesin dalam bahasa (kumpulan huruf & angka) yang lebih mudah dimengerti oleh manusia Bahasa Mesin Bahasa Rakitan 0846: Add (8),(4),(6) M[8]  M[4] + M[6] mnemonic

The Program is ... lokasi instruksi Data: 0000 0846 Add 8,4,6 ; M[8]  M[4] + M[6] ; M[8] = 61 + 17 = 78 0002 1686 Sub 6,8,6 ; M[6]  M[8] – M[6] ; M[6] = 78 – 17 = 61 Data: Sebelum Sesudah M[4] = 0061 M[4] = 0061 M[6] = 0017 M[6] = 0061 M[8] = 0000 M[8] = 0078

Format Instruksi Instruksi membutuhkan argumen sebagai input dan menghasilkan produk sebagai output argumen  input operand produk  output operand Format instruksi: <op-code> <out-op>,<in-op1>,<in-op2>,... Berapa jumlah operand yang dibutuhkan?

Jumlah Operand  Kelas Set Instruksi 3-address instruction Add C,A,B ; C [A] + [B] Operation Destination,Source1,Source2 atau Operation Source1,Source2,Destination 2-address instruction Add A,B ; A  [A] + [B] Operation Destination,Source 1-address instruction Load B ; acc  B Add A ; acc [acc] + [A] Invented index register Reverse polish stack = HP calculator GPR = last 20 years L/S variant = last 10 years 0-address instruction Push B ; tos  B Push A ; tos  A; [next] = B Add ; tos [tos] + [next]

Jenis-jenis Operasi (tidak banyak berubah sejak 1960) Data Transfers memory-to-memory move register-to-register move memory-to-register move Arithmetic & Logic integer (binary + decimal) or FP Add, Subtract, Multiply, Divide shift left/right, rotate left/right not, and, or, set, clear Program Sequencing & Control unconditional, conditional Branch call, return trap, return Input/Output Transfers register-to-i/o device move Synchronization test & set (atomic r-m-w) String search, translate Graphics (MMX) parallel subword ops (4 16bit add)

Eksekusi Instruksi

Eksekusi Instruksi (1/2) Instruksi dan data bersama-sama berada di memori: Data diakses secara acak (tergantung alamat operand) Instruksi umumnya dijalankan secara berurut (sekuensial) Urutan ini menjamin logika alur program: terdapat urutan perintah ke mesin. Instruksi disimpan secara berurut pada lokasi di memori Eksekusi instruksi dilakukan mulai dari alamat terkecil Bagaimana mengetahui “posisi” instruksi saat ini (berikutnya?) Gunakan register khusus: Program Counter

Eksekusi Instruksi (2/2) PC (Program Counter) 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 7 8 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 6 1 8 0 0 7 8 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 0 0 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 2 4 Program couter (PC) berisi alamat lokasi instruksi yang akan dieksekusi pada siklus berikutnya. Setelah instruksi dieksekusi, maka PC akan “increment” dan menunjuk pada instruksi berikutnya (next location) PC = PC + 2; dst .. dikenal dengan istilah: straight line sequencing

Branching

Decision… Instruksi aritmatika, transfer data memberikan kemampuan kita untuk melakukan komputasi data Sama seperti “kalkulator” Untuk sebuah komputer, maka diperlukan kemampuan untuk memilih, “make decisions” .. Analogi HLL: assembly language harus mendukung statement: if (condition == true) do “this”; else do “that”; exit; Exit i == j? “this” (false) i != j (true) i == j “that”

Branching Dampak dari pengambilan keputusan yang bergantung pada suatu kondisi tertentu adalah terjadinya pencabangan (branching): Instruksi tidak lagi diambil dari lokasi memori yang “berurut”, tetapi “meloncat” ke lokasi memori tertentu  PC diisi dengan nilai baru, tidak di-increment Manipulasi PC dengan memberikan alamat baru (tidak “berurut”) juga digunakan untuk mengubah alur eksekusi program tanpa bergantung pada kondisi tertentu (jump)

Branching: Contoh R0 = ∑ Ni i i+1w i+2w i+(n-1)w i+nw SUM Num1 Num2 Move R0,Num1 Add R0,Num2 Alamat Add R0,Num3 Mov SUM,R0 Add R0,NumN LOOP SUM N Num1 Num2 NumN Move R1,N Clear R0 Determine address of next number and add Next number to R0 Alamat n Move SUM,R0 Branch>0 LOOP Decrement R1 PC

Conditional Branching Branch>0 LOOP Periksa kondisi (hasil operasi > 0?): memeriksa Condition Code Flags yang berada di Status Register: N: hasil operasi sebelumnya menghasilkan bil. negatif Z: hasil operasi sebelumnya menghasilkan 0 V: hasil operasi sebelumnya menghasilkan overflow C: hasil operasi sebelumnya menghasilkan carry  >0: hasil ≠ 0 (kondisi Z-flag == FALSE) Jika ya, loncat ke LOOP (PC  lokasi LOOP) Jika tidak, lanjutkan eksekusi

I/O

Organisasi Input/Output Prosesor Bus SOUT DATAOUT Display SIN DATAIN Keyboard Pada prinsipnya sama dengan data transfer (memori/register), bedanya peranti I/O lebih lambat Perlu mekanisme pemeriksaan kesiapan peranti I/O: Baca informasi status di SIN/SOUT untuk memastikan peranti I/O siap Jika “siap” lakukan operasi transfer data dari/ke peranti I/O ybs.

I/O Device Examples and Speed I/O Speed: bytes transferred per second (from mouse to display: million-to-1) Device Behavior Partner Data Rate (Kbytes/sec) Keyboard Input Human 0.01 Mouse Input Human 0.02 Line Printer Output Human 1.00 Floppy disk Storage Machine 50.00 Laser Printer Output Human 100.00 Magnetic Disk Storage Machine 10,000.00 Network-LAN I or O Machine 10,000.00 Graphics Display Output Human 30,000.00 Here are some examples of the various I/O devices you are probably familiar with. Notice that most I/O devices that has human as their partner usually has relatively low peak data rates because human in general are slow relatively to the computer system. The exceptions are the laser printer and the graphic displays. Laser printer requires a high data rate because it takes a lot of bits to describe high resolution image you like to print by the laser writer. The graphic display requires a high data rate because as I will show you later in today’s lecture, all the color objects we see in the real world and taken for granted is very hard to replicate on a graphic display. Let’s take a closer look at one of the most popular storage device, magnetic disks. +2 = 28 min. (Y:08)

Penutup

Stored-program Computer operasi yang dilakukan oleh komputer ditentukan oleh instruksi & data yang tersimpan di memori 0846 PC 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 0 0 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 6 1 8 0 0 7 8 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 0 0 8 4 6 2 1 6 8 6 4 0 0 6 1 6 0 0 1 7 8 0 0 7 8 10 0 0 0 0 12 0 0 0 0 14 0 0 0 0 16 0 0 0 0 18 0 0 0 0 Processor (active) Control (“brain”) Datapath (“brawn”) 1686 PC 0061 PC 0061 0017 0017 0078 0078 komputer dapat diprogram untuk memenuhi kebutuhan pengguna dengan jalan mengisi memori dengan instruksi & data yang sesuai

Computer is ... The great Richard Feynman, in his Lectures on Computation, summed up von Neumann computers by saying, "the inside of a computer is as dumb as hell, but it goes like mad!"