{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture_4

# Lecture_4 - Chapter 2 Instructions Language of the Computer...

This preview shows pages 1–7. Sign up to view the full content.

Chapter 2 Instructions: Language of the Computer

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 2 — Instructions: Language of the Computer — 2 Instruction Set The repertoire of instructions of a computer Different computers have different instruction sets But with many aspects in common Early computers had very simple instruction sets Simplified implementation Many modern computers also have simple instruction sets §2.1 Introduction
Chapter 2 — Instructions: Language of the Computer — 3 The MIPS Instruction Set Used as the example throughout the book Stanford MIPS commercialized by MIPS Technologies ( www.mips.com ) Large share of embedded core market Applications in consumer electronics, network/storage equipment, cameras, printers, … Typical of many modern ISAs See MIPS Reference Data tear-out card, and Appendixes B and E

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 2 — Instructions: Language of the Computer — 4 Arithmetic Operations Add and subtract, three operands Two sources and one destination add a, b, c # a gets b + c All arithmetic operations have this form Design Principle 1: Simplicity favours regularity Regularity makes implementation simpler Simplicity enables higher performance at lower cost §2.2 Operations of the Computer Hardware
Chapter 2 — Instructions: Language of the Computer — 5 Arithmetic Example C code: f = (g + h) - (i + j); Compiled MIPS code: add t0, g, h # temp t0 = g + h add t1, i, j # temp t1 = i + j sub f, t0, t1 # f = t0 - t1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 2 — Instructions: Language of the Computer — 6 Register Operands Arithmetic instructions use register operands MIPS has a 32 × 32-bit register file Use for frequently accessed data Numbered 0 to 31 32-bit data called a “word” Assembler names \$t0, \$t1, …, \$t9 for temporary values \$s0, \$s1, …, \$s7 for saved variables Design Principle 2: Smaller is faster c.f. main memory: millions of locations §2.3 Operands of the Computer Hardware
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}