0% found this document useful (0 votes)
37 views5 pages

The Role of Arithmetic: EE 486 Winter 02-03

This document discusses different number representation systems used in computer arithmetic. It describes weighted positional number systems and residue number systems for representing integers. It also discusses sign representation methods like sign-magnitude and two's complement, and how they allow for representing negative numbers. Redundant number representations that allow for carry-free addition are also introduced. The document provides details on how different number systems approach operations like addition, subtraction, multiplication and division.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

The Role of Arithmetic: EE 486 Winter 02-03

This document discusses different number representation systems used in computer arithmetic. It describes weighted positional number systems and residue number systems for representing integers. It also discusses sign representation methods like sign-magnitude and two's complement, and how they allow for representing negative numbers. Redundant number representations that allow for carry-free addition are also introduced. The document provides details on how different number systems approach operations like addition, subtraction, multiplication and division.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EE 486

Winter 02-03

The role of arithmetic


With increasing circuit density available with sub micron feature sizes, theres a corresponding broader spectrum of arithmetic implementations, Signal processors, controllers, wireless dsp, crypto, etc.

EE 486 : lecture 1, the integers


M. J. Flynn

Computer Architecture & Arithmetic Group

Stanford University

Computer Architecture & Arithmetic Group

Stanford University

SIA Roadmap - 1
Total Transistors per Chip
Frequency (in MHz)
25000
No. of Transistors (in million)

SIA Roadmap - 2
On-Chip Clocks
16000 14000 12000 10000 8000 6000 4000 2000 0 180nm 2001 130nm 2003 100nm 2005 70nm 2008 50nm 2011 35nm 2014

20000 15000 10000 5000 0 180nm 2001 130nm 2003 100nm 2005 70nm 2008 50nm 2011 35nm 2014

Technology / Year of First Shipment

Technology / Year of First Shipment

Computer Architecture & Arithmetic Group

Stanford University

Computer Architecture & Arithmetic Group

Stanford University

Semiconductor Industry Roadmap


Semiconductor Technology Roadmap (1999) Year Technology generation (nm) Wafer size (mm) 2 Defect density (per m ) 2 P die size (mm ) Chip Frequency (MHz) MTx per Chip (Microprocessor) Max Power (W) 2001 180 300 1742 450 1767 220 115 2005 100 300 1262 622 3500 882 160 2008 2014 70 35 300 450 1101 837 713 937 6000 13500 2494 19949 170 183

Some term used in number representation


The integers: weighted positional number system: wpns, residue number system: rns and log number system: lns Floating point(fpns): IEEE and specialized formats Redundant number representation rnr. This can be used in any number system. Optimized representations: log, exponential, continued fraction, etc
Computer Architecture & Arithmetic Group 6 Stanford University

Computer Architecture & Arithmetic Group

Stanford University

M J Flynn

EE 486

Winter 02-03

The integers
Weighted positional number system (wpns)
Non redundant and redundant forms X = d00 + d11 + + dn-1 n-1 where is the radix and {di} is the digit set If number of symbols in digit set {di} = then we have non redundant system If number of symbols in digit set {di} > then we have redundant system

The integers
In general redundant numbers can offer some advantages, such as carry free addition. The Roman Numeral system is a redundant system if one allows for the use of improper forms. The only redundant system of interest to us is the signed digit system (sds) which well consider later.
Computer Architecture & Arithmetic Group 8 Stanford University

Computer Architecture & Arithmetic Group

Stanford University

WPNS and RNS (non-redundant)


The residue number system uses n relatively prime moduli and defines each digit independently as di = X mod mi Two types :optimal and binary based
Optimal : rns system whose largest modulus (mn) is the smallest possible to provide a required representation capacity Binary : largest modulus of the form 2n and all others of the form 2n-i-1
Computer Architecture & Arithmetic Group 9 Stanford University

bn

{i}, the integers

{m}, Machine Nos.

Mapping the integers onto the machine numbers: m = i mod n

Computer Architecture & Arithmetic Group

10

Stanford University

The machine numbers


The integers, I, map onto the machine numbers, M. I: i m M, i mod n m, o The residue, m, is the least positive remainder, o is overflow Modular operations:
(m+n) mod M =(m mod M+n mod M) mod M (m-n) mod M =(m mod M - n mod M) mod M (mxn) mod M =(m mod M x n mod M) mod M
Computer Architecture & Arithmetic Group 11 Stanford University

The negative numbers


2M
n 1 is max

Nos in the same residue class M

0 Negative nos.

0 is min

Computer Architecture & Arithmetic Group

12

Stanford University

M J Flynn

EE 486

Winter 02-03

Representing negative numbers


Sign and magnitude (s+m) Radix complement (rc), diminished radix complement (drc). (2M - x) mod 2M= -x Where 2M = n for rc and 2M = n 1 for drc; in binary n is the number of bits in a word, the representational capacity: max positive = 2n-1; min = 0 (rc) and max positive = 2n-1 1; min = 0 (drc)
Computer Architecture & Arithmetic Group 13 Stanford University

