1 IKI20210 Pengantar Organisasi Komputer Kuliah No. 18: I/O, Interupsi 15 November 2002 Bobby Nazief Johny Moningka

Slides:



Advertisements
Presentasi serupa
WE-2010 Web Engineering Husni husni.trunojoyo.ac.id
Advertisements

Algoritma & Pemrograman #10
PEMOGRAMAN BERBASIS JARINGAN
Program Keahlian I – SI By Antonius Rachmat C, S.Kom
Organisasi Komputer Dosen Pembimbing : Muhammad Adri S
Sistem Operasi Tawar, S.Si, M.Kom
COMPUTER ORGANIZATION AND ARCHITECTURE (William Stallings)
Organisasi Komputer Handbook : Computer Organization and architecture 5th Edition – Prentice Hall by William Stalling Materi 3 Bus-Bus.
EL-3014 Sistem Mikroprosesor Mikrokontroler AVR.
File Handling.
1 IKI10230 Pengantar Organisasi Komputer Pembahasan PR #3, #4, #5 4 Juni 2003 Bobby Nazief Qonita Shahab bahan.
1 Pertemuan 21 Pompa Matakuliah: S0634/Hidrologi dan Sumber Daya Air Tahun: 2006 Versi: >
Kasmawi, S.Kom (Networking ) The Lecturer of information technology program Politechnic of Bengkalis
Rully Yulian MF MCAD,MCPD,MCT,MVP VB.NET Independent IT Trainer - Application Developer
Ilmu Komputer, FMIPA UGM
PROSES PADA WINDOWS Pratikum SO. Introduksi Proses 1.Program yang sedang dalam keadaan dieksekusi. 2.Unit kerja terkecil yang secara individu memiliki.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 12: Tugas No. 4 Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization, ed-5.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 07: Tugas No. 2 Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization, ed-5.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. A4: Bahasa Rakitan AVR Conditional & Branch Instructions 21 Maret 2003 Bobby Nazief
DEPARTEMEN ILMU KOMPUTER FMIPA IPB 2011 Praktikum Bahasa Pemrograman.
Restricting and Sorting Data
Tipe-Tipe Instruksi MCS-51 (Arithmatika)
Pengantar/pengenalan (Introduction)
EL 3014 Sistem Mikroprosesor
KULIAH X FIREWALL KOM Keamanan Jaringan 2012/2013 KOM Keamanan Jaringan 2012/2013.
1 IKI20210 Pengantar Organisasi Komputer Kuliah no. 1: Pendahuluan 14 Februari 2003 Bobby Nazief Qonita Shahab
Implementing an REA Model in a Relational Database
EL 3096 Sistem Mikroprosesor & Lab
MEMORY Bhakti Yudho Suprapto,MT. berfungsi untuk memuat program dan juga sebagai tempat untuk menampung hasil proses bersifat volatile yang berarti bahwa.
Features Full Duplex Operation (Independent Serial Receive and Transmit Registers) Asynchronous or Synchronous Operation Master or Slave Clocked Synchronous.
STACK (Tumpukan) Tumpukan Koin Tumpukan Kotak.
LOGO Manajemen Data Berdasarkan Komputer dengan Sistem Database.
Chapter 1 Pendahuluan Komputer sebagai sebuah sistem yang berhirarki
ORGANISASI KOMPUTER Oleh : PUTRA PRIMA NAUFAL, S.ST SUMBER
JARINGAN KOMPUTER DAHLAN ABDULLAH Web : FB Pribadi : Dahlan Abdullah FB MK : MK Jaringan Komputer.
PEMROGRAMAN PPBD (UAS) SEBELUM MELANGKAH KE TAHAP SELANJUTNYA BERDOA DULU BIAR LANCAR DAN GA EROR
Linked List dan Double Linked List
STACK Budi arifitama.
Definisi VLAN Pemisahan jaringan secara logis yang dilakukan pada switch Pada tradisional switch, dalam satu switch menunjukkan satu segmentasi LAN.
Struktur Register dan Metode Pengalamatan Memori
Pertemuan 5 STACK atau TUMPUKAN IMAM SIBRO MALISI NIM :
© 2009 Fakultas Teknologi Informasi Universitas Budi Luhur Jl. Ciledug Raya Petukangan Utara Jakarta Selatan Website:
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. A8: Bahasa Rakitan AVR Latihan 23 Mei 2003 Bobby Nazief Qonita Shahab
Via Octaria Malau Transfer (Internal Transfers) Transfer (Transfers Internal) Select the account from which funds are to be transferred FROM and then select.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Pengalamatan Jaringan – IPv4 Dosen Pengampu: Resi Utami Putri, S.Kom.,
Retrosintetik dan Strategi Sintesis
Web Teknologi I (MKB511C) Minggu 12 Page 1 MINGGU 12 Web Teknologi I (MKB511C) Pokok Bahasan: – Text processing perl-compatible regular expression/PCRE.
Lecture 2 Introduction to C# - Object Oriented Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
IKI10230 Pengantar Organisasi Komputer Solusi UTS
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. A1: AVR Assembler & Studio 28 Februari 2003 Bobby Nazief Qonita Shahab
IKI20210 Pengantar Organisasi Komputer Kuliah Minggu ke-5a: Prosesor
STRUKTUR DATA (4) Array Stack(Tumpukkan) dan Queue (Antrian)
IKI10230 Pengantar Organisasi Komputer Kuliah no
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. A5: Bahasa Rakitan AVR Stacks & SubRoutine Calls 28 Maret 2003 Bobby Nazief Qonita.
stack ==tumpukan== Tenia wahyuningrum st3 telkom purwokerto
STRUKTUR DATA (4) array stack dan queue
Apakah Stack itu ?. Apakah Stack itu ? Pengertian STACK Secara sederhana diartikan dengan : sebagai tumpukan dari benda sekumpulan data yang seolah-olah.
Pertemuan 7 stack jual [Valdo] Lunatik Chubby Stylus.
1 Pertemuan 3 Komponen Sistem Komputer dan Register pada prosesor 8088 Matakuliah: T0483 / Bahasa Rakitan Tahun: 2005 Versi: versi 1.0 / revisi 1.0.
Stack dan Procedure.
Mode Pengalamatan.
IKI10230 Pengantar Organisasi Komputer Kuliah no
SISTEM MIKROPROSESOR PERTEMUAN 4.
STACK 6.3 & 7.3 NESTED LOOP.
REGISTER.
ORGANISASI & ARSITEKTUR KOMPUTER 2 SET INSTRUKSI IBP WIDJA, MT
STACK Yohana Nugraheni.
Computer Organization and Architecture
STACK & QUEUE Struktur Data.
STACK.
Transcript presentasi:

