1. Trang chủ
  2. » Công Nghệ Thông Tin

Bài giảng Kiến trúc máy tính: Các thiết bị vào/ra - Nguyễn Ngọc Hóa

33 6 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Bài giảng Kiến trúc máy tính: Các thiết bị vào/ra cung cấp cho người học các kiến thức: Giới thiệu, khối kiểm soát vào/ra, kỹ thuật kiểm soát vào/ra, interfacing. Mời các bạn cùng tham khảo nội dung chi tiết.

Kiến trúc máy tính Các thiết bị vào/ra NGUYỄN Ngọc Hố Bộ mơn Hệ thống thơng tin, Khoa CNTT Trường Đại học Công nghệ, Đại học Quốc gia Hà Nội 28 October 2015 Hoa.Nguyen@vnu.edu.vn Nội dung Giới thiệu Khối kiểm soát vào/ra   Chức Cấu trúc Kỹ thuật kiểm soát vào/ra     Programmed I/O Interrupt driven I/O Direct Memory Access – DMA Kênh vào/ra & CPU Interfacing Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Quản lý vào/ra (I/O)  Rất nhiều thiết bị ngoại vi – peripherals, liệu thường    Khối lượng khác Tốc độ khác Định dạng khác  Tốc độ xử lý chậm nhiều so với CPU MM  Cần phải có khối vào/ra Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Thiết bị ngoại vi  Human readable   Machine readable   Screen, printer, keyboard Monitoring and control Communication   Modem Network Interface Card (NIC) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Chức I/O Module  Kiểm soát điều phối (timing)  Truyền thông với CPU/RAM  Truyền thông với thiết bị ngoại vi  Tạo chế đệm liệu (Data Buffering)  Phát kiểm soát lỗi Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hố Quy trình hoạt động mơ đun I/O CPU kiểm tra trạng thái thiết bị kiểm sốt mơ đun I/O Mơ đun I/O trả kết trạng thái thiết bị I/O Nếu sẵn sàng, CPU tiến hành truyền/nhận liệu Mô đun I/O lấy liệu từ thiết bị Mô đun I/O truyền liệu đến CPU Ngồi cịn có thêm kỹ thuật truyền liệu khác DMA, etc Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Sơ đố khối I/O Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Kỹ thuật kiểm soát vào/ra Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá i Programmed I/O  Idea: CPU kiểm soát trực tiếp thiết bị ngoại vi    Phát thay đổi (sensing status) Gửi lệnh read/write Truyền liệu        CPU phải đợi I/O module hồn tất thao tác  lãng phí tài nguyên CPU  Các bước thực CPU requests I/O operation I/O module performs operation I/O module sets status bits CPU checks status bits periodically I/O module does not inform CPU directly I/O module does not interrupt CPU CPU may wait or come back later Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá I/O Commands  CPU gửi địa   Xác định vào/ra (& thiết bị >1 bộ) CPU gửi command  Control : yêu cầu module thực thao tác   Test – kiểm tra trạng thái thiết bị   Ví dụ: quay đĩa, di chuyển đầu từ, … Ví dụ: cung cấp nguồn? Có lỗi hay khơng? Read/Write  Module truyền liệu sử dụng buffer từ/đến thiết bị Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 10 iii Direct Memory Access  Cả Interrupt-driven programmed I/O cần “can thiệp” CPU  Tốc độ truyền thiết bị bị giới hạn  CPU bị tải  DMA kỹ thuật cho phép giải nhược điểm nêu truyền khối lượng liệu lớn   Sử dụng thêm module (hardware) DMA Controller DMA controller giữ vai trò điều phối vào/ra Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 19 Sơ đồ DMA điển hình Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hố 20 Quy trình hoạt động  CPU gửi lệnh đến DMA controller:     Read/Write Device address Starting address of memory block for data Amount of data to be transferred  CPU tiến hành lệnh khác  DMA controller đảm nhiệm điều phối truyền liệu  DMA controller gửi interrupt kết thúc truyền Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 21 DMA truyền với kỹ thuật Cycle Stealing  DMA controller tận dụng cycles mà CPU không sử dụng data bus để truyền liệu (one word/cycle) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hố 22 Cấu hình DMA Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hố 23 Ví dụ: Intel 8237A DMA Controller Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 24 iv I/O Channels  Thiết bị I/O ngày phức tạp, có xu hướng tích hợp ln vi xử lý riêng   VD: Card đồ hoạ (GPU), … CPU gửi lệnh đến I/O controller giao toàn quyền việc truyền liệu  Cải thiện tốc độ truyền liệu I/O  I/O channels: thể mở rộng kỹ thuật DMA Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 25 Kiến trúc kênh vào/ra Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 26 Interfacing  Giao tiếp thiết bị:    Serial Parallel Dedicated processor/memory/buses? Ví dụ với FireWire, InfiniBand Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 27 IEEE 1394 FireWire  Sử dụng bus tốc độ cao  Chi phí thấp, dễ cài đặt  Thường sử dụng kết nối với thiết bị gia đình digital cameras, VCRs, TV, … Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 28 FireWire Configuration  Daisy chain  Tối đa 63 devices với cổng  Really 64 of which one is the interface itself  Up to 1022 buses can be connected with bridges  Automatic configuration  No bus terminators  May be tree structure Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 29 Simple FireWire Configuration Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 30 FireWire Layer Stack  Physical   Link   Transmission medium, electrical and signaling characteristics Transmission of data in packets Transaction  Request-response protocol Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 31 FireWire Subactions Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 32 Kết luận  Kiến trúc vào/ra cho phép máy tính “giao tiếp” với giới bên ngồi  Có kỹ thuật vào/ra chính: programmed I/O, interrupt driven I/O DMA  Giao tiếp với thiết bị vi thực theo chuẩn: Firewire 1394, USB, … Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 33 ... Acknowledge nhận yêu cầu ngắt truyền thiết bị đến thiết bị yêu cầu Thiết bị yêu cầu ngắt gửi liệu bus dạng vector chứa địa CPU sử dụng vector để định danh thiết bị Bus Master   I/O module phải... @Hoá NGUYỄN NGUYEN Ngọc Hoá 32 Kết luận  Kiến trúc vào/ra cho phép máy tính “giao tiếp” với giới bên ngồi  Có kỹ thuật vào/ra chính: programmed I/O, interrupt driven I/O DMA  Giao tiếp với thiết. .. Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 25 Kiến trúc kênh vào/ra Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 26 Interfacing

Ngày đăng: 07/05/2021, 13:21

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN