Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20643 Discussions

Time to start learning FPGA! How to choose the correct FPGA for this project?

Altera_Forum
Honored Contributor II
1,421 Views

Hi all! 

I hope this isnt a too booring newbie post, but I didnt know really where to start. 

 

My questions are many and the road to learn FPGA seems long, but please bare with me. 

 

My hobby is repairing and collecting arcade games/pcbs. And every now and then I come across components wich are hard to find or expensive. 

Many times I found myself wondering if this could been solved with a fpga/cpld for example. So Its high time to start learning. 

 

I have many pcbs with socketed CPUs, so I thought Why not start learning by replacing a common component with a FPGA and dig into the code at the same time? 

 

So I thought my first step project would be to replace a Z80 cpu with a FPGA solution. Since this code is already availible it would be a good chance to analyse it and see how things work. 

I realize that this could be harder than I think to start with but that was the first thing at the top of my mind. 

 

Since the arcade pcbs cpu section are mainly run at +5v I need to use levelshifters and of course a custom pcb to fit the FPGA in the 40p DIP socket, but thats the smaller problem. 

 

The big problem is that there are so many variations of the cyclone FPGA to choose from, and I am not sure how much space is needed in an fpga for various tasks, such as acting like a Z80. 

 

So my question is, If YOU were to replace a Z80 with a FPGA, wich model would you choose, and why? 

 

So I get somewhere to start.. 

 

And please, If this sounds like a totally retarded way to start learning, then I am all ears for a better way. 

 

Thanks alot for reading this far! Hope to hear your response soon! 

 

Regards from Sweden / Stefan
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
317 Views

Well, I think it is really hard work to start with such a big project, but why not? At least you have the code for implementing the CPU in a FPGA. So I think this will make things more easy. 

 

To choose the right FPGA you mainly have to know how many Logic Elements (LEs) are used by the CPU-Core. Normally this Information will be provided with the code. 

Take this number and double it for design safety, further extensions .... bla bla and so on .... and search for FPGAs which provide AT LEAST this number of LEs 

 

The next thing you have to know is how many pins and clocks you will need. But I think nearly all Cyclone FPGAs with enough LEs should also have enough pins. 

 

Now think about the speed grade and the temperature range. Well, for a Z80 with 8 - 20 MHz you can also choose a speed grade of '8' and for home usage the commercial temperature (0 - 85°C) range should also fit your needs. But if you have the money, you can also choose a higher speed grade of '6' and the industrial or automotive temperature range which supports up to 125°C (and down to -40°C). 

 

Some other suggestion: 

Why don't you try the DE0nano board? It comes with a mid-range Cyclone IV, some periphery, a lot of IOs and the only thing you have to do is to build an adapter from the IO-Pins to the 40p DIP Socket. This board costs about 90$ and can be programmed via USB. I think 22000 LEs could be enough for a small CPU-Core. 

 

For a overview on cyclone devices see: 

Cyclone II: 

http://www.altera.com/literature/hb/cyc2/cyc2_cii5v1.pdf 

Cyclone III: 

http://www.altera.com/literature/hb/cyc3/cyc3_ciii52001.pdf 

Cyclone IV: 

http://www.altera.com/literature/hb/cyclone-iv/cyiv-51001.pdf
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

Thank you for your input!! Thats really helpful :D. 

Actually the DE0 Nano board looks awesome, and with that one I could start learning right away instead of making my own pcb first.. alot better. I did not know there was a developerboard at such a affordable price! 

 

I will give the DE0 manual a proper read after lunch and probably make my order! 

Thou just looking at it I guess I still need to make a seperate cart for the voltagetransitions between the DE0 and the Poject pcb.. But its probably well written in the manual if its needed! 

 

Thanks so far!!! What an awesome start! :D 

 

 

--- Quote Start ---  

Well, I think it is really hard work to start with such a big project, but why not? At least you have the code for implementing the CPU in a FPGA. So I think this will make things more easy. 

 

To choose the right FPGA you mainly have to know how many Logic Elements (LEs) are used by the CPU-Core. Normally this Information will be provided with the code. 

Take this number and double it for design safety, further extensions .... bla bla and so on .... and search for FPGAs which provide AT LEAST this number of LEs 

 

The next thing you have to know is how many pins and clocks you will need. But I think nearly all Cyclone FPGAs with enough LEs should also have enough pins. 

 

Now think about the speed grade and the temperature range. Well, for a Z80 with 8 - 20 MHz you can also choose a speed grade of '8' and for home usage the commercial temperature (0 - 85°C) range should also fit your needs. But if you have the money, you can also choose a higher speed grade of '6' and the industrial or automotive temperature range which supports up to 125°C (and down to -40°C). 

 

Some other suggestion: 