1 IKI20210 Pengantar Organisasi Komputer Kuliah No. 18: I/O, Interupsi 15 November 2002 Bobby Nazief Johny Moningka bahan kuliah: Sumber: 1. Hamacher. Computer Organization, ed Materi kuliah CS61C/2000 & CS152/1997, UCB.

2 Outline °AVR Programming: Subroutine Calls & Stacks °Lab Assignment no. 3 °Accessing I/O Devices Bus Memory-mapped vs. I/O-mapped Polling vs. Interrupt °Interrupts Interrupt Handler Handling Multiple Devices Exceptions Interrupts in Operating Systems

3 Review: Stacks °Lokasi memori yang pengaksesan datanya dibatasi dengan cara LIFO (Last In, First Out) °Memasukkan data ke Stack: Push, Call Push R x ; SP  SP – 1, M[SP]  R x Call Addr; Push PC, PC  Addr °Mengeluarkan data dari Stack: Pop, Ret Pop R x ; R x  M[SP], SP  SP + 1 Ret; Pop PC 0 MAX-ADDR Top-of-Stack: SP Bottom-of-Stack Stack Push Pop

4 Review: SubRoutine Call & Stacks LokasiProgram Utama 200 Push R Call SUB 202 Pop R instruksi_berikutnya LokasiSubroutine SUB 1000instruksi_i... Add R 1,R 2... Return 1000 PC SP Setelah ‘Call SUB’ 99 R1 202 PC SP Setelah ‘Return’ 57 R1 203 PC SP Setelah ‘Pop R 1 ’ 99 R1 …

