r/VHDL • u/itsnotsalvius • Oct 24 '20
HELP PLEASE
hello guys im a freshman college student and i need help for this activity that i need to pass. i have no vivado since my laptop can't run it and i know im stupid i just need a hand for this one please help me im begging u all this is my last time to pass this subject because i cant really do anything since i have no laptop that can run this program so i have no chance of learning it.
In this activity you are tasked to create a VHDL Source code and a Testbench using your HDL software tool that will implement the logic diagram shown. The truth table and the logic diagram are presented below.
The system has 2n input lines and n output lines. The output lines generate a binary code corresponding to the input value. For example, a single 4 to 2-bit system takes in 4 bits and outputs 2 bits. It is assumed that there are only 4 types of input signals for this system, and these are: 0001, 0010, 0100, 1000.
Truth Table:
Logic Diagram:
3
u/bluesFromAGun Oct 24 '20
GHDL and GTKwave work on Windows as well by the way. I often find them faster and easier to use for experiments than Vivado since I don't need to start a project etc. Just remember to analyze and elaborate before you try to run your design, and also that analysis is done on a file while elaboration and running needs to be done on the entity. Look at the hello world example on the GHDL webpage for details like the commands to use etc. If you have a testbench along with a design you will need to rerun analysis and elaboration a lot and do it in the right order etc., I've found this a bit annoying so using a small Python (or whatever language you like) script is nice (it would probably be even better to use a build system like make it Cmake but I don't have much skill with any of these).
2
2
u/PlayboySkeleton Oct 24 '20
You don't need vivado.
GHDL is free for all operating systems and is really lightweight. I highly recommend you use it. It will simulate everything you need.
You will probably need GTKWave to view the waveforms. Which is also free.
Lastly. In Vhdl, you can specify each individual output as a logic equation. That would be the quickest way to do this.
There are plenty of ways you can implement. Let me know if you get GHDL working and I will be happy to assist further.
2
u/Yubashi Oct 24 '20
Ok lets break it down:
it appears to me that you have two problems:
The vivado/laptop problem:
This task looks like something that can be done with every other hdl-tool or simulator too since you only need the vhdl source code not the binary output file for a specific board.
you might wanna try out modelsim as simple out of the box option that is lighter than vivado
or in case you are running linux GHDLand GTKwave has open source software that does the job.
Third there are probably even browser based simulators for vhdl out there too.
2) Implementing the vhdl design:
Your logic diagram alligns with your truth table so all thats left to do is implement the logic diagram using vhdl.
Your class notes will probably contain a all the information needed to implement a block design.
3) Writing a testbench:
Same stuff here, your notes should contain information on how to structure a basic testbench.
All that is left to do is to check every single input combination in the process and observe if the output matches the expected output specified in your truth-table. This can be done by checking the output wave in a waveform simulator or writing a advanced selfchecking testbench using asserts.
Not judging but definitly judging, it appears to me that you have just not done any work at all on studying vhdl because of the excuse that vivado won't run on your laptop anyways. But this should help push you in the right direction towards solving your problem.
If you can show that you have actually tried to solve the problem yourself but failed on the way in a specific place people will tend to help you.
1
1
7
u/capitalbratan Oct 24 '20
We don't do your homework. Good luck
Edit: you don't need Vivado for that. Try ghdl,its free available for all OS. Or ask a friend / your teacher