Professional Documents
Culture Documents
Selected
Advanced
Module Topics of
VLSI Design
VLSI Design
o Binary àr=2
o Ternary àr=3
o Octal àr=8 𝒂𝒂𝒊𝒊 ∈ 𝟎𝟎, 𝟏𝟏, … , 𝒓𝒓 − 𝟏𝟏
o Decimal à r = 10
o Hexadecimal à r = 16
● The value V(A) of the number A is given by the sum of the n partial
products pi for each of its positions
● The partial product pi = ai ∙ri results from the multiplication of the digit ai
with its weight ri, which is a power of the radix r and determined by the
position index i
● Real numbers contain n digits for the integer part and m digits for the
fractional part
𝑛𝑛−1
3
#𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 = 𝑙𝑙𝑙𝑙𝑙𝑙2 𝑉𝑉 + 1
2
1
1 2 3 4 5 6 7 V
28.03.2018 Selected Topics of VLSI Design 10
1.2 Signed Number Representations
● Positional notation as discussed above only covers positive numbers
● For negative number different signed number representations (SNRs)
options exist
● SNR #1: Sign Magnitude (SM)
o Insert sign bit at an-1 before magnitude of number
o Positive number à an-1 = 0 and Negative number à an-1 = 1
𝑛𝑛−2
𝐴𝐴+ = 0 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1 𝑎𝑎0
V 𝐴𝐴𝑆𝑆𝑆𝑆 = −1 𝑎𝑎𝑛𝑛−1 � � 𝑎𝑎𝑖𝑖 � 𝑟𝑟 𝑖𝑖
𝐴𝐴− = 𝑟𝑟 − 1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1 𝑎𝑎0
𝑖𝑖=0
𝑟𝑟 − 1 𝑛𝑛−1
𝑎𝑎𝑛𝑛−1 −
V 𝐴𝐴𝑟𝑟−1 = − 2 � 𝑟𝑟 𝑛𝑛 − 1 + � 𝑎𝑎 � 𝑟𝑟 𝑖𝑖
𝑖𝑖
𝑟𝑟 − 1
𝑖𝑖=0
● A signed integer number A has a range of: 𝑟𝑟 𝑛𝑛−1 < V 𝐴𝐴𝑟𝑟−1 < 𝑟𝑟 𝑛𝑛−1
● Same pros and cons as SM
𝑟𝑟 − 1 𝑛𝑛−1
𝑎𝑎𝑛𝑛−1 −
V 𝐴𝐴𝑟𝑟 = − 2 � 𝑟𝑟 𝑛𝑛 + � 𝑎𝑎 � 𝑟𝑟 𝑖𝑖
𝑖𝑖
𝑟𝑟 − 1
𝑖𝑖=0
● A signed integer number A has a range of: 𝑟𝑟 𝑛𝑛−1 ≤ V 𝐴𝐴𝑟𝑟 < 𝑟𝑟 𝑛𝑛−1
● + Identical treatment of positive and negative numbers in arithmetic
circuits, e.g., adders; unique representation of zero
● - Asymmetrical range
𝑟𝑟 − 1
𝑎𝑎𝑖𝑖 ∈ −𝛼𝛼, … , −1,0,1, … , 𝛽𝛽 𝑤𝑤𝑤𝑤𝑤𝑤𝑤 ≤ 𝛼𝛼, 𝛽𝛽 ≤ 𝑟𝑟 − 1
2
o α and β must cover at least half of the interval defined by the radix
𝑛𝑛−1
● Such RBRs are called Canonical Signed Digits (CSD) and the
conversion strategy is CSD-Recoding
r=2 à 0 0 0 1 1 0 0 1 0 0 1 0
r=4 à 0 1 2 1 0 2
𝐴𝐴𝑟𝑟 = 𝑎𝑎𝑛𝑛−1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1 𝑎𝑎0 à 𝐴𝐴𝑆𝑆𝑆𝑆 = −𝑎𝑎𝑛𝑛−1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1 𝑎𝑎0
cn FA FA ... FA FA c0
sn-1 sn-2 s1 s0
an-1 bn-1 an-2 bn-2 a1 b 1 a0 b0 c0
HA HA ... HA HA
𝑛𝑛−1
′ ′
𝑐𝑐𝑛𝑛 𝑐𝑐𝑛𝑛−1 𝑐𝑐𝑛𝑛−2 … . 𝑐𝑐1′ 𝑐𝑐0
● 𝑉𝑉(𝐴𝐴𝐶𝐶𝐶𝐶 ) = � ′ ′
+ 𝑠𝑠𝑛𝑛−1 𝑠𝑠𝑛𝑛−2 … . 𝑠𝑠1′ 𝑠𝑠0
Ar à ASD T ~ O(1)
● Assume
o Given: 𝐴𝐴 = 𝑎𝑎𝑛𝑛−1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1 𝑎𝑎0 . 𝑎𝑎−1 … 𝑎𝑎−𝑑𝑑 à Cut 𝑑𝑑 bits
o Rounded: 𝐵𝐵 = 𝑏𝑏𝑛𝑛−1 𝑏𝑏𝑛𝑛−2 … 𝑏𝑏1 𝑏𝑏0 = 𝐴𝐴 + 𝜀𝜀 ⇒ 𝜀𝜀 = 𝐵𝐵 − 𝐴𝐴
o Goal: Minimize rounding error 𝜀𝜀
4
3
2
1
A
1 2 3 4 5
3/28/2018 Selected Topics of VLSI Design 29
1.3 Rounding can be often incorporated
effortlessly into previous operation
● Rounding Method #2: Round-to-Nearest
o Step 1: Addition of 0.510 to 𝐴𝐴 ⇒ 𝐴𝐴′ = 𝐴𝐴 + 0.510 = 𝐴𝐴 + 0.12
o Step 2: 𝑑𝑑 least significant bits are cut off from 𝐴𝐴′ to fit 𝐵𝐵
o Resulting effect is an alternate rounding to higher & lower numbers
′ ′
o Rounding result à 𝐵𝐵𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = 𝑎𝑎𝑛𝑛−1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1′ 𝑎𝑎0′
o Minimum error à 𝜀𝜀𝑚𝑚𝑚𝑚𝑚𝑚 = 0.00000 (for A=0.0 à B=0.0)
o Maximum error à 𝜀𝜀𝑚𝑚𝑚𝑚𝑚𝑚 = 2−1 = 0.1 (for A=0.1 à B=1.0)
𝜀𝜀𝑚𝑚𝑚𝑚𝑚𝑚 −𝜀𝜀𝑚𝑚𝑚𝑚𝑚𝑚 2−1
o Average error à 𝜀𝜀𝑎𝑎𝑎𝑎𝑎𝑎 = 2
= 2
= 2−2 = 0.01
o Smaller asymmetrical bias (due to always rounding up of A=0.1)
B
4
3
2
1
A
1 2 3 4 5
28.03.2018 Selected Topics of VLSI Design 30
1.3 Rounding Idea: alternate rounding up and
down to nearest even number
● Rounding Method #3: Round-to-Nearest-Even
o Step 1: Addition of 0.510 to 𝐴𝐴 ⇒ 𝐴𝐴′ = 𝐴𝐴 + 0.510 = 𝐴𝐴 + 0.12
o Step 2: 𝑑𝑑 least significant bits of 𝐴𝐴′ are zero à cut off from 𝐴𝐴′ to fit 𝐵𝐵 and
set 𝑎𝑎0′ to zero, otherwise proceed with Round-to-Nearest
o Yields average bias of zero!
′ ′
𝐵𝐵𝑟𝑟𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 𝑖𝑖𝑖𝑖 𝑎𝑎−1 … 𝑎𝑎−𝑑𝑑 ≠ 0.000 …
o à 𝐵𝐵𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟,𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 =� ′ ′
𝑎𝑎𝑛𝑛−1 𝑎𝑎𝑛𝑛−2 … 𝑎𝑎1′ 0 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒
o à 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 = 0
o Symmetrical error and bias-free, mandatory in IEEE Floating Point
4
3
2
1
1 2 3 4 5
28.03.2018 Selected Topics of VLSI Design 31
1.4 Overflow
● Overflow occurs if numbers exceed available word length in datapaths
000...0
011...1
100...0
111...1
-2 n-1 0 2 n-1 2n
unsigned
2´s complement
1´s complement
sign magnitude
● Pseudo overflow correction needs less digits and chip area than
uncorrected formats
1 N pseudo 1
o Real overflow must be avoided
1 0 potential through modification at the
system or algorithm level
1 1 real
N N real o Potential overflow would require
N 0 potential an inspection of all lower digits
à Hardware costs increase
N 1 pseudo N
0 X none 𝑠𝑠𝑛𝑛−1 o Potential overflow avoidable via
range limitation to < 2𝑛𝑛−2
Operation
left 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎 𝟎𝟎
unsigned
right 𝟎𝟎𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏
Shift
signed left 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟑𝟑 … 𝒂𝒂𝟎𝟎 𝟎𝟎
2‘s complement right 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟏𝟏 … 𝒂𝒂𝟏𝟏
left 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎 𝒂𝒂𝒏𝒏−𝟏𝟏
Rotate
right 𝒂𝒂𝟎𝟎 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏
left 𝟎𝟎𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎
unsigned
right 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎 𝟎𝟎
Extend
signed left 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎
2‘s complement right 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟐𝟐 … 𝒂𝒂𝟏𝟏 𝒂𝒂𝟎𝟎 𝟎𝟎
unsigned 𝒂𝒂𝒏𝒏−𝟏𝟏 … 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟏𝟏
Saturate
signed 2‘s complement 𝒂𝒂𝒏𝒏−𝟏𝟏 𝒂𝒂𝒏𝒏−𝟏𝟏 … 𝒂𝒂𝒏𝒏−𝟏𝟏
z3
zn-1
3/28/2018 Selected Topics of VLSI Design 43
1.6 Cost/Performance Estimation Basics
o Recursive functions with multiple outputs
Prefix problem à 𝑧𝑧𝑖𝑖 = 𝑓𝑓 𝑎𝑎𝑖𝑖 , 𝑧𝑧𝑖𝑖−1
Case 1: f non-associate à 𝐴𝐴 = 𝑂𝑂 𝑛𝑛 and 𝑇𝑇 = 𝑂𝑂 𝑛𝑛 (serial)
Case 2: f associative à 𝐴𝐴 = 𝑂𝑂 𝑛𝑛2 and 𝑇𝑇 = 𝑂𝑂 𝑙𝑙𝑙𝑙𝑙𝑙2 (𝑛𝑛) (multi tree / serial)
Case 3: f associative à 𝐴𝐴 = 𝑂𝑂 𝑛𝑛 ⋅ 𝑙𝑙𝑙𝑙𝑙𝑙2 (𝑛𝑛) and 𝑇𝑇 = 𝑂𝑂 𝑙𝑙𝑙𝑙𝑙𝑙2 (𝑛𝑛) (shared)
a3 a2 a1 a0 a3 a2 a1 a0
in
parallel
z3 z2 z1 z0 z3 z2 z1 z0