I followed the steps on this video, found off DSD group-1 website.
I will walk through the steps of the video to aid in the installation of VHDL and the creation of the half adder program.
STEP ONE: You will need to download ghdl as well as gtkwave. When downloading, make sure to install the latest version.
Note: If you are on windows, make sure you download the windows 32 version on both websites. If you are on a Mac, download the osx version posted on the websites. The pictures to the left show the versions I used on my windows computer.
The image on the TOP is the ghdl software. Notice on the top left side it says Latest release. This is the section you should download from.
The image on the BOTTOM is the ghdl software. Nabagate to the files tab, if not already there, and find the most update version you need.
STEP TWO: Once you download both files, make sure to unzip the files by clicking "Extract all".
STEP THREE: Open notepad++ and the command prompt on your computer. In the command prompt, open the folder where you would like to store your file. You can write 'dir' to see the items in that folder. You will need this for later.
Using notepad++, make sure to change the file to VHDL. Go to Language, V, VHDL. This will set up the formatting of the document. From here you can start writing the code. Make sure to save as you go, into the folder you created.
The walk through of how to write the code and how/why it works is mentioned in the video. The code is also written below. A truth table, diagram, and realization charts of what the outputs should be as well as what the bundled circuit should look like is pictured below.
The file BELOW is the Half Adder
The file on the LEFT is the Half Adder Test Bench
------------------------------------------------------------------------------------------
STEP FOUR: When you are finished writing the code, you can test to see errors by finding the file in your command prompt. If you enter "ghdl -s filename", it will run the program to see if there are any errors. If nothing comes up after the line of code, there are no errors.
STEP FIVE: On the right is the command prompt. I saved the file on my desktop and in a folder named half adder. The lines below correspond to the command prompt on the right.
The image above is the gtkwave of the half adder. The vertical line is between 1 and 2 nanoseconds. At this time the code is running the a = 0 and b =0 trial. This is shown in the signals column next to the wave. That column shows that the output (o) is zero and the carry (c) bit is zero. This is correct showing the code worked correctly.
The image above another picture of the gtkwave of the half adder. The vertical line is between 4 and 5 nanoseconds. At this time the code is running the a = 1 and b =1 trial. This is shown in the signals column next to the wave. That column shows that the output (o) is zero and the carry (c) bit is one. This is also correct showing the code worked correctly.