M
martin f. krafft
Hi all,
A student of mine is currently working on an implementation of
artificial neurons in FPGAs. We are experiencing a weird problem
trying to reset. I am only the messenger here (because I use
usenet), but from what I understand, the problem is as follows:
The weights connecting neurons are stored as 8 bit values in an
array (std logic vector) and there is a button that we want to use
to reset all weights to zero. The button is value '1' when not
pressed and '0' when pressed. Here is the logic we tried:
Reset: process (clock,Rst_n)
begin
if (clock'event and clock='1') then
ResP <= Rst_n;
end if;
end process Reset;
ResetAndClock: process (clock, ResP)
begin
if (ResP = '0') then
RegWeightsP <= (others => '0');
RegDIPvalueP <= (others => '0');
elsif (clock'event and clock='1') then
RegWeightsP <= RegWeightsN;
RegDIPvalueP <= DIPvalue;
end if;
end process ResetAndClock;
The idea is to force the creation of a flip-flop ResP to stabilise
the reset button value. In the second process, this register is then
queried and the weights reset if it's '0' or propagated if not.
I am not exactly sure why he uses *P and *N (the previous and next
values), but I believe it has to do with stabilisation.
Anyway, the problem is that the reset works fine while the button is
pressed, but as soon as we let go, the weight registers assume their
old values.
What are we doing wrong?
You can find the complete implementation of the neuron at
ftp://ftp.madduck.net/scratch/neuron.vhdl
Suggestions, comments, anything about the whole code or other parts
or whatever are very welcome. Primarily we would like to get the
reset switch working though.
Also, if any of the above is unclear, please ask and I will try to
clarify as best as I can.
Thanks a bunch,
Martin Krafft
AILab, Univ. Zürich, Switzerland
A student of mine is currently working on an implementation of
artificial neurons in FPGAs. We are experiencing a weird problem
trying to reset. I am only the messenger here (because I use
usenet), but from what I understand, the problem is as follows:
The weights connecting neurons are stored as 8 bit values in an
array (std logic vector) and there is a button that we want to use
to reset all weights to zero. The button is value '1' when not
pressed and '0' when pressed. Here is the logic we tried:
Reset: process (clock,Rst_n)
begin
if (clock'event and clock='1') then
ResP <= Rst_n;
end if;
end process Reset;
ResetAndClock: process (clock, ResP)
begin
if (ResP = '0') then
RegWeightsP <= (others => '0');
RegDIPvalueP <= (others => '0');
elsif (clock'event and clock='1') then
RegWeightsP <= RegWeightsN;
RegDIPvalueP <= DIPvalue;
end if;
end process ResetAndClock;
The idea is to force the creation of a flip-flop ResP to stabilise
the reset button value. In the second process, this register is then
queried and the weights reset if it's '0' or propagated if not.
I am not exactly sure why he uses *P and *N (the previous and next
values), but I believe it has to do with stabilisation.
Anyway, the problem is that the reset works fine while the button is
pressed, but as soon as we let go, the weight registers assume their
old values.
What are we doing wrong?
You can find the complete implementation of the neuron at
ftp://ftp.madduck.net/scratch/neuron.vhdl
Suggestions, comments, anything about the whole code or other parts
or whatever are very welcome. Primarily we would like to get the
reset switch working though.
Also, if any of the above is unclear, please ask and I will try to
clarify as best as I can.
Thanks a bunch,
Martin Krafft
AILab, Univ. Zürich, Switzerland