Forum Discussion
[vhdl] artificial neural network
Hello,
I'm interested in neural networks currently :) I've written some basic ANN implementation in java with ADELINE neurons. (Actually, this is only the background of the problem) I'd like to write a simple neuron in vhdl. input vector is multiplied by weigths, result is sum. If result is > 0 then output = -1 else output = 1 And here comes the problem, I have to multiply input values by weights which are real values. I know that vhdl supports real variables but how should I use it?:confused: I tried like that but it isn't correct code --- Quote Start --- variable weigth:real; variable tmp:real; weight:=0.1; for i in 0 to inputvector'length - 1 loop tmp:=tmp+(weigth*inputvector(i)); end loop; --- Quote End --- I'd be very gradefull for any help!12 Replies
- Altera_Forum
Honored Contributor
What are you trying to acheive with VHDL. VHDL has the real type for modelling and simulation only - you cannot synthesise them and put them on hardware/FPGA. you have to use std_logic_vector/unsigned/signed/fixed point. Floating point always has to be represented by vectors. The real type is NOT a vector.
If you are using VHDL solely to produce a model, then it is fine, but if you do not intend to put anything onto and FPGA, Id stick to java. - Altera_Forum
Honored Contributor
Can Anybody provide me some workable examples of ANN in VHDL (or Verilog) -- and its description if possible, code in c , java, or structural scheme --for exploring the pecularities of its design as the simple code maybe not enough, but the code itself would be also valuable.
- Altera_Forum
Honored Contributor
Firstly, to repeat Tricky, do you want to create a simulation-only or a physical neuron(et)?
You could look into the paper of Bailey, Wilson, Brown and Chad: Behavioral Simulation of Biological Neuron Systems using VHDL and VHDL-AMS. They give a good explanation of the simulation. - Altera_Forum
Honored Contributor
--- Quote Start --- Firstly, to repeat Tricky, do you want to create a simulation-only or a physical neuron(et)?You could look into the paper of Bailey, Wilson, Brown and Chad: Behavioral Simulation of Biological Neuron Systems using VHDL and VHDL-AMS. They give a good explanation of the simulation. --- Quote End --- what do you mean under the term neiron? I mean artificial NN no one example. Besides I have no device so it should probably to be the simulation. But I have no full licence at paid altera edition. So could I do the simulation? And what it mean the device. Is it mean the physical one? As when creating the project I have a warning that no device and simulation and compilation is also grey - not active. So I do not know should I have the full license or install device -maybe it is needed to also for simulation and it seems also take the big ammount of disk space. - Altera_Forum
Honored Contributor
If you have the web version, with its associated modelsim version, installed (current version is 15.0) You should be able to do the simulation. You shouldn't need to specify a device as you will not compile your project. Also, I tell this just in case you are not aware of this, VHDL and Verilog are hardware descriptive languages so sequential execution are possible but it is not really meant for that. So to summarize your question and the answers:
Can I describe a neuronetwork in a HDL? Yes you can. Can I simulate a neuronetwork in Modelsim? Yes you can. How do I do this? Search for literature on neuronetworks and their design. (You have multiple options here.) As for the simulation, Altera has some guides. - Altera_Forum
Honored Contributor
thanks but I need just Modelsim 11.1 free starter edition --what I could do there. And what will be in outpu? What is the difference between Altera Quatrus and ModelSim -- just the compilation?
If I download Arria or Cyclone device for Qutrus 11.1 --can I simulate or compile the project there--if correctly settle the licence? And what these devices means--are they just virtual? And yet just question--what should I know and choose in FPFA to correctly simulate or compile project? If this circuit is not very compound? And if these is neural network what should I generaly use a the iteration?? Bailey, Wilson, Brown and Chad: Behavioral Simulation of Biological Neuron Systems -- it seems no free resource? - Altera_Forum
Honored Contributor
Quartus is a tool to compile your hdl for the chip you are going to use. Modelsim is just a simulator.
All the parts are different, you need to compile your code for the correct part or it will not work. I highly suggest your find a good text book on digital logic design or you will be totally overwhelmed. - Altera_Forum
Honored Contributor
--- Quote Start --- Quartus is a tool to compile your hdl for the chip you are going to use. Modelsim is just a simulator. All the parts are different, you need to compile your code for the correct part or it will not work. I highly suggest your find a good text book on digital logic design or you will be totally overwhelmed. --- Quote End --- But in ModelSim I need to choose Design Units, that should be also compiled as well in ModelSim--the altera's tutorial "Using ModelSim to Simulate Logic Circuits in Verilog Designs" also tell about compiling the hdl code before simulation. So what is up. Even Model-Sim starter edition has Compile menu but it is incative (so grey in colour) -- but only diffrence with full and starter edition is that the last one is limited to 1000 lines of codes--and is on 1/3 slower. So what should I do to compile at least in Model-Sim. The what is difference between simulation in Model-Sim and Quatrus as two programs needs the compilation for the check of logic or strutures of files that has simulated code. Then I do not undestand what is the reason to install the such group of devices as Arria and Cyclones (about 1gb in size) is it virtual devices or some kind of drivers for real devices. And it is very funny that Starter edition is free but the compile menu is inactive fully. And if you suggest to know for what I compose the logic but the simulation should also be based on some device or characteristcis of device... - Altera_Forum
Honored Contributor
If you start modelsim from Quartus, you will have to run the analysis and synthesis. This checks for problems in your design. Then, when you run modelsim you only simulate. The list of devices is given for people who have such a device or are making hardware for that specific chip. When installing (or downloading I don't remember wich) it gives you an option to download the device families of your choice. I use the web edition and can compile witout problems for my cyclone IV.
Also there are multiple ways of simulating. I usually simulate at RTL level. At this point it just simulates the code and operations' propagation delays are not taken into account. I assume, but others may tell me wrong, that gate level does have p-delays. - Altera_Forum
Honored Contributor
But I use modelsim directly and the compile menu is bleak so inactive. Despite the simulation is. In the quatrus this two options is not active. But my Modelsim is just of starter edition. So it was said that it just performs the simulation despite it also do compilation. And in the whole: is it only way to compose logic circuit in altera through the vhdl(verilog) code or are there some graphical editor that would do the same job, as well as create the code based on graphics.