The negative numbers: complements


The complement of x is 2M-x where 2M is n for rc or n 1 for drc. (x-y) mod 2M= (x +(2M y)) mod 2M = (x-y) mod 2M; result is a valid machine number if x and -y have opposite signs. Otherwise overflow, o, is possible and must be detected.

Computer Architecture & Arithmetic Group

14

Stanford University

S,sign Cout Cin Result bits

Overflow detection
Cout Overflow 0 0 1 1 0 1 no yes no yes no, x>y no, y>x
Computer Architecture & Arithmetic Group 16 Stanford University

x
Signs +=0 -=1

Cin signs 0 0 0 0 1 1
15

Overflow, o is detected when o = Cin V Cout

0 0 1 1 1 1

0 0 1 1 0 0

0 1 1 0 0 1

Computer Architecture & Arithmetic Group

Stanford University

Finding the radix (2s)complement


Suppose that i is the first non zero bit in X, then for all xj, i > j > r = 0; rc (xj) = xj = 0. For bit i rc(xi) = ( xi) = xi = 1 For bits j > i, rc (xj) = 1 xj (inversion).

Finding the radix (2s)complement


Y +/- X Cin n +1 bit adder

V Y
Computer Architecture & Arithmetic Group 17 Stanford University Computer Architecture & Arithmetic Group

X
18

Sign of X
Stanford University

M J Flynn

EE 486

Winter 02-03

Finding the diminished radix (1s) complement


For all bits i; drc (xi) = 1 xi So the drc is just the bit wise complement of X. But since a n ALU is used we must correct the result so that it is mod (n 1). I.e. we want to stay in the drc number system but our ALUs are in a radix based system.

Fixing up a radix based result so that it remains in the drc.


If radix result (RR) RR< n-1 then DRR=RR nothing need be done. If radix result RR= n-1 then DRR=0 If RR> n-1 then DR= RR + [RR/ (n-1)]

Computer Architecture & Arithmetic Group

19

Stanford University

Computer Architecture & Arithmetic Group

20

Stanford University

drc radix result fix up


X Y

Integer multiply
n bits x n bits = 2n bits unsigned In s + m product is 2n-1 bits In 2s complement 2n is representable in n bits but the product 2n x 2n is not representable in 2n-1 bits

n ALU
RR correction Corrected result
Computer Architecture & Arithmetic Group 21 Stanford University

Computer Architecture & Arithmetic Group

22

Stanford University

Integer divide: a/b=q+r/b


In division result q has same sign as a, the dividend, but the result is a (q,r) pair and thus not unique. While (a) can be 2n bits, (b,q and r) are n bits.
If magnitude q is the same regardless of the signs of a,b result is signed division If r is always the lpr (least positive remainder, including 0) then the (q,r) result is modular division
Computer Architecture & Arithmetic Group 23 Stanford University

Division
x/y= q + r/y; any (q,r) satisfies this, so the division result has many correct results. : s signed division: select q so that the quotient is the same regardless of the signs of x,y. : m modular division: select q so that the remainder is always the least positive remainder. Many other forms:such as floor division, q closest integer to 0 and r is a signed remainder.

Computer Architecture & Arithmetic Group

24

Stanford University

M J Flynn

EE 486

Winter 02-03

shifts
Logical shifts: all bits shift (left or right). Arithmetic shifts: sign is fixed, other bits shift left or right.
Left shift by p multiplies by 2p; shift 0s into the lsb. Right shift by p divides by 2p; shift sign bit into the msb BUT be careful, the result depends on the complement coding used.

Integer divide
On arithmetic shift division results depend on the type of integer complement coding thats used.
If magnitude q is the same regardless of the signs of a,b result is signed division If r is always the lpr (least positive-incl 0 remainder) then (q,r) result is modular division 1s complement produces a signed (q,r) 2s complement produces a modular (q,r)
Computer Architecture & Arithmetic Group 26 Stanford University

Computer Architecture & Arithmetic Group

25

Stanford University

Redundant number representations (rnr)


Applicable to any number system. The signed digit number system offers carry free addition / subtraction SD numbers represent a number with radix >2 using digits {-,,1,0,1,2,} where /2 < < . Summing 2 digits pi = xi + yi. If pi exceeds then it is recoded as wi = pi with a carry of 1
Computer Architecture & Arithmetic Group 27 Stanford University

Redundant number representations (rnr)


Summing 2 digits pi = xi + yi. If pi exceeds then it is recoded as wi = pi with a carry of 1 Then the sum is si = wi + ci-1 The redundant condition assures that no carry will propagate more than a single digit As - + 1 < wi < 1 Extendable to binary, = 2; because of conversion not much used directly at least.

Computer Architecture & Arithmetic Group

28

Stanford University

M J Flynn

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy