Lecture 2 1 Instructions Introduction Objectives n n

Lecture 2. 1 Instructions: Introduction

Objectives n n n Understand that the instruction set is the repertoire of instructions of a computer Remember that the memory is always addressed at the unit of byte n Memory only accepts byte addresses Convert between byte address and word address Tell the difference between big-endian computer and little-endian computer Underline two key principles of machine design Chapter 2 — Instructions: Language of the Computer — 2

Coverage n Textbook Chapters 2. 1, 2. 2, 2. 3 Chapter 2 — Instructions: Language of the Computer — 3

n n The repertoire of instructions of a computer Different computers have different instruction sets n n But with many aspects in common Early computers had very simple instruction sets n n § 2. 1 Introduction Instruction Set Simplified implementation Many modern computers also have simple instruction sets Chapter 2 — Instructions: Language of the Computer — 4

The MIPS Instruction Set n Used as the example throughout the book n n n Stanford MIPS commercialized by MIPS Technologies (www. mips. com) Large share of embedded core market n n n 32 -bit Computer, i. e. , MIPS-32 Applications in consumer electronics, network/storage equipment, cameras, printers, … One example of RISC instruction sets Typical of many modern instruction set architectures (ISAs) n See MIPS Reference Data tear-out card, and Appendixes A and E Chapter 2 — Instructions: Language of the Computer — 5

Representation of Memory Addresses n Memory addresses are given in the unit of byte Chapter 2 — Instructions: Language of the Computer — 6

Save Words n A multiple-byte word is stored in multiple consecutive bytes n The address of a word matches the address of one of the multiple bytes within the word n n Use the smallest address in general In MIPS, words must start at addresses of multiples of 4 Chapter 2 — Instructions: Language of the Computer — 7

Store words into memory Chapter 2 — Instructions: Language of the Computer — 8

Word Address for Convenience n Word address = Byte address ÷ 4 Chapter 2 — Instructions: Language of the Computer — 9

Two Key Principles of Machine Design 1. Instructions are represented as numbers and, as such, are indistinguishable from data 2. Programs are stored in alterable memory (that can be read or written to) just like data n Stored-program concept n n Programs can be shipped as files of binary numbers Computers can inherit ready-made software provided they are compatible with an existing ISA – leads industry to align around a small number of ISAs Chapter 2 — Instructions: Language of the Computer — 10
- Slides: 10