Computer Architecture –Department of Information Systems @ Hoá NGUYEN 5 Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 5.. Mô hình máy tính vạn năng..[r]
Trang 2Nội dung
3 Chức năng chính
4 Cơ chế ngắt và chu trình lệnh đầy đủ
Tham khảo chương 3 của [1]
Trang 3Computer Architecture –Department of Information Systems @ Hoá NGUYEN 3
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 3
1 Khái niệm chương trình
kiểm soát bằng các tín hiệu điều khiển
Chương trình mềm: Thay vì thiết kế lại mạch - re-wiring,
cung cấp một tập mới các tín hiệu điều khiển
Trang 4Khái niệm chương trình…
hiệu điều khiển khác nhau
Trang 5Computer Architecture –Department of Information Systems @ Hoá NGUYEN 5
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 5
Mô hình máy tính vạn năng
Trang 7Computer Architecture –Department of Information Systems @ Hoá NGUYEN 7
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 7
Minh hoạ chương trình với MARS
Trang 82 Thành phần máy tính
Central Processing Unit: Control Unit & Arithmetic and Logic Unit
thống cũng như kết xuất kết quả
trình tính toán
Hệ thống liên kết: kết nối, truyền thông các thành phần
chính nêu trên
Trang 9Computer Architecture –Department of Information Systems @ Hoá NGUYEN 9
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 9
Thành phần: mức tổng quan
Trang 103 Chức năng máy tính
lệnh của CPU, lưu trong bộ nhớ
Đọc lệnh từ bộ nhớ (fetch)
Thực thi lệnh (execute)
Lưu kết quả trong bộ nhớ (store)
Trang 11Computer Architecture –Department of Information Systems @ Hoá NGUYEN 11
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 11
Lệnh được tải lên thành ghi IR - Instruction Register
Trang 12Chu trình thực thi
Chu trình thực thi bao gồm những kiểu sau:
Processor-memory (data transfer between CPU and main memory)
Processor - I/O (Data transfer between CPU and I/O module)
Some arithmetic or logical operation on data
Thi hành các lệnh của CPU thông qua việc biến đổi thành chuỗi các thao tác logic cơ bản
Trang 13Computer Architecture –Department of Information Systems @ Hoá NGUYEN 13
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 13
Các loại thao tác
• CPU thi hành các phép toán ALU
• Lệnh điều khiển cho phép thay đổi chuỗi thi hành các phép toán/thao tác
• Dữ liệu được chuyển
từ I/O đến CPU và từ CPU đến trực tiếp I/O
• Dữ liệu chuyển
từ CPU đến MM
và từ MM đến CPU
memory
Processor-I/O
Data processing Control
Trang 14Ví dụ
Trang 15Computer Architecture –Department of Information Systems @ Hoá NGUYEN 15
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 15
4 Sơ đồ trạng thái chu trình lệnh
Trang 16chuỗi xử lý hiện hành (normal sequence of processing) để thực thi các lệnh của các modules đó
Program
e.g overflow, division by zero
Timer
Generated by internal processor timer
Used in pre-emptive multi-tasking
Trang 17Computer Architecture –Department of Information Systems @ Hoá NGUYEN 17
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 17
Ví dụ
Trang 18Ví dụ 1
Trang 19Computer Architecture –Department of Information Systems @ Hoá NGUYEN 19
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 19
Ví dụ 2
Trang 20Chu trình ngắt
ngắt
Processor checks for interrupt
Indicated by an interrupt signal
If no interrupt, fetch next instruction
Trang 21Computer Architecture –Department of Information Systems @ Hoá NGUYEN 21
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 21
Ví dụ
Trang 22Chu trình lệnh có ngắt
Trang 23Computer Architecture –Department of Information Systems @ Hoá NGUYEN 23
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 23
Sơ đồ trạng thái chu trình lệnh
Trang 24Đa ngắt - Multiple Interrupts
Trang 25Computer Architecture –Department of Information Systems @ Hoá NGUYEN 25
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 25
Đa ngắt tuần tự
Trang 26Đa ngắt lồng nhau
Trang 27Computer Architecture –Department of Information Systems @ Hoá NGUYEN 27
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 27
Mô hình thời gian thi hành đa ngắt
Trang 28Tổng kết
Neuman