tailieunhanh - Bài giảng Kiến trúc máy tính: Chương 2 - Tạ Kim Huệ

Bài giảng Kiến trúc máy tính - Chương 2: Kiến trúc tập lệnh cung cấp cho người học các kiến thức về tập lệnh MIPS, biên dịch mã máy. Đây là một tài liệu hữu ích dành cho các bạn sinh viên ngành Công nghệ thông tin và những ai quan tâm dùng làm tài liệu học tập và nghiên cứu. | Kiến trúc máy tính Computer architecture To improve is to change; to be perfect is to change often. Winston Churchill 1 Chương 2: Kiến trúc tập lệnh Tập lệnh MIPS Biên dịch mã máy 2 “Speed” is often an important design criteria. However, other applications have other criteria – ., power, reliability, EMI, Kiến trúc tập lệnh Multiple Implementations: 8086 Pentium 4 ISAs evolve: MIPS-I, MIPS-II, MIPS-II, MIPS-IV, MIPS,MDMX, MIPS-32, MIPS-64 instruction set software hardware 3 Chu kỳ thực thi lệnh cơ bản Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction Obtain instruction from program storage Determine required actions and instruction size Locate and obtain operand data Compute result value or status Deposit results in register or storage for later use Determine successor instruction Thực thi chương trình Bộ xử lý thực thi chương trình như thế nào? 1. Tải lệnh 2. Tìm ra toán tử được sử dụng 3. Tìm ra dữ liệu nào được sử dụng 4. Thực hiện tính | Kiến trúc máy tính Computer architecture To improve is to change; to be perfect is to change often. Winston Churchill 1 Chương 2: Kiến trúc tập lệnh Tập lệnh MIPS Biên dịch mã máy 2 “Speed” is often an important design criteria. However, other applications have other criteria – ., power, reliability, EMI, Kiến trúc tập lệnh Multiple Implementations: 8086 Pentium 4 ISAs evolve: MIPS-I, MIPS-II, MIPS-II, MIPS-IV, MIPS,MDMX, MIPS-32, MIPS-64 instruction set software hardware 3 Chu kỳ thực thi lệnh cơ bản Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction Obtain instruction from program storage Determine required actions and instruction size Locate and obtain operand data Compute result value or status Deposit results in register or storage for later use Determine successor instruction Thực thi chương trình Bộ xử lý thực thi chương trình như thế nào? 1. Tải lệnh 2. Tìm ra toán tử được sử dụng 3. Tìm ra dữ liệu nào được sử dụng 4. Thực hiện tính toán 5. Tìm lệnh tiếp theo Lặp lại quá trình Bài giảng nhấn mạnh sự thực thi trong bộ xử lý MIPS Thực thi lệnh Today we’re going to learn the details! ADD SUBTRACT AND OR COMPARE . . . 01010 01110 10011 10001 11010 . . . Programmer's View Computer's View CPU Memory I/O Computer Program (Instructions) Kiến trúc Princeton (Von Neumann) --- Data and Instructions mixed in same unified memory --- Program as data --- Storage utilization --- Single memory interface Kiến trúc Harvard --- Data & Instructions in separate memories --- Has advantages in certain high performance implementations --- Can optimize each memory Thực thi lệnh Chương trình và dữ liệu được lưu trữ trong bộ nhớ – Các lệnh phải được nạp từ bộ nhớ để thực thi – Dữ liệu phải được nạp từ bộ nhớ để tính toán 7 Các kiểu toán hạng cơ bản Declining cost of registers So sánh số lượng toán hạng Thực thi phép toán (C = A + B) với các kiểu toán hạng khác nhau Stack Accumulator Register (load-store) Push A Load A Load R1,A Push B Add