VHDL (I)http://dev.emcelettronica.com/print/518661 din 316.07.2008 11:37
Your Electronics Open Source
Home > Blog > mauriziostefani's blog > Content
By mauriziostefaniCreated 15/07/2008 - 21:33
BLOG Electronics Firmware Other
Historically the basic group which I was working started with Altera technology and so there is abranch “love” towards this society although Xilinx (the competitor), even advance as presentationof programmable components on field, has similar technology if not better (the two companiesare chasing each other with the last component). It is also true that the Altera developmentsystem is free and this pushes to their easily.For that I will use Altera design sw for this examples.
Today we can not suggest MaxPlus (the old Altera development system) because it is no moresupported and it is abandoned because due to the missing compatibility with the newcomponents, it is used for old project only.We download the Quartus 7.x version, available now the v8, (www.altera.com
having a fastInternet connection), then we require a license (it’s free, and will expire 3 months later, it’sconnected to the MAC address of the network board ) and we install everything.It is advisable to make a directory in Quartus area to contain all the licenses that we're going toask.After installing everything I would test some program to make sure that we have successfullyinstalled the program, perhaps using some small example available on the site or network(http://www.altera.com/support/examples/vhdl/vhd-add-sub.html
Our first program
Although this is not a course and I am not a teacher, it’s necessary to use a vocabulary ofcommon terms and the simplest is to comment a small program. I would have chosen anup-down counter.In first lines there are some comments, in VHDL “—“ is used as start of comment, the commentlasts until the end of the line (the VHD source code is attached)-- General Counterthen we have the libraries declaration, VHDL is a strong typed language it means that eachvariable assumes a “type” and than will be available only operations allowed by that type. Thearithmetics libraries will be more used and they will have to be declared and enabled to be used,normally I add the lpm Altera library also for the Altera macros.
LIBRARY ieee, lpm, altera_mf; USE ieee.std_logic_1164.ALL; USE lpm.lpm_components.ALL;