5 LokasiProgram Utama 200 Move R 1,5 201 Move R 2,8 202 Call SUB 203 instruksi_berikutnya LokasiSubroutine SUB 1000instruksi_i... Add R 1,R 2... Return Review: Passing Parameters °Via Registers: Caller & Subroutine share the same registers °Via Stacks: Caller & Subroutine use the stacks Caller pushes data into the stacks just before calling Subroutine Subroutine pops data from the stacks whenever needed Caller & Subroutine must agree on the order of the data

6 Review: Why Are Stacks So Great? Stacking of Subroutine Calls & Returns and Environments: A: CALL B CALL C C: RET B: A AB ABC AB A Some machines provide a memory stack as part of the architecture (e.g., VAX) Sometimes stacks are implemented via software convention (e.g., MIPS)

7 Stack AVR °Stack ditempatkan di memori data (SRAM) °Top-of-stack ditunjuk oleh Stack Pointer (SP), yang berukuran 16 bit dan terletak di ruang I/O (hanya dapat diakses dengan menggunakan instruksi I/O) °Sebelum digunakan, SP harus diinisialisasi terlebih dahulu dengan cara:.equ SPH = $3E.equ SPL = $3D.equ RAMEND = $25F ldi r16,low(RAMEND) out SPL,r16 ldi r16,high(RAMEND) out SPH,r16; SP points to RAMEND

8 Stack AVR: Push/Pop, Call/Ret °Push R x M[SP]  R x SP  SP – 1 °Rcall Addr Push PC hi Push PC lo PC  Addr °Pop R x SP  SP + 1 R x  M[SP] °Ret Pop PC lo Pop PC hi °Contoh Segmen Program: ldir16,low(RAMEND) outSPL,r16 ldir16,high(RAMEND) outSPH,r16 … pushr17; save r17 pushXL; save X pushXH rcallMySubRoutine popXH popXL; restore X popr17; restore r16 … LIFO

9 Tugas Lab. No. 3 Batas Waktu Pengumpulan: Kamis, 28 November 2002