Why don't you try the DE0nano board? It comes with a mid-range Cyclone IV, some periphery, a lot of IOs and the only thing you have to do is to build an adapter from the IO-Pins to the 40p DIP Socket. This board costs about 90$ and can be programmed via USB. I think 22000 LEs could be enough for a small CPU-Core. 

 

For a overview on cyclone devices see: 

Cyclone II: 

http://www.altera.com/literature/hb/cyc2/cyc2_cii5v1.pdf 

Cyclone III: 

http://www.altera.com/literature/hb/cyc3/cyc3_ciii52001.pdf 

Cyclone IV: 

http://www.altera.com/literature/hb/cyclone-iv/cyiv-51001.pdf 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
317 Views

A great idea... 

 

I strongly recommend you get yourself a cheap development kit and have a play. It'll be the best way to start to understand the full (or even part of the) potential of an FPGA. 

 

You'll not go far wrong with the de0-nano development board (http://www.altera.com/products/devkits/partners/kit-terasic-de0-nano.html) made for Altera by Terasic. It's very cheap and has everything you'd want to experiment with a processor system - either Altera's Nios or your own Z80... 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

Hmm I did write a reply and posted some hour ago, but seems it doesnt show? :(. 

Anyway, thanks for the tips! I had no idea that the de0 board existed, and that it actually was affordable!! Great tips! 

 

I will certainly order it today and start digging in the manual! what an awesome start! 

 

Next step will be and try to decide Verilog or VHDL.. seems almost as hard to choose as it was to choose between xilinx and altera.. :/ 

 

Does verilog and vhdl have same possibilities? 

 

Thanks again!!
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

 

--- Quote Start ---  

Hmm I did write a reply and posted some hour ago, but seems it doesnt show? :(. 

--- Quote End ---  

 

 

It got moderated, Ive approved it for you. 

 

 

--- Quote Start ---  

 

Next step will be and try to decide Verilog or VHDL.. seems almost as hard to choose as it was to choose between xilinx and altera.. :/ 

 

Does verilog and vhdl have same possibilities? 

 

Thanks again!! 

--- Quote End ---  

 

 

You can do pretty much the same things with both languages. Verilog handles more like C, whereas you might not like VHDL if you know C. Because VHDL has strong typing it is somewhat self linting and can prevent you falling in some traps you can in verilog, but at the end of the day its not knowing the language thats important, its understanding the underlying hardware you are going to describe with either HDL. The important thing to remember is they are NOT programming languages. They are Description languages - you describe hardware.
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

Oh I see.. Moderated? Did I write something wrong or was it just because it's my first post? 

 

I ordered the DE0-Nano a couple of hours ago now!! This is going to be awesome :D 

I have no knowledge of C.. Although I would probably need to learn to read C macros. 

will check some code examples in both styles to see what type appeals to me I guess ;) 

 

as as long as I can learn/do the same things in both "languages" then I will be fine I think. Just wanted to make sure that I didn't miss out on some functions or such for choosing one or the other. 

 

 

 

 

 

--- Quote Start ---  

It got moderated, Ive approved it for you. 

 

 

 

You can do pretty much the same things with both languages. Verilog handles more like C, whereas you might not like VHDL if you know C. Because VHDL has strong typing it is somewhat self linting and can prevent you falling in some traps you can in verilog, but at the end of the day its not knowing the language thats important, its understanding the underlying hardware you are going to describe with either HDL. The important thing to remember is they are NOT programming languages. They are Description languages - you describe hardware. 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
317 Views

 

--- Quote Start ---  

Oh I see.. Moderated? Did I write something wrong or was it just because it's my first post? 

 

--- Quote End ---  

 

 

The first few posts you make will be put into a moderation queue if they have lots of quoted text or links in them, for anti spam reasons. 

 

Welcome to the world of FPGA. Happy coding - Im sure we'll be seeing more of you as you get stuck on things...
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

 

--- Quote Start ---  

The first few posts you make will be put into a moderation queue if they have lots of quoted text or links in them, for anti spam reasons. 

 

Welcome to the world of FPGA. Happy coding - Im sure we'll be seeing more of you as you get stuck on things... 

--- Quote End ---  

 

 

Ok, I understand. Well I am afraid you probably will see more of me ;) but I hope that's ok! 

thanks for the tips and support all! Can't wait to get my board now! 

in the meantime I will check the training/tutorial videos available on the altera page! 

see you all soon :D
0 Kudos
Altera_Forum
Honored Contributor II
317 Views

You'll find all the examples on the CDROM that comes with your Nano are in verilog. Might carry some weight in your decision. You could get a head start and download the CDROM image from Terasic's website... 

de0-nano cd-rom download page (http://www.terasic.com.tw/cgi-bin/page/archive.pl?language=english&categoryno=139&no=593&partno=4

 

Cheers, 

Alex
0 Kudos
Reply