Pipelined MIPS Processor - Computer Architecture - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Computer Architecture which includes Machines Address Memory, Notes About Memory, Assembly Language Programmer, Instruction Support for Functions, Jump Register, Nested Procedures, Register Values, Memory Organization etc. Key important points are: Pipelined Mips Processor, Machine Language, Execution of Machine Instructions, Instruction Decode, Arithmetic-Logic Unit, Addition and Subtraction, Logical Operations, Unsigned Numbers

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhimant
dhimant 🇮🇳

4.3

(8)

128 documents

1 / 36

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Arithmetic I
CPSC 350
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24

Partial preview of the text

Download Pipelined MIPS Processor - Computer Architecture - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Arithmetic I

CPSC 350

What happened so far?

  • We learned the basics of the MIPS assembly

language

  • We briefly touched upon the translation to

machine language

  • We formulated our goal, namely the

implementation of a MIPS processor.

Welcome to the Future!

The execution of machine instructions can

follow, for example, the steps:

  • Instruction fetch
  • Instruction decode and register read
  • Execute opn. or calculate an address
  • Access operand in data memory
  • Write the result into a register

Pipelined MIPS Processor

We concentrate first on the arithmetic-logic unit

Computer Arithmetic

Unsigned Numbers

  • 32 bits are available
  • Range 0..2 32 -
  • 11012 = 2^3 +2 2 +2 0 = 13 10
  • Upper bound 2 32 –1 = 4,294,967,

Number representations

What signed integer number

representations do you know?

Signed Numbers

  • Sign-magnitude representation
    • MSB represents sign, 31bits for magnitude
  • One’s complement
    • Use 0..2 31 -1 for non-negative range
    • Invert all bits for negative numbers
  • Two’s complement
    • Same as one’s complement except
    • negative numbers are obtained by inverting all bits and adding 1

Two’s Complement

Suppose we want to express -30 as an 8bit integer in two’s complement representation.

30 = 0001 1110 (^2)

Invert the bits to obtain the negative number:

1110 0001 (^2)

Add one:

-30 = 1110 0010 (^2)

Advantages and Disadvantages

  • sign-magnitude representation
  • one’s complement representation
  • two’s complement representation

Two’s complement

  • The unsigned sum of an n-bit number and its

negative yields?

  • Example with 3 bits:
    • (^011 )
    • (^101 )
    • 1000 2 = 2 n^ => negate(x) = 2n-x
  • Explain one’s complement

MIPS 32bit signed numbers

0000 0000 0000 0000 0000 0000 0000 0000two = 0ten 0000 0000 0000 0000 0000 0000 0000 0001two = +1ten 0000 0000 0000 0000 0000 0000 0000 0010two = +2ten ... 0111 1111 1111 1111 1111 1111 1111 1110two = +2,147,483,646ten 0111 1111 1111 1111 1111 1111 1111 1111two = +2,147,483,647ten 1000 0000 0000 0000 0000 0000 0000 0000two = –2,147,483,648ten 1000 0000 0000 0000 0000 0000 0000 0001two = –2,147,483,647ten 1000 0000 0000 0000 0000 0000 0000 0010two = –2,147,483,646ten ... 1111 1111 1111 1111 1111 1111 1111 1101two = –3ten 1111 1111 1111 1111 1111 1111 1111 1110two = –2ten 1111 1111 1111 1111 1111 1111 1111 1111two = –1ten

Conversions

  • Suppose that you have 3bit two’s complement

number

  • Convert into a 6bit two’s complement number
    • 111101 2 = -
  • Replicate most significant bit!

Comparisons

What can go wrong if you accidentally

compare unsigned with signed numbers?