10 °Menulis program bahasa-rakitan AVR untuk melakukan “lookup table”: char **table = {“ac”, “abcd”, “abc”, “abcde”}; lookup_table(char *s) {for (i = 0; I <= size_of_table; i++) if (!strcmp(s, table[i]))// strcmp() returns 0 if strings are the same break; } char *s = “abc”; °Gunakan Subroutine Call: Program Utama: program yang melakukan fungsi di atas Subrutin: program pembanding 2 string (tugas 2) Tugas Lab. No. 3: deskripsi

11 °Laporan tugas terdiri dari: Deskripsi solusi dan algoritma yang anda gunakan. Program bahasa rakitan (assembly) dengan keterangan yang cukup pada baris program. Hasil demo dalam menjalankan program tersebut pada AVR Studio, untuk 2 kasus input sebagai berikut: -Tabel mengandung string yang dicari -Tabel tidak mengandung string yang dicari Keduanya menggunakan Tabel yang berisi 4 string yang berbeda Tugas Lab. No. 3: laporan

12 I/O

13 Organisasi Input/Output Processor (active) Computer Control (“brain”) Datapath (“brawn”) Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display, Printer Disk (where programs, data live when not running)

14 Motivation for Input/Output °I/O is how humans interact with computers °I/O lets computers do amazing things: Read pressure of synthetic hand and control synthetic arm and hand of fireman Control propellers, fins, communicate in BOB (Breathable Observable Bubble) Read bar codes of items in refrigerator °Computer without I/O like a car without wheels; great technology, but won’t get you anywhere

15 I/O Device Examples and Speeds °I/O Speed: bytes transferred per second (from mouse to display: million-to-1) °DeviceBehaviorPartner Data Rate (Kbytes/sec) KeyboardInputHuman0.01 MouseInputHuman0.02 Line PrinterOutputHuman1.00 Floppy diskStorageMachine50.00 Laser PrinterOutputHuman Magnetic DiskStorageMachine10, Network-LANI or OMachine 10, Graphics DisplayOutputHuman30,000.00

16 What do we need to make I/O work? °A way to connect many types of devices to the Proc-Mem °A way to control these devices, respond to them, and transfer data °A way to present them to user programs so they are useful Proc Mem PCI Bus SCSI Bus cmd reg. data reg. Operating System Windows Files

17 A Bus is: °shared communication link °single set of wires used to connect multiple subsystems °A Bus is also a fundamental tool for composing large, complex systems systematic means of abstraction Control Datapath Memory Processor Input Output

18 Organisasi Bus ° ° ° ProsesorMemori Control Lines Address Lines Data Lines Address Decoder Control Circuits Data & Status Registers Input Device I/O Interface

19 Instruction Set Architecture for I/O °Some machines have special input and output instructions Used in AVR Microcontroller Called “I/O Mapped Input/Output” IN R x,Device-Address; Processor  Device ; R x  R device-Address OUT Device-Address,R x ; Device  Processor ; R device-Address  R x °Memory also a sequence of bytes, so use loads for input, stores for output Called “Memory Mapped Input/Output” A portion of the address space dedicated to communication paths to Input or Output devices (no memory there)

20 Memory Mapped I/O °Certain addresses are not regular memory °Instead, they correspond to registers in I/O devices 0 0xFFFFFFFF 0xFFFF0000 cntrl reg. data reg. address

21 Processor-I/O Speed Mismatch °500 MHz microprocessor can execute 500 million load or store instructions per second, or 2,000,000 KB/s data rate I/O devices from 0.01 KB/s to 30,000 KB/s °Input: device may not be ready to send data as fast as the processor loads it Also, might be waiting for human to act °Output: device may not be ready to accept data as fast as processor stores it °What to do?

22 Processor Checks Status before Acting °Path to device generally has 2 registers: 1 register says it’s OK to read/write (I/O ready), often called Status/Control Register 1 register that contains data, often called Data Register °Processor reads from Status Register in loop, waiting for device to set Ready bit in Status reg to say its OK (0  1) °Processor then loads from (input) or writes to (output) data register Load from device/Store into Data Register resets Ready bit (1  0) of Status Register OUTIN STATUS DATAIN DATAOUT

23 Polling °Input: Read from keyboard MoveR1,#line; Initialize memory WAITK:TestBitSTATUS,#0; Keyboard (IN) ready? Branch=0WAITK; Wait for key-in MoveR0,DATAIN; Read character °Output: Write to display WAITD:TestBitSTATUS,#1; Display (OUT) ready? Branch=0WAITD; Wait for it MoveDATAOUT,R0; Write character Move(R1)+,R0; Store & advance CompareR0,#$0D; Is it CR? Branch≠0WAITK; No, get more CallProcess; Do something °Processor waiting for I/O called “Polling” OUTIN STATUS DATAIN DATAOUT

24 Cost of Polling? °Assume for a processor with a 500-MHz clock it takes 400 clock cycles for a polling operation (call polling routine, accessing the device, and returning). Determine % of processor time for polling Mouse: polled 30 times/sec so as not to miss user movement Floppy disk: transfers data in 2-byte units and has a data rate of 50 KB/second. No data transfer can be missed. Hard disk: transfers data in 16-byte chunks and can transfer at 8 MB/second. Again, no transfer can be missed.

25 % Processor time to poll mouse, floppy °Times Mouse Polling/sec = 30 polls/sec °Mouse Polling Clocks/sec = 30 * 400 = clocks/sec °% Processor for polling: 12*10 3 /500*10 6 = 0.002%  Polling mouse little impact on processor °Times Polling Floppy/sec = 50 KB/s /2B = 25K polls/sec °Floppy Polling Clocks/sec = 25K * 400 = 10,000,000 clocks/sec °% Processor for polling: 10*10 6 /500*10 6 = 2%  OK if not too many I/O devices

26 % Processor time to hard disk °Times Polling Disk/sec = 8 MB/s /16B = 500K polls/sec °Disk Polling Clocks/sec = 500K * 400 = 200,000,000 clocks/sec °% Processor for polling: 200*10 6 /500*10 6 = 40%  Unacceptable

27 What is the alternative to polling? °Wasteful to have processor spend most of its time “spin-waiting” for I/O to be ready °Wish we could have an unplanned procedure call that would be invoked only when I/O device is ready °Solution: use interrupt mechanism to help I/O. Interrupt program when I/O ready, return when done with data transfer