3. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
ANR DEFIS
Projet ANR-11-INSE-008
DEsign of FIxed-point embedded Systems (DEFIS)
3/41
4. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
ANR DEFIS
Projet ANR-11-INSE-008
DEsign of FIxed-point embedded Systems (DEFIS)
Various partners :
Research : IRISA, LIRMM (DALI), CEA, LIP6
3/41
5. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
ANR DEFIS
Projet ANR-11-INSE-008
DEsign of FIxed-point embedded Systems (DEFIS)
Various partners :
Research : IRISA, LIRMM (DALI), CEA, LIP6
Industrial : Thales, InPixal
3/41
6. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
On the first hand... A filter
x[n]
z
b0
+
+
z
+
+
1
h(z) =
z
Pn
1+
b1
i=0
Pn
bi z
1
y[n]
+
b1
a1
b2
z
a2
1
b3
x[n]
1
a1
1
b2
z
y[n]
+
z
b1
z
+
1
a2
z
1
z
1
z
1
i
i=1 ai z
i
z
1
b3
1
z
a3
1
a3
Signal Processing
LTI filters: FIR or IIR
Its transfer function
Algorithmic relationship used to compute output(s) from
input(s), for example:
y (k) =
n
X
i=0
bi u(k
i)
n
X
ai y (k
i)
i=1
4/41
7. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
On the other hand... A target
...
±2
2
...
2
0
2
s
Hardware target (FPGA, ASIC) or software target (DSP,µC)
Using fixed-point arithmetic for di↵erent reasons:
no FPU
cost
size
power consumption
etc.
5/41
11. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Fixed-Point number
2m 2m
Xm
1
20
2
1
2`
X0
X
1
X`
w
Representation : X .2` with X = Xm Xm
1 ...X0 ...X` .
Format : determined by wordlength and fixed-point position,
and noted for example (m, `).
7/41
14. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Fixed-Point number
2m 2m
Xm
1
20
2
1
2`
X0
X
1
X`
w
Representation : X .2` with X = Xm Xm
1 ...X0 ...X`
Format : determined by wordlength and fixed-point position,
and noted for example (m, `)
Only the mantissa X is stored, the scale 2` is implicit
9/41
15. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Sum example
We want to compute 42 +
0
1
0
1
0
p
2 with an 8-bit operator :
1
0
0
1
0
84
0
1
1
0
1
0
90
s
10/41
16. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Sum example
We want to compute 42 +
0
1
0
0
1
1
0
2 with an 8-bit operator :
0
1
0
1
0
1
1
84
0
0
0
1
p
0
1
1
p
FxP8 (FxP8 (42) + FxP8 ( 2)) = FxP8 (84.2
0
1
2
0
86
1
+ 90.2
6)
=
10/41
17. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Sum example
We want to compute 42 +
0
1
0
0
1
1
0
2 with an 8-bit operator :
0
1
0
1
0
1
1
84
0
0
0
1
p
0
1
1
p
FxP8 (FxP8 (42) + FxP8 ( 2)) = FxP8 (84.2
84.2 1 + (90
5).2 1 = 86.2 1 = 43
p
FxP8 (42) + FxP8 ( 2) = 43.40625
0
1
2
0
86
1
+ 90.2
6)
=
10/41
18. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Sum example
We want to compute 42 +
0
1
0
0
1
1
0
2 with an 8-bit operator :
0
1
0
1
0
1
1
84
0
0
0
1
p
0
1
1
p
FxP8 (FxP8 (42) + FxP8 ( 2)) = FxP8 (84.2
84.2 1 + (90
5).2 1 = 86.2 1 = 43
p
FxP8 (42) + FxP8 ( 2) = 43.40625
0
1
2
0
86
1
+ 90.2
6)
=
10/41
19. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Fixed-Point Arithmetic
Fixed-Point number
2m 2m
Xm
1
20
2
1
2`
X0
X
1
X`
w
Representation : X .2` with X = Xm Xm 1 ...X0 ...X`
Format : determined by wordlength and fixed-point position,
and noted for example (m, `)
Only the mantissa X is stored, the scale 2` is implicit
Computation in finite precision implies errors.
Numerical degradations
quantization of the coe cients
round-o↵ errors in computations
11/41
20. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Filter
IIR Filter
Let H be the transfer function of a n
H(z) =
b0 + b1 z
1 + a1 z
1
th order IIR filter :
+ · · · + bn z
1 + ··· + a z
n
n
n
,
8z 2 C.
(1)
12/41
21. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Filter
IIR Filter
Let H be the transfer function of a n
H(z) =
b0 + b1 z
1 + a1 z
1
th order IIR filter :
+ · · · + bn z
1 + ··· + a z
n
n
n
,
8z 2 C.
(1)
There is a lot of di↵erent realizations for a filter :
Direct Form I, DF II, ⇢DF II transposed
State-Space realizations, -operator, LGS, LCW
parallel or cascade decompostion
...
Each realization needs its own parameters and therefore the impact
of FxP computation will depend on the realization.
12/41
22. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Filter
This filter is usually realized with the following algorithm
y (k) =
n
X
bi u(k
i)
i=0
n
X
ai y (k
i)
(2)
i=1
where u(k) is the input at step k and y (k) the output at step k.
We can see round-o↵ errors as the add of an error e(k) on the
output and only y † (k) can be computed.
y † (k) =
n
X
i=0
bi u(k
i)
n
X
ai y † (k
i) + e(k).
(3)
i=1
13/41
23. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Filter
u(k)
e(k)
H
He
y(k)
y(k)
+
y † (k)
y (k) , y † (k) y (k) can be seen as the result of the error
through the filter He :
He (z) =
1 + a1 z
1
1
+ · · · + an z
n
,
8z 2 C.
14/41
24. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Filter
u(k)
e(k)
H
He
y(k)
y(k)
+
y † (k)
y (k) , y † (k) y (k) can be seen as the result of the error
through the filter He :
He (z) =
1 + a1 z
1
1
+ · · · + an z
n
,
8z 2 C.
If the error e(k) is in [e; e], then we are able to compute
y such that y (k) is in [ y ; y ] :
y
=
y
=
y and
e +e
e e
|He |DC
kHe k`1
2
2
e +e
e e
|He |DC +
kHe k`1
2
2
14/41
25. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Objective
Objective:
Given an algorithm and a target, find the optimal implementation.
model the fixed-point algorithms
model the hardware resources (computational units, etc.)
evaluate the degradation
find one/some optimal implemented algorithm(s)
15/41
26. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Objective
From filter to code, global flow
algorithm
transformation
implementation
filter
set of equivalent
realisations
SIF
Realisation
choice
optimal realisation
Fixed-point
implementation
fixed-point
algorithm
language
Code
generation
code
sensibillity
mesures
multi-criteria
optimisation
16/41
27. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Objective
From filter to code, global flow
algorithm
transformation
implementation
filter
set of equivalent
realisations
SIF
Realisation
choice
optimal realisation
Fixed-point
implementation
fixed-point
algorithm
language
Code
generation
code
sensibillity
mesures
multi-criteria
optimisation
17/41
29. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
The only operations needed in filter algorithm computation are
sum-of-products:
n
X
S=
c i · xi
i=1
where ci are known constants and xi variables (inputs, state or
intermediate variables).
Question:
How to implement computation of S in fixed-point arithmetic?
What control on degradation errors?
19/41
30. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
The only operations needed in filter algorithm computation are
sum-of-products:
n
X
S=
c i · xi
i=1
where ci are known constants and xi variables (inputs, state or
intermediate variables).
Question:
How to implement computation of S in fixed-point arithmetic?
What control on degradation errors?
Answer:
A tool responding to the global flow in particular case of
sum-of-product (FiPoGen).
19/41
31. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Main example
Let H be the transfer function of a butterworth filter of 4th order:
H(z) =
0.00132801779278 + 0.00531207117112z 1 + 0.00796810675667z 2 + 0.00531207117112z 3 + 0.00132801779278z 4
1
2.87111622831650z 1 + 3.20825006629575z 2
1.63459488108445z 3 + 0.31870932778967z 4
Associated algorithm:
y (k)
=
0.0013279914856 u(k) + 0.00531196594238 u(k
+0.00531196594238 u(k
3.20825195312 y (k
1) + 0.00796794891357 u(k
3) + 0.0013279914856 u(k
2) + 1.63458251953 y (k
3)
2)
4) + 2.87109375 y (k
1)
0.318710327148 y (k
4)
Inputs datas :
wordlength of constants, u(k) and y (k) : 16 bits
u(k) 2 [ 13, 13] and y (k) 2 [ 17.123541; 17.123541]
Bits formatting example
20/41
32. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
From filter to code, global flow
algorithm
transformation
implementation
filter
set of equivalent
realisations
SIF
Realisation
choice
optimal realisation
Fixed-point
implementation
fixed-point
algorithm
language
Code
generation
code
sensibillity
mesures
multi-criteria
optimisation
21/41
33. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen - Fixed Point Generator
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Conversion
The user gives in input to FiPoGen the wordlentgh of each
constants, and FiPoGen computes the complete format of each of
them, and specifies the format of each variables.
22/41
34. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Order
In software, addition can be not associative, therefore all di↵erent
orders of additions must be considered.
23/41
35. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Order
In software, addition can be not associative, therefore all di↵erent
orders of additions must be considered.
oSoP
An evaluation scheme for a given sum-of-products with a given
order will be called ordered-sum-of-products (oSoP).
23/41
37. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
fixed-point
algorithm
Fixed-Point
Conversion
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
best fixed-point
scheme
Optimization /
Best scheme
choice
Code
generation
new scheme
code
Number of oSoP
For a given sum-of-products of N th order, there are
oSoP to consider.
QN
1
i=1 (2i
1)
23/41
39. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
fixed-point
algorithm
Fixed-Point
Conversion
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
best fixed-point
scheme
Optimization /
Best scheme
choice
Code
generation
new scheme
code
Number of oSoP
For a given sum-of-products of N th order, there are
oSoP to consider.
QN
1
i=1 (2i
1)
Generation
At this step, FiPoGen generates all the oSoP one by one.
23/41
40. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Formats propagation
From an oSoP parametrized with inputs FPF and wordlength, and
using some propagation rules on adders and multipliers, we obtain
a fully-parametrized oSoP.
24/41
42. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Propagation =) right-shifts
By propagating formats, some additions yield a right-shift on its
operands (for aligning them onto the result format). This
right-shift implies error onto the final result.
24/41
43. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fullyparametrized
scheme
one evaluation
scheme
fixed-point
algorithm
Evaluation
scheme
Formats
propagation /
Noise
evaluation
best fixed-point
scheme
Optimization /
Best scheme
choice
Code
generation
new scheme
code
Right-shift =) error interval
The right shifting of d bits of a variable x (with (m, `) as FPF) is
equivalent to add an interval error [e] = [e; e] with
[e, e]
Truncation
[ 2`+d + 2` ; 0]
Round to the nearest
[ 2`+d 1 + 2` ; 2`+d 1 ]
(4)
Cumulated error is therefore computed for a given evaluation
scheme.
24/41
44. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Optimization criteria
errors
(noise : couple mean/variance)
error interval
25/41
45. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Optimization criteria
errors
latency (infinite parallelism)
height of the syntax tree
25/41
46. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Optimization criteria
errors
latency (infinite parallelism)
adequacy with hardware target
number of operators
wordlength of operators
etc.
25/41
47. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Optimization criteria
errors
latency (infinite parallelism)
adequacy with hardware target
etc.
25/41
48. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
FiPoGen
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
Once we have the best evaluation scheme, we choose a language
and we generate the associated fixed-point code.
26/41
50. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
s
s
s
s
s
s
s
s
s
sf
Context
A sum of N terms (pi )1iN with di↵erent formats, and the known
FPF of final result (sf ), less than total wordlength (s).
28/41
51. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
s
s
s
s
s
s
s
s
s
sf
Context
A sum of N terms (pi )1iN with di↵erent formats, and the known
FPF of final result (sf ), less than total wordlength (s).
Question:
Can we remove some useless bits ?
28/41
52. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
s
s
s
s
s
s
s
s
s
sf
Two-step formatting
1
most significant bits
2
least significant bits
28/41
53. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Jacskon’s Rule (1979)
This Rule states that in consecutive additions and/or subtractions
in two’s complement arithmetic, some intermediate results and
operands may overflow. As long as the final result representation
can handle the final result without overflow, then the result is valid.
29/41
54. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Jacskon’s Rule (1979)
This Rule states that in consecutive additions and/or subtractions
in two’s complement arithmetic, some intermediate results and
operands may overflow. As long as the final result representation
can handle the final result without overflow, then the result is valid.
Example :
We want to compute 104 + 82
94 with 8 bits :
29/41
55. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Jacskon’s Rule (1979)
This Rule states that in consecutive additions and/or subtractions
in two’s complement arithmetic, some intermediate results and
operands may overflow. As long as the final result representation
can handle the final result without overflow, then the result is valid.
Example :
We want to compute 104 + 82
104 + 82 = 70 overflow !
94 with 8 bits :
29/41
56. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Jacskon’s Rule (1979)
This Rule states that in consecutive additions and/or subtractions
in two’s complement arithmetic, some intermediate results and
operands may overflow. As long as the final result representation
can handle the final result without overflow, then the result is valid.
Example :
We want to compute 104 + 82 94 with 8 bits :
104 + 82 = 70 overflow !
but 70 94 = 92 overflow !
This second overflow cancels the first one and we obtain the
expected result.
29/41
57. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Fixed-Point Jacskon’s Rule
Let s be a sum of n fixed-point number pi s, in format (M, L). If s
is known to have a final MSB equals to mf with mf < M, then:
1
0
mf +1
mf
M X
@
s=
2j pi,j A
1in
j=L
s
s
s
s
s
s
s
M
s
mf
L
s
sf
30/41
58. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
MSB formatting
Fixed-Point Jacskon’s Rule
Let s be a sum of n fixed-point number pi s, in format (M, L). If s
is known to have a final MSB equals to mf with mf < M, then:
1
0
mf +1
mf
M X
@
s=
2j pi,j A
1in
j=L
s
s
s
s
s
s
s s s
s
M
mf
L
s
sf
30/41
59. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
LSB Formatting main idea (from Florent de Dinechin)
s
s
s
s
s
s
s
s
s
sf
31/41
60. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
LSB Formatting main idea (from Florent de Dinechin)
s
s
s
s
s
s
s
s
s0
sf
31/41
61. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
LSB Formatting main idea (from Florent de Dinechin)
s
s
s
s
s
s
s
s
s0
sf0
31/41
62. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
LSB Formatting main idea (from Florent de Dinechin)
s
s
s
s
s
s
s
s
s0
sf0
sf0 6= sf BUT sf0 is a faithful round-o↵ of sf .
31/41
63. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
LSB Formatting main idea (from Florent de Dinechin)
s
s
s
s
s
s
s
s
s
sf0
Can we determine a minimal
round-o↵ of sf ?
such that sf0 is always a faithful
31/41
64. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
evaluation
For both rounding mode (round-to-nearest or truncation), the
smallest integer that provides sf0 = ?lf (sf ) is given by:
= dlog2 (n)e
32/41
65. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
LSB formatting
evaluation
For both rounding mode (round-to-nearest or truncation), the
smallest integer that provides sf0 = ?lf (sf ) is given by:
= dlog2 (n)e
More precisely
Some pi s may have LSB (`i ) greater than the final LSB `f , so we
don’t need to consider them in computation :
= dlog2 (nf )e
with nf = Card(If ) and If , {i | `i < `f }.
32/41
67. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Formatting method
s
s
s
s
s
s
s
s
1
2
3
4
we
we
we
we
s
sf0
compute
format all pi s into FPF (mf , lf
compute s
obtain sf0 from s
)
33/41
69. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Back to our main example
Main example
s
s
s
s
s
s
s
s
s
s
s
= dlog2 (n)e
All the di↵erent oSoP have the same errors
=) Here, error is not a criteria to choose the best oSoP
34/41
70. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
oSoP
S
(5,-10)
>> 4
(5,-14)
+
(5,-14)
+
(5,-14)
+
4)
(5,-1
+
)
14
(5,-
(5,-
F
9
23520
⇥
F
(5,-10)
y [n
1]
(2,-13)
-26282
(5,-10)
y [n
2]
(5,-
19
(4,-11) (-7,-22)
u[n]
22280
⇥
4)
12
(-2,-14)
(-1,-16)
-20887
⇥
+
)
14
(5,(5,-10)
y [n
4]
(5,-
F
3]
(-9,-24)
22280
⇥
(4,-11)
u[n
4]
(1,-14)
26781
4)
F
4)
F
(-1,-14)
(-7,-22)
18
F
21
(5,-1
(5,-1
14)
(-4,-14)
(4,-11)
u[n
+
(5,-1
14)
F
(-4,-14)
21
⇥
(8,-14)
(-9,-24)
9
22280
⇥
+
4)
(5,-1
+
14)
(5,-
4)
F
(8,-14)
(2,-13)
(5,-1
14)
(5,-14)
(5,-14)
22280
⇥
(7,-14)
(-6,-21)
(4,-11)
10
16710
u[n 2]
⇥
(-2,-14)
19
⇥
(4,-11)
u[n
1]
(5,-10)
y [n
3]
35/41
71. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Comparison
s
s
s
s
s
s
s
s
s
s
s
2
=0
3
= dlog2 (nf )e
1
= min(`i )
i
36/41
72. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Comparison
y(k)
F ix2
F ix3
F ix1
k
y 2 [ y;
y ] = [ 8.52445240 ⇥ 10
2
; 1.26555189 ⇥ 10
2
]
36/41
73. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Formatting
This new task can be inserted in FiPoGen process.
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
37/41
74. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Formatting
This new task can be inserted in FiPoGen process.
sum-of-product
realisation
Fixed-Point
Conversion
fixed-point
algorithm
Formatting
"lighter"
fixed-point
algorithm
Evaluation
scheme
one evaluation
scheme
Formats
propagation /
Noise
evaluation
fullyparametrized
scheme
Optimization /
Best scheme
choice
best fixed-point
scheme
Code
generation
new scheme
code
37/41
75. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
38/41
76. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
min (ws +
P
i
w ci +
P
i
wvi )
38/41
77. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
define the constraints on the error by considering formatting
`s
` ci + ` v i
38/41
78. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
define the constraints on the error by considering formatting
ws
w ci
`s
wv i
ms
` ci + ` v i
m ci m v i
1
38/41
79. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
define the constraints on the error by considering formatting
y (k) 2 [ y ;
y]
38/41
80. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
define the constraints on the error by considering formatting
y (k) 2 [ y ;
y]
y and y are functions of e and e which are functions of ws , wci
and wvi .
38/41
81. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Formatting
Word-length optimization
It is a main current problem in fixed-point arithmetic. It consists of
minimizing the word-length of each parameter under constraints.
P
The idea, for a sum-of-products s = i ci ⇥ vi , is to :
define the cost function to minimize
define the constraints on the error by considering formatting
solve the problem using known solvers or find a new solution
38/41
82. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Conclusion
This PhD thesis answers the problem of optimal filter
implementation in fixed-point arithmetic.
For this, some works have been realized:
Formalisms : for conversion and basic operations in
fixed-point arithmetic
FiPoGen : a tool generating fixed-point code for a
well-fashioned algorithm
Bits formatting : a first step towards word-length optimization
39/41
83. Context and Objectives
FiPoGen
Bits Formatting
Conclusion
Second part of the PhD thesis
A lot of works still to be done:
Wordlength optimization considering bits formatting
Make FiPoGen realizes the complete flow defined before
Do the link with Silviu’s works
40/41