Professional Documents
Culture Documents
843 Cours 1 2
843 Cours 1 2
• Addition signés/unsigned
• Le calcul en virgule fixe/flottante
• Multiplicateurs rapides
• DSP: filtre FIR et FFT
• FPGA - DSP/DSP/GPU
Représentation data
𝐴 = 𝑎𝑖 2𝑖 𝐴 = − 𝑎𝑖 2𝑖 𝑠𝑖 𝑎𝑛−1 = 1
𝑖=0 𝑖=0
• C2:
𝑛−2
𝐴 = −2𝑛−1 𝑎𝑛−1 + 𝑎𝑖 2𝑖
𝑖=0
Unsigned integer Signed integer (C2)
000 0 0
001 1 1
010 2 2
011 3 3
100 4 -4
101 5 -3
110 6 -2
111 7 -1
0 2𝑛 − 1
−2𝑛−1 2𝑛−1 − 1
Représentation data
Nombre réel: virgule fixe ou flottante
virgule fixe
𝑛−1
𝐴 = 𝑎𝑖 2𝑖
𝑖=0
3 2 1 0 -1 -2 -3 -4
1 1 0 1. 0 1 0 1
Représentation data
virgule fixe
Représentation data IEEE-754: virgule flottante
virgule flottante
𝑠
𝐴 = −1 × 𝑚 × 2𝑒 IEEE-754: précision simple
m: mantisse codée n+1
e: exposant 𝑒 ∈ 𝑒𝑚𝑖𝑛 , 𝑒𝑚𝑎𝑥 : k-bit 1 bit 8 bits 23 bits
s: signe s e m
𝐴 = 1. 𝑎1 𝑎2 ⋯ 𝑎𝑛 : mantisse normalisée
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 1 bit 11 bits 52 bit
s e m
𝐴 = 1. 𝑎1 𝑎2 ⋯ 𝑎𝑛 → 𝐴 = 1 + 𝑓
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛
𝑒𝑏 = −4 → 𝑒 = 𝑒𝑏 + 𝑏 = −4 + 127 = 123
𝑒 ∈ 0,255 , 𝑒𝑏 ∈ −127,128 ,
𝑏 = 127
Représentation data IEEE-754: virgule flottante
virgule flottante
𝑠
𝐴 = −1 × 𝑚 × 2𝑒 IEEE-754: précision simple
m: mantisse codée n+1
e: exposant 𝑒 ∈ 𝑒𝑚𝑖𝑛 , 𝑒𝑚𝑎𝑥 : k-bit 1 bit k=8 bits n+1=23 bits
• Positif, négatif: C2, biaisée s e m
𝐴 = 1. 𝑎1 𝑎2 ⋯ 𝑎𝑛 → 𝐴 = 1 + 𝑓
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛
15213.0 = 11101101101101
• Normalisé: A = 1 + 𝑚 = 1. 𝑚 → 1.1101101101101 × 213 (écriture mathématique) → 𝑒𝑏 = 13
• 𝑏 = 2𝑘−1 =127 (SP: simple precision)
• 𝑒 = 𝑒𝑏 + 𝑏 = 13 + 127 = 140 (exposant pour l’écriture machine)
Représentation data
SP: 00010100000101000000000000000000
𝑒 = 𝑒𝑏 + 𝑏 = 40 → 𝑒𝑏 = 𝑒 − 𝑏 = 40 − 127 = −87
m = 001 0100 0000 0000 0000 0000 = 00101= 1 × 2−3 + 1 × 2−5 = 0.125 + 0.03125 = 0.15625
s 0 1 0 1
RCA 6 bits
Addition
Carry Select Adder (CSA) Partitionner a et b en deux partie:
• aL + bL = sL + rL
• aH + bH = sH + rH
𝑂 𝑛 =𝑛𝜖
𝑂 log 2 𝑛 = (log 2 𝑛) 𝜖
𝑛=8 𝑂 𝑛 =8𝜖
𝑂 log 2 𝑛 = 3𝜖
𝑛 = 128
𝑂 𝑛 = 128 𝜖
𝑂 log 2 𝑛 = 7𝜖
Addition
anticipation de la retenue:
• Génération de la retenue seulement qd r=1
• Propagation optimale
Addition
𝑟𝑖+1 = 𝑎𝑖 . 𝑏𝑖 + 𝑎𝑖 . 𝑟𝑖 + 𝑏𝑖 . 𝑟𝑖
𝑖 = 2 → 𝑟3 = 𝑎2 . 𝑏2 + 𝑎2 . 𝑟2 + 𝑏2 . 𝑟2
n=32 bits -> 4 milliard de termes
𝑖 = 1 → 𝑟2 = 𝑎1 . 𝑏1 + 𝑎1 . 𝑟1 + 𝑏1 . 𝑟1 𝑐32
𝑟3 = 𝑎2 . 𝑏2 + (𝑎2 + 𝑏2 ). 𝑎1 . 𝑏1 + 𝑎1 . 𝑟1 + 𝑏1 . 𝑟1
𝑖 = 0 → 𝑟1 = 𝑎0 . 𝑏0 + (𝑎0 +𝑏0 ). 𝑟0
a b r s
0 0 0 c génération
1 1 1 c génération
0 1 c 𝑐ҧ propagation
1 0 c 𝑐ҧ propagation
𝑝𝑖 = 𝑎𝑖 ⨁𝑏𝑖
𝑟𝑖+1 = 𝑔𝑖 + 𝑝𝑖 . 𝑟𝑖
𝑔𝑖 = 𝑎𝑖 . 𝑏𝑖 𝑠𝑖 = 𝑟𝑖 ⨁𝑝𝑖
Soustraction
𝑛−2 𝑛−2
Addition ->
𝐵 + 𝐵ത = 1111 ⋯ 1111 = −2𝑛−1 × 1 + 1 × 2𝑖 = −2𝑛−1 + 2𝑖 = −1
𝑖=0 𝑖=0
𝐴 − 𝐵 = 𝐴 + (−𝐵) 𝐵 + 𝐵ത = −1 → −𝐵 = 𝐵+1
ത (C2)