V22.0436  Prof. Grishman
Lecture 9  MIPS instruction set; MIPS ALU
MIPS architecture, cont'd (text, chapter 3)
Review basic MIPS instructions (chart in text, endpaper)

uniform 2operand arithmetic and logical instructions

32 registers, referred to in assembly language as $0 ... $31, or by names
indicating typical uses, such as $s0 ... $s7 (see Figure 3.13, p. 140 for
a full list)

use of register 0 ($zero) as constant 0

byteaddressable memory

twoinstruction sequence for branch on less than
(assembler provides single pseudoinstruction)
Sharp contract with CISC (complex instruction set) architectures such as
the Intel 80x86 (sec. 3.12)

historical requirements of upward compatibility with earlier machines led
to complex design (8080 > 8086 > 80286 > 80386 > 80486 > Pentium >
MMX etc.)

almost every register has some special properties

operands for instructions can come from memory or register; result can
be store to memory or register

multiple operand sizes; multiple instruction lengths

complex machine design
Will return to performance issues later in semester
MIPS Simulator
Hennesey & Patterson provide a simulator for MIPS, called SPIM;
the version for Windows is PCSpim. It is available for download (see
page xviii of the text). It has also been installed on the "A" and
"B" machines at 14 Washington Place, where it is available in the folder
C:\WIN95\desktop\Applications\Course Specific Applications\PCSpim for
Windows
The simulator is described in Appendix A, section A9.
MIPS ALU (text, section 4.5)
An ALU (arithmeticlogical unit) is a combinational circuit capable of
computing a variety of arithmetic and logical functions.

operations needed for MIPS instructions discussed so far: add, subtract,
and, or, zero test, comparison [MIPS also has nor, xor; multiply and divide]

general strategy: different circuits combined by multiplexer; multiplexer
select becomes function select for ALU

inverting B input for subtraction

feed output of highorder bit of adder to loworder bit for "set on less"
operation

use OR gate on ALU output for "equal" test
Carry lookahead: introduction

simplest adder is "ripple carry": slow (delay time linear in size of operands)

add time is usually critical in determining overall cycle time of a machine

can speed up addition by introducing notion of "carry generate" and "carry
propagate"
Spring 1999