L3 Instructions_2_ - Topic 3 MIPS Instruction Set -...

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

View Full Document Right Arrow Icon
Topic 3 MIPS Instruction Set - Instruction Coding & Addressing Mode
Background image of page 1

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

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 2 Representing Instructions ± Instructions are encoded in binary ± Called machine code ± MIPS instructions ± Encoded as 32-bit instruction words ± Stored in 32-bit long memory locations ± Small number of formats encode operation code (opcode), register numbers, … ± Regularity!
Background image of page 2
Chapter 2 — Instructions: Language of the Computer — 3 Representing Instructions ± Three formats (types) to represent MIPS instructions ± R-type (register) ± I-type (immediate) ± J-type (jump)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 4 R-format ± Instruction fields ± op: operation code (opcode) ± rs: first source register number ± rt: second source register number ± rd: destination register number ± shamt: shift amount (00000 for now) ± funct: function code (extends opcode) op rs rt rd shamt funct 6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
Background image of page 4
Chapter 2 — Instructions: Language of the Computer — 5 R-format Example add $t0, $s1, $s2 Special $s1 $s2 $t0 0 add 0 17 18 8 0 32 000000 10001 10010 01000 00000 100000 00000010001100100100000000100000 2 = 02324020 16 MIPS Reference Data op rs rt rd shamt funct 6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
Background image of page 5

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

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 6 I-format ± 16-bit immediate number or address ± rs: source or base address register ± rt: destination or source register ± Constant: –2 15 to +2 15 –1 ± Address: offset added to base address in rs ± Design Principle 4: Good design demands good compromises ± Different formats complicate decoding, but allow 32-bit instructions uniformly ± Keep formats as similar as possible op rs rt constant or address 6 bits 5 bits 5 bits 16 bits
Background image of page 6
Chapter 2 — Instructions: Language of the Computer — 7 I-format Example 1 addi $t0, $s0, 4 op $s0 $t0 4 C 16 8 4 001100 10000 01000 0000000000000100 00110010000010000000000000000100 2 = 32080004 16 op rs rt constant or address 6 bits 5 bits 5 bits 16 bits
Background image of page 7

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

View Full DocumentRight Arrow Icon
I-format Example 2 lw $t0, 4($s0) op $s0 $t0 4 23 16 8
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/14/2011 for the course EE 270/370 taught by Professor Gangzheng during the Fall '11 term at Shanghai Jiao Tong University.

Page1 / 29

L3 Instructions_2_ - Topic 3 MIPS Instruction Set -...

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

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