Sigmoid Function Approximation For ANN Implementation in FPGA
Sigmoid Function Approximation For ANN Implementation in FPGA
Abstract - The objective of this work is the implementation of Artificial Neural Network on a
FPGA board. This implementation aim is to contribute in the hardware integration solutions
in the areas such as monitoring, diagnosis, maintenance and control of power system as well
as industrial processes. Since the Simulink library provided by Xilinx, has all the blocks that
are necessary for the design of Artificial Neural Networks except a few functions such as
sigmoid function. In this work, an approximation of the sigmoid function in polynomial form
has been proposed. Then, the sigmoid function approximation has been implemented on
FPGA using the Xilinx library. Tests results are satisfactory.
control
of
power
systems.
In this study, we begin by adapting ANN to allow
optimal implementation. This implementation must
ensure efficiency, timeless and a minimum possible
space on the FPGA. Then, we schedule the ANN on
the System Generator. The System Generator to
generate VHDL code. This code is verified and
implemented on a FPGA Spartan-like by the ISE
software from Xilinx Fondation.
1 Introduction
Monitoring, control and maintenance of any element of
wide area power system become an important issue for
ensuring the continuity of electric supply and avoiding
the black out. It is important to early detect the defects
that can occur in these elements by monitoring their
operations and then developing methods for applying
adaptive control and preventive maintenance [1, 2, 3].
The fast implementation of the developed
methods is necessary needs for the industry and the
complex (smart) power systems. These methods may
be investigated using several techniques that have
different characteristics to solve the encountering
problems [4, 5]
The most commonly used techniques are the
artificial intelligence-based techniques such as
Artificial Neural Networks (ANN) [5, 6, 7] that they
are easier to implement on electronic circuit board such
as: Digital Signal Processing (DSP) chips, Application
Specific Integrated Circuits (ASICs) or Field
programmable gate array (FPGAs) [8, 9, 10].
The objective of this work is the implementation of
artificial neural network on a FPGA. This
implementation aim to contribute in hardware
integration solutions using FPGA applied to different
areas such as monitoring, diagnosis, maintenance and
ISBN: 978-960-474-262-2
112
In1
In2Out1
In1
In3
In2Out1
In1
E1
Input 1
In1
Out1
In3
neuron1
Input 1
In2
neuron1
neuron1
In2Out1
E2
In1
In3
Input 1
In1
In2Out1
Neuron2
E3
In1
Out1
In2Out1
f ( x)
In2
In3
neuron2
y{1}
neurone2
1
1 e cx
(1)
In3
neuron3
Inputs
1
In1
2
In2
3
In3
Layer 2
Layer 1
Outputs layer
outputs
f ( x) c bx ax 2
-K-
w11
MATLAB
-K-
Function
w21
w11
Out1
logsig
-K-
In2
-Kw31
(2)
-K-
In1
Input 1
Input 1
B1
B1
w21
MATLAB
Function
1
Out1
logsig1
1 e a1
b
1 e a 2
a 1 e a 3
first:
with:
Table.1: Simulation (test) Results of ANN for different
cases.
a1
a a2
a3
Output
of ANN
Safety case
Fault1
Fault2
S1
1.2222 e-018
1.0000 e+000
6.2836 e-016
S2
1.0000 e+000
1.6661 e-007
1.0000 e+000
ISBN: 978-960-474-262-2
113
where a V/ F
a1
1
and :
0
F 2
4
02
22
4 2 ,
01
21
41
a
sysgen
b a+b
AddSub1
Constant
1
In1
In
Gateway In
x sysgen
0.0332
Mult
CMult
sysgen
[a:b]
sysgen
not
Slice
Inverter
a
sysgena - b
b
-4
AddSub2
Constant1
a
sysgen
a-b
b
AddSub3
Constant2
-4
sysgen
b z (ab)
b sysgen
ab
sub
AddSub
Sy stem
Generator
sysgen
[a:b]
hi
sysgen
lo
Slice1
Concat
sysgen
[a:b]
Slice2
sysgen
not
Inverter1
1
Constant3
sel
d0
sysgen
Out
d1
d2
Gateway Out
1
Out1
Mux
5 Conclusion
0
Constant4
1
0.9
simulink
xilinx
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
200
400
600
800
1000
1200
ISBN: 978-960-474-262-2
114
In1
Input 1
In1
In3
In2 Out1
In3
neuron1
In1
E1
Input 1
neuron1
In3
In1
Out1
In2
In1
In2 Out1
neuron2
E3
In1
neuron1
In2 Out1
E2
Input 1
In2 Out1
In1
In3
In2 Out1
neuron2
Out1
In2
neuron2
y{1}
In3
neuron3
Inputs
Layer2
Layer1
Layer of outputs
Output
References
ISBN: 978-960-474-262-2
[1]
[2]
[3]
115
[4]
ISBN: 978-960-474-262-2
116