vlsi signal processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · vsp lecture9 -...

39
VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-1 VLSI Signal Processing VLSI Signal Processing VLSI Signal Processing Lecture 9 Redundant Arithmetic Lecture 9 Redundant Arithmetic

Upload: others

Post on 09-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-1

VLSI Signal ProcessingVLSI Signal ProcessingVLSI Signal ProcessingLecture 9 Redundant ArithmeticLecture 9 Redundant Arithmetic

Page 2: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-2

Redundant?• A non-redundant radix-r number has digits from the set

{0,1,…,r-1} and all numbers can be represented in a uniqueway

• A radix-r redundant signed-digit number system is based on digit set S≡{-β,…,-1,0,1,…,α}, where 1≤β,α≤r-1

• The digit set S contains more than r values multiple representations for any number in signed digit format. Hence, the name redundant

• A symmetric signed digit has α=β.• Carry-free addition is one of the most attractive properties

of redundant signed-digit numbers. This allows most significant digit (MSD) first redundant arithmetic, also called on-line arithmetic (division..)

Page 3: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-3

1-1 onto Mapping?

r numbers

0

1

r-1

Digit set

0

α

-(β-1)

…-1

1

α-1

α+β+1 elements

Page 4: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-4

Redundant Number Representations• A symmetric signed-digit representation uses the digit set

D<r,α>={-α,…,-1,0,1,…, α}, where r is the radix and α the largest digit in the set.

• A number in this representation is written as: X<r,α>=xW-1◦xW-2…x1x0=∑xW-1-iri

• The sign of the number X is given by the sign of the most significant non-zero digit

• If 2α+1<r, the digit set D<r,α> is incomplete (i.e. some numbers cannot be represented)

• If 2α+1=r, the digit set D<r,α> is complete but not redundant• If 2α+1>r, the digit set D<r,α> is redundant

Page 5: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-5

Example• Signed-Digit Numbers X<r,α>=xW-1◦xW-2…x1x0=∑xW-1-iri

Page 6: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-6

Review of Canonical Signed Digit• Minimum number of non-zero bits• A sequence of ones can be replaced with

– A “-1” at the least significant position of the sequence

– A “1” at the position to the left of the most significant position of the sequence

– Zeros between the “1” and the “-1”

• Save more than 2/3 of the adder cells at an average

Page 7: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-7

Redundant Characteristics• Redundant factor

– A measure of the redundancy of a symmetric signed-digit representations : ρ = α/(r-1)

Page 8: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-8

Redundancy Characteristic Example

Page 9: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-9

Carry-Free ?• Redundant number representations limit the carry

propagation to a few bit-positions, which is usually independent of the wordlength W.

• + and -

Page 10: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-10

Radix-2 Signed-Digit Number

X = X+ - X-

Two unsigned binary numbers

Each signed digit is represented by 2 bits

Page 11: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-11

Redundant Arithmetic• X<r,α> = X+ - X-, Y<r,α> = Y+ - Y-

• Hybrid radix-r addition X<r,α> + Y• Hybrid radix-r subtraction X<r,α> - Y

• A signed-digit addition/subtraction can then be viewed as a concatenation of one hybrid addition/subtraction and one hybrid subtraction/addition

Page 12: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-12

Hybrid Radix-2 Addition

Page 13: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-13

Hybrid Radix-2 Addition

Pass to the next level

−+− −= iii uts 1

Plus-Plus-Minus

Binary code

pi =xi + yi = 2ti + ui

Page 14: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-14

Hybrid Radix-2 Adder• PPM: Plus-Plus-Minus adder (Full adder)

Page 15: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-15

Example• Eight-digit hybrid radix-2 adder

The sum has 9 digits !!

Page 16: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-16

Digit-Serial Arithmetic, LSDSerial I/O

Zero-latency !!One 8-digit addition takes 9 clock cycles

By Folding !!

Page 17: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-17

Digit-Serial Arithmetic, MSD

One clock cycle latency !!

Note: a zero digit needs to be inserted between 2 consecutive input operands

++1is −

+1is

Page 18: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-18

Hybrid Radix-2 Subtraction

-

subtraction

Page 19: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-19

Hybrid Radix-2 Subtraction

Pass to the next level

+−− +−= iii uts 1

