Lecture3_Chap2A

# Lecture3_Chap2A - ECE/CSE 201 Spring 2009 Lecture 3...

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

1 ECE/CSE 201 Spring 2009 Lecture 3 Instruction set, arithmetic operations, operands, representations of integers Read: Sections 2.1-2.5

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

View Full Document
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
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
4 Instructions: MIPS instruction set architecture similar to other architectures developed since the 1980's Almost 100 million MIPS processors manufactured in 2002 used by NEC, Nintendo, Cisco, Silicon Graphics, Sony, … 1400 1300 1200 1100 1000 900 800 700 600 500 400 300 200 100 0 1998 2000 2001 2002 1999 Other SPARC Hitachi SH PowerPC Motorola 68K MIPS IA-32 ARM
5 Arithmetic Operations Add and subtract, three operands Two sources and one destination add a, b, c # a = 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

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

View Full Document
6 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
7 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 preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 Register Names in MIPS Assembly Language MIPS convention for register names ÍÎ register numbers. name \$number binary usage \$zero \$0 00000 constant 0 \$v0-\$v1 \$2-\$3 00010-00011 results \$a0-\$a3 \$4-\$7 00100-00111 arguments \$t0-\$t7 \$8-\$15 01000-01111 temporaries \$s0-\$s7 \$16-\$23 10000-10111 saved Hint: to make it easier to remember “\$t” registers start at 8, “\$s” registers start at 16
9 Register Operand Example C code: f = (g + h) - (i + j); f, …, j in \$s0, …, \$s4 Compiled MIPS code: add \$t0, \$s1, \$s2 add \$t1, \$s3, \$s4 sub \$s0, \$t0, \$t1

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

View Full Document
10 Registers vs. Memory Processor I/O Control Datapath Memory Input Output Arithmetic instructions operands must be registers, — only 32 registers provided Compiler associates variables with registers What about programs with lots of variables
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 39

Lecture3_Chap2A - ECE/CSE 201 Spring 2009 Lecture 3...

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

View Full Document
Ask a homework question - tutors are online