Download presentation
Presentation is loading. Please wait.
1
VLSI Arithmetic
2
Multiplication A = a n-1 a n-2 … a 1 a 0 B = b n-1 b n-2 … b 1 b 0 eg) 1 1 0 0 1 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 1 1 0 0 1 1 Shift and addArea O(N) Time O(NlogN) Too slow
3
a n-1 a n-2 … a 1 a 0 b n-1 b n-2 … b 1 b 0 a n-1 a n-2 … a 1 a 0 b 0 = B 0 b 1 = B 1 b 2 = B 2 b n-1 = B n-1 a n-1 a n-2 … a 1 a 0 Sum
4
b0b0 b1b1 b n-1 2n bit processors Algorithm1. Broadcast A to n processors (log n time) 2. Compute B i (i=0, …, n-1) simultaneous 3. Compute sum (using redundant binary number) TimeO(logn) SpaceO(N 2 )
5
3M - multiplication (Why not 4M - multiplication?) P = X Y U = (X 1 +X 0 ) (Y 1 +Y 0 ) V = (X 1 Y 1 ) W = (X 0 Y 0 ) P = (X Y) = V 2 N + (U-V-W) 2 N/2 + W A = O(N 2 ) T = O(log N) Y Input distribution (X 1 + X 0 ) (Y 1 + Y 0 )X 1 Y 1 X 0 Y 0 X (X 1 + X 0 )(Y 1 + Y 0 ) Routing Adder (n) Output network recursively
6
Area, Time, Period Complexity, and Optimality Virsion Lower bound 4M 3M 2M, LABC Area N 2 N 2 log 2 N N 2 MN logN Time log N Period 1 AP 2 N 2 N 2 log 2 N N 2 MN logN AP 2 T 2 N 2 log 2 N N 2 log 4 N N 2 log 2 N MN log 3 N Remark -- Time-optimal Time, AP 2, and AP 2 T 2 optimal Time-optimal and regular layout
7
Redundant Binary Number (Signed Digit) where a i {0, 1, 1} Example. 1 1 0 1 1 1 = 2 5 - 2 4 + 2 2 + 2 1 - 2 0 1. Binary number is a redundant binary number 2. Note that 1 = 1 1 3. Redundant binary number Binary Number by subtraction (in log n time)
8
Example 1 1 1 0 1 = 10100 - 1001 = 15 Example addition 1 1 1 1 0 1 (5) 10 1 0 0 1 1 0(38) 10 + S = 0 1 1 0 1 1 (sum) 1 1 0 0 1 0 1 1 1 1 1 1 1
9
Addition (Subtraction): carry propagation is limited to one bit left Type 1 2 3 4 5 6 Augend a i 1 0 1 0 1 Augend b i 1 0 1 0 1 0 1 Carry 1 1 if there is carry 1 from lower end 0 otherwise 0 no carry 1, if there is a carry 1 from lower end 0, otherwise 1
10
SD addition rule table ai110011011ai110011011 bi101011101bi101011101 Next lower position a i-1, b i-1 if (1,0), (0,1), (1,1) else if (1,0), (0,1), (1,1) else ci1100101ci1100101 si0110110si0110110
11
Hardware for multiplication Mesh of Trees R0R0 R1R1 R2R2 R3R3 C3C3 C2C2 C1C1 C0C0 A A1 A2 A3 Number of PEs = O(n*n) Area (n 2 log 2 n) Multiplication A*B R i A shift i bit if b i 0 Column C i add logn bits Use redundant binary, add these numbers
12
Example of multiplication on mesh of trees with augmented mesh edges A=0111 B=1011 Consider only last 4 bits 1 0 R0R0 R1R1 R2R2 R3R3 C3C3 C2C2 C1C1 C0C0 A A1 A2 A3 1 1 1 111 00 1
13
Example of multiplication on mesh of trees C i contains the sum at most logn bits long Note that C i starts from i-th bit. So the k-th bit of C i is pipelined to the row i+k Each bit c i is computed at (i,i) The pipelined value will be added one by one using Redundant binary system in a constant step. Then the number is converted to a binary number Total: 2logn: R i 2logn : add to (i,i) location 2logn : covert to binary 1 0 R0R0 R1R1 R2R2 R3R3 C 3 =10 C 2 =10 C 1 = 10 C 0 =1 A A1 A2 A3 1 1 1 111 00 1
14
Integer Division Not as easy O(logn) algorithm exist with table look up Hardware circuit exist? => open question
15
Newton Rapson Method To solve f(x) = 0, To find, let Newton Rapson Method converges quadratically, That is, i+1 = i 2
16
Eg. When D = 4 set x 0 = 0.4 x 1 = 0.16 x 2 = 0.2176 x 3 = 0.245801 0 = 0.15 1 = 0.09 2 = 0.0324 3 = 0.004199 To get n precision reciprocal of D, we need logn iterations. 1st iteration: 1 digit correct 2nd iteration: 2didit correct 3rd iteration: 4 digit correct logn iterations: n digit correct
17
Proof that Newton Rapson Method converges quadratically. Let X be the solution of f(x) = 0. But where Since f(X) = 0, we have Thus, Since f”( ) is bounded and f’(x i ) is bounded, | i+1 | = c | i | 2, for some c For is bounded if D 0
18
Complexity Each *: O(logn) time to obtain n digit precision, O(logn) iteration => O(log 2 n) complexity A/D => A * (1/D) Question: logn algorithm for division?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.