Minus-Minus-Plus

Use negative transfer digit !!

Page 20: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-20

Remarks• {-1, 0, 1} – {0, 1} = {-2,-1, 0, 1}

−+ −= iii xxx iy

Pass to the next level

Page 21: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-21

Hybrid Radix-2 Subtractor• MMP: Minus-Minus-Plus adder (Full adder)

Page 22: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-22

Example• Eight-digit hybrid radix-2 subtractor

Page 23: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-23

Hybrid Radix-2 Addition/Subtraction

A/Sbar =1 for addition, A/Sbar =0 for subtraction

Page 24: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-24

Signed-Binary Digit (SBD) Arithmetic

Page 25: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-25

Signed Binary Digit Arithmetic• Y<r,α> = Y+ -Y-, is a signed digit number, where Y+ and Y- are

(unsigned conventional numbers) from the digit set {0,1,…,α}. • Signed addition is given by

S<r,α>=X<r,α> + Y<r,α>=(X<r,α>+Y+)-Y-

Page 26: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-26

Remarks• Signed-digit addition can be viewed as a concatenation of

one hybrid addition and one hybrid subtraction.• Digit-serial redundant adders can be derived by folding

methodology (LSD-first, or MSD-first)• LSD-first adders have zero latency, while MSD-first

adders have 2 clock cycles latency.

Page 27: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-27

Hybrid Radix-4 Addition• Higher order radices can be employed to

reduce the number of iteration cycles.• Maximally redundant hybrid radix-4

addition (MRHY4A) considers the numbers based on digit set D<4,3>={-3,-2,-1,0,1,2,3}, ρ=1

• Minimally redundant hybrid radix-4 addition (mrHY4A) considers the numbers based on digit set D<4,2>={-2,-1,0,1,2}, ρ=2/3

Page 28: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-28

MRHY4Aunsigned

Page 29: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-29

Digit Sets in MRHR4A

PPM

−−+−

+−−++− ====+=

+==+

iiiiiiiiiii

iiiii

ustsusustus

utpyx

,,, where,

4

12222

1

Pass to the next level

D<4,3>={-3,-2,-1,0,1,2,3},

Page 30: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-30

MRHY4A Adder Cell

2PPM (full) adders that perform the 2 grouped additions in parallel and reduce the number of bits from 6 to 4 with the weights.

Step 1

Page 31: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-31

4-Digit MRHY4A

Page 32: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-32

mrHY4A+ unsigned

Page 33: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-33

Digit Sets in mrHY4A

1

4

−+=+==+

iii

iiiii

tusutpyx

The digit number is represented by 3 bits !!

Pass to the next level

Full adder

D<4,2>={-2,-1,0,1,2}

Page 34: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-34

step1

step2

Page 35: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-35

Non-Redundant to Redundant Conversion

• The non-redundant input digit set can be considered as a subset of the redundant input digit set.

• Radix-2 representation: – A non-redundant number X=x3◦x2x1x0 can be converted

to a redundant number Y=y3◦y2y1y0, where each digit yi is encoded as yi

+ and yi- as shown below

Page 36: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-36

Non-Redundant to Redundant Conversion

• Radix-4 representation– X is a radix-4 complement number, whose digits xi’s are

encoded using 2 wires as xi = 2xi+2 + xi

+. Its corresponding maximally redundant number Y is encoded using yi=2yi

+2-2yi-2+yi

+-yi-. The sign digit x3 can take values

-3, -2, -1, or 0, and is encoded using x3=-2x3-2-x3

-.

Page 37: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-37

Page 38: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-38

Redundant to NonRedundant Converter

• In general, it is not possible to know the value of any of nonredundant digits until the least significant redundant digit become available

• Example– 10001

– 10001

(03333)4

(10001)4

To change the least significant digit from -1 to 1 causes all of the preceding (more significant) digits to be changed

Page 39: VLSI Signal Processingtwins.ee.nctu.edu.tw/courses/vsp_11_summer/lecture... · VSP Lecture9 - Redundant Arithmetic (cwliu@twins.ee.nctu.edu.tw) 9-26 Remarks • Signed-digit addition

VSP Lecture9 - Redundant Arithmetic ([email protected]) 9-39

If a redundant number is scanned msd-first and transformed to a nonredundant radix-4 format