Professional Documents
Culture Documents
KTMT K63J Lecture 07
KTMT K63J Lecture 07
Computer Architecture
Lecture 7: Input/Output Control
1. Giới thiệu
4. Interfacing
• Human readable
– Screen, printer, keyboard
• Machine readable
– Monitoring and control
• Communication
– Modem
– Network Interface Card
(NIC)
1. CPU kiểm tra trạng thái của thiết bị được kiểm soát bởi mô đun I/O
2. Mô đun I/O trả kết quả trạng thái của thiết bị I/O đó
Ngoài ra còn có thêm những kỹ thuật truyền dữ liệu khác nữa như
DMA, etc.
No No
Done? Done?
Yes Yes
Next instruction Next instruction
(a) Programmed I/O (b) Interrupt-driven I/O
10/7/2019 Figure 7.4 Three Techniques for&Input
Xuan-Tu Tran of aBuiBlock of Data
Duy-Hieu 8
ĐẠI HỌC
CÔNG NGHỆ
i. Programmed I/O
T–M T–M
Y N+1
Control Control
Stack Stack
T T
N+1 Y+L
Program Program
Counter Counter
Y Start Y Start
Interrupt General Interrupt General
Service Registers Service Registers
Y + L Return Routine T Y + L Return Routine T–M
Stack Stack
Pointer Pointer
Processor Processor
T–M T
N User's N User's
N+1 N+1
Program Program
Main Main
Memory Memory
• Làm thế nào để xác định được module nào yêu cầu ngắt?
Data
count
Address
Address lines register
Request to DMA
Acknowledge from DMA
Control
Interrupt
logic
Read
Write
I/O
I/O I/O
System bus
I/O bus
Data bus
DREQ
HRQ
8237 DMA Main Disk
chip memory controller
HLDA DACK
Address bus
• Thiết bị I/O càng ngày càng phức tạp, có xu hướng tích hợp
luôn bộ vi xử lý riêng
– VD: Card đồ hoạ (GPU), …
• CPU gửi lệnh đến I/O controller và giao toàn quyền việc
truyền dữ liệu
• Kiến trúc vào/ra cho phép máy tính “giao tiếp” được với thế
giới bên ngoài
• Giao tiếp với các thiết bị ngoài vi được thực hiện theo các
chuẩn: USB, Firewire, SATA, PCIe, …