input outputsystem

31
William Stallings Computer Organization and Architecture 8 th Edition Chapter 7 Input/Output

Upload: bagus-sukoco

Post on 11-Dec-2015

235 views

Category:

Documents


0 download

DESCRIPTION

pengaturan tentang bagaimana sytem input output pada harwere komputer.

TRANSCRIPT

Page 1: Input Outputsystem

William Stallings Computer Organization and Architecture8th Edition

Chapter 7Input/Output

Page 2: Input Outputsystem

Question?

• Mengapa seseorang tidak menghubungkan peripheral secara langsung ke sistem bus? Kenapa masih membutuhkan Driver/Modul I/O?

Page 3: Input Outputsystem

Permasalahan Input/Output

• Banyak Jenis peripherals—Perbedaan pengiriman data (jumlah)—Perbedaan Kecepatan—Perbedaan Format

• Kecepatan I/O lebih lambat dari CPU dan RAM

• Membutuhkan I/O Modul

Page 4: Input Outputsystem

Fungsi Utama I/O Modul

• Interface ke CPU dan Memory• Interface to satu atau lebih peripherals

Page 5: Input Outputsystem

Model Umum I/O Modul

Page 6: Input Outputsystem

External Device Block Diagram

Page 7: Input Outputsystem

• Control signal: —send data to the I/O module (Input or Read)—Accept data from the I/O module (output or

write)—Report status

• Data:— Sent to or received from I/O Module (set of

bits)

• Status signals: menunjukkan status keadaan perangkat.—Ready/Not-Ready untuk transfer data

Page 8: Input Outputsystem

• Control Logic: —Terkait pengontrolan operasi perangkat

• Transduser:—Konfersi data dari elekrikal selama output\

input

• Buffer:—Tempat sementara data yang ditransfer

Page 9: Input Outputsystem

Klasifikasi Perangkat External

• Human readable—Screen, printer, keyboard

• Machine readable—Monitoring and control —Sensor and Actuator: Robotic—Magnetic disk and tape system

• Communication—Modem—Network Interface Card (NIC)

Page 10: Input Outputsystem

Klasifikasi Perangkat External

• Human readable—Screen, printer, keyboard

• Machine readable—Monitoring and control —Sensor and Actuator: Robotic—Magnetic disk and tape system

• Communication—Modem—Network Interface Card (NIC)

Page 11: Input Outputsystem

I/O Module Function

• Control & Timing• CPU Communication• Device Communication• Data Buffering• Error Detection

Page 12: Input Outputsystem

I/O Steps

• CPU checks I/O module device status• I/O module returns status• If ready, CPU requests data transfer• I/O module gets data from device• I/O module transfers data to CPU• Variations for output, DMA, etc.

Page 13: Input Outputsystem

I/O Module Diagram

Page 14: Input Outputsystem

Input Output Techniques

• Programmed• Interrupt driven• Direct Memory Access (DMA)

Page 15: Input Outputsystem

Three Techniques for Input of a Block of Data

Page 16: Input Outputsystem

Programmed I/O

• CPU has direct control over I/O—Sensing status—Read/write commands—Transferring data

• CPU waits for I/O module to complete operation

• Wastes CPU time

Page 17: Input Outputsystem

Programmed I/O - detail

• CPU meminta I/O beroperasi• Modul I/O melakukan operasi• Modul I/O set bit status• CPU cek bit status (secara berkala)• Modul I/O tidak memberikan informasi

secara langsung• Modul I/O tidak meng-interrupt CPU• CPU menunggu atau akan cek kembali

Page 18: Input Outputsystem

I/O Commands

• CPU issues address—Identifies module

• CPU issues command—Control - telling module what to do

– e.g. spin up disk

—Test - check status– e.g. power? Error?

—Read/Write– Modul mengirim data melalui buffer dari/ke

perangkat

Page 19: Input Outputsystem

Addressing I/O Devices

• Under programmed I/O data transfer is very like memory access

• Each device given unique identifier• CPU commands contain identifier

(address)

Page 20: Input Outputsystem

I/O Mapping

• Memory mapped I/O—Perangkat dan memori berbagi ruang alamat—I/O seperti memori (baca/tulis)—Tidak ada perintah khusus untuk I/O

• Isolated I/O—Pisahkan alamat spasi —Membutuhkan I/O atau memori yang terpilih—Memiliki perintah khusus untuk I/O

Page 21: Input Outputsystem

Interrupt Driven I/O

• Untuk mengatasi CPU menunggu• CPU Tidak melakukan cek lagi ke

perangkat• Modul I/O meng-interrupt ketika sudah

siap

Page 22: Input Outputsystem

Interrupt Driven I/OBasic Operation

• CPU issues read command• I/O module gets data from peripheral

whilst CPU does other work• I/O module interrupts CPU• CPU requests data• I/O module transfers data

Page 23: Input Outputsystem

Direct Memory Access

• Interrupt driven dan programmed I/O menyebabkan CPU harus aktif—Transfer rate is limited—CPU terikat

• DMA is the answer

Page 24: Input Outputsystem

DMA Function

• Additional Module (hardware) on bus• DMA controller takes over from CPU for I/O

Page 25: Input Outputsystem

Typical DMA Module Diagram

Page 26: Input Outputsystem

DMA Operation

• CPU tells DMA controller:-—Read/Write—Device address—Starting address of memory block for data—Amount of data to be transferred

• CPU carries on with other work• DMA controller deals with transfer• DMA controller sends interrupt when

finished

Page 27: Input Outputsystem

DMA Configurations (1)

• Single Bus, Detached DMA controller• Each transfer uses bus twice

—I/O to DMA then DMA to memory

• CPU is suspended twice

Page 28: Input Outputsystem

DMA Configurations (2)

• Single Bus, Integrated DMA controller• Controller may support >1 device• Each transfer uses bus once

—DMA to memory

• CPU is suspended once

Page 29: Input Outputsystem

DMA Configurations (3)

• Separate I/O Bus• Bus supports all DMA enabled devices• Each transfer uses bus once

—DMA to memory

• CPU is suspended once

Page 30: Input Outputsystem

Intel 8237A DMA Controller• Interfaces to 80x86 family and DRAM• When DMA module needs buses it sends HOLD signal to

processor• CPU responds HLDA (hold acknowledge)

— DMA module can use buses• E.g. transfer data from memory to disk

1. Device requests service of DMA by pulling DREQ (DMA request) high

2. DMA puts high on HRQ (hold request), 3. CPU finishes present bus cycle (not necessarily present

instruction) and puts high on HDLA (hold acknowledge). HOLD remains active for duration of DMA

4. DMA activates DACK (DMA acknowledge), telling device to start transfer

5. DMA starts transfer by putting address of first byte on address bus and activating MEMR; it then activates IOW to write to peripheral. DMA decrements counter and increments address pointer. Repeat until count reaches zero

6. DMA deactivates HRQ, giving bus back to CPU

Page 31: Input Outputsystem

I/O Channel Architecture