lec2-isa_2 - EEM 486: Computer Architecture Lecture 2 MIPS...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 EEM 486 EEM 486: Computer Architecture Lecture 2 MIPS Instruction Set Architecture Lec 2.2 Overview – Instruction Representation ± Big idea: stored program • consequences of stored program ± Instructions as numbers ± Instruction encoding ± MIPS instruction format for Add instructions ± MIPS instruction format for Immediate, Data transfer instructions Lec 2.3 Big Idea: Stored-Program Concept ± Computers built on 2 key principles: 1) Instructions are represented as numbers 2) Therefore, entire programs can be stored in memory to be read or written just like numbers (data) ± Simplifies SW/HW of computer systems: • Memory technology for data also used for programs
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Lec 2.4 Consequence #1: Everything Addressed ± Since all instructions and data are stored in memory as numbers, everything has a memory address: instructions, data words • both branches and jumps use these ± C pointers are just memory addresses: they can point to anything in memory • Unconstrained use of addresses can lead to nasty bugs; up to you in C; limits in Java ± One register keeps address of instruction being executed: “Program Counter” ( PC ) • Basically a pointer to memory: Intel calls it Instruction Address Pointer, a better name Lec 2.5 Consequence #2: Binary Compatibility ± Programs are distributed in binary form • Programs bound to specific instruction set • Different version for Macintoshes and PCs ± New machines want to run old programs (“binaries”) as well as programs compiled to new instructions ± Leads to instruction set evolving over time ± Selection of Intel 8086 in 1981 for 1st IBM PC is major reason latest PCs still use 80x86 instruction set (Pentium 4); could still run program from 1981 PC today Lec 2.6 Instructions as Numbers ± Currently all data we work with is in words (32-bit blocks): • Each register is a word. •lw and sw both access memory one word at a time. ± So how do we represent instructions? • Remember: Computer only understands 1s and 0s, so “ add $t0,$0,$0 ” is meaningless. • MIPS wants simplicity: since data is in words, make instructions be words too
Background image of page 2
3 Lec 2.7 Instructions as Numbers ± One word is 32 bits, so divide instruction word into fields ”. ± Each field tells computer something about instruction. ± We could define different fields for each instruction, but MIPS is based on simplicity, so define 3 basic types of instruction formats: •R-format •I-format •J-format Lec 2.8 Instruction Formats ± I-format : used for instructions with immediates, lw and sw (since the offset counts as an immediate), and the branches ( beq and bne ), • (but not the shift instructions; later) ± J-format : used for j and jal ± R-format : used for all other instructions Lec 2.9 R-Format Instructions ± Define “ fields ” of the following number of bits each: 6 + 5 + 5 + 5 + 5 + 6 = 32 65 5 5 6 5 opcode rs rt rd funct shamt ± For simplicity, each field has a name: ± Important : Each field is viewed as a 5- or 6-bit unsigned integer, not as part of a 32-bit integer • Consequence: 5-bit fields can represent any number 0-31, while 6-bit fields can represent any number 0-63.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

lec2-isa_2 - EEM 486: Computer Architecture Lecture 2 MIPS...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online