100 likes | 114 Views
Gain insights into the core concepts of instruction sets, memory addressing, and machine design principles. Explore different instruction set architectures, including the MIPS instruction set example. Learn to convert between byte and word addresses and distinguish big-endian from little-endian systems.
E N D
Lecture 2.1 Instructions: Introduction
Objectives • 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 • 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 • Textbook Chapters 2.1, 2.2, 2.3 Chapter 2 — Instructions: Language of the Computer — 3
Instruction Set §2.1 Introduction • 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 Chapter 2 — Instructions: Language of the Computer — 4
The MIPS Instruction Set • Used as the example throughout the book • 32-bit Computer, i.e., MIPS-32 • Stanford MIPS commercialized by MIPS Technologies (www.mips.com) • Large share of embedded core market • Applications in consumer electronics, network/storage equipment, cameras, printers, … • One example of RISC instruction sets • Typical of many modern instruction set architectures (ISAs) • See MIPS Reference Data tear-out card, and Appendixes A and E Chapter 2 — Instructions: Language of the Computer — 5
Representation of Memory Addresses • Memory addresses are given in the unit of byte Chapter 2 — Instructions: Language of the Computer — 6
Save Words • A multiple-byte word is stored in multiple consecutive bytes • The address of a word matches the address of one of the multiple bytes within the word • 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
Word Address for Convenience • Word address = Byte address ÷ 4 Chapter 2 — Instructions: Language of the Computer — 8
Store words into memory Chapter 2 — Instructions: Language of the Computer — 9
Two Key Principles of Machine Design • Instructions are represented as numbers and, as such, are indistinguishable from data • Programs are stored in alterable memory (that can be read or written to) just like data • Stored-program concept • 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