VHDL
VHDL stands for VHSIC Hardware Description Language, where VHSIC stands for Very High Speed Integrated Circuits; that is, in a free translation, it means description language of hardware for high-speed integrated circuits. The name itself says: description language. The concept of programming language is somewhat abstract (in my understanding at least), because in a more common sense the programming language is the one capable of creating a program - sequence of commands that instruct and guide the execution in hardware to perform a certain task. In this definition, VHDL is not a programming language, because the result of a VHDL code is not a program, but an electronic circuit - actually a mapping of routes that will define the circuit when recorded on an integrated circuit such as ASIC or FPGA. However, another accepted definition for a programming language is to be Turing Complete. It is possible to implement a Turing machine with VHDL, so this makes it a language Turing Complete, is, in this definition, a programming language. In my own experience, being or not a programming language and being you beginner in VHDL, do not join. It is very common to see people starting on VHDL writing code the way they write programs in C/Python/etc and this causes a lot of confusion. While in these languages you know that the code is sequential, one command runs after another, in VHDL everything happens in parallel, because as it comes to an electronic circuit, you are not working with values stored in a memory, but electrical signals.
Interesting readings:
What characterizes a programming language?
What is a programming language, IDE and compiler?
Here comes the story
The history of VHDL is very simple and very useful to understand the essence of language. It was developed by DARPA, Defense Advanced Research Projects Agency or United States Defense Advanced Research Projects Agency for the purpose of documenting projects developed by third parties and provided to the Armed Forces. In the case of military technology, for security reasons, a company had no access to the entire project and needed to develop only a part of it without knowing the rest. Having numerous companies serving numerous documentations with distinct and schematic patterns of complex circuits made the process of unification of these parts very expensive. Thus, they decided to create a description language of hardware, where all technology suppliers should use it to document their products, thus facilitating the development of the project itself. At first, the only function of language was the description of the circuit, so it was nothing more than a structured text, but were already studying concomitantly a way to develop a language capable of generating circuits from a textual definition and the structure defined by VHDL proved to be quite promising. Soon after, then, already appeared the synthesizers of VHDL, software capable of generating the circuit from the VHDL, and the simulators, software capable of simulating the behavior of the circuit from the VHDL code. This all happened in the mid-1980s and already in 1987 the VHDL language was put in the public domain, being standardized by IEEE (IEEE 1076). In the public domain, as expected, the language grew rapidly, having a new version released in 1993, changes made in 2000 and 2002 and the latest version being released in 2008 - almost 10 years of the latest version and commercial synthesizers still do not fully support this version (in my view, the most negative point of the language).
Applications and Use
As quoted in the question, one of the most common and simple applications of language is in the study of logic circuits and Boolean algebra. Many books in the field use VHDL examples and many universities use the language as a tool in the initial study of digital systems. For example, considering the logic gate AND below, it is possible to identify two inputs, A and B, and one output, C. The expected behavior of the logic gate is presented in the truth table.
Source: https://www.embarcados.com.br/cis-de-portas-logicas/
With VHDL it is possible to reproduce the behavior of this logic port for educational purposes. With the word reserved entity
it is possible to create a black box by defining the inputs and outputs of our project. In this case, the inputs A and B and the output C all represent digital signals and therefore can be represented by a bit. It is said black box because only the inputs and outputs of the circuit are defined, without defining its behavior. See the implementation below:
entity porta_e is
port (
signal A: in bit;
signal B: in bit;
signal C: out bit
);
end entity;
That is, we create an entity called porta_e
which has three doors: sign A, type input bit
, signal B, entry of type bit
, and the C signal, output type bit
. Note that it has not been defined how these signals will be treated nor what is the behavior of our entity. With entity
only the interface of the component with the external world is defined. The behavior of the circuit is defined using the reserved word architecture
:
architecture rtl of porta_e is
begin
C <= A and B;
end architecture;
In this case, we create an architecture called rtl
, linked to the entity porta_e
, that defines the desired behavior for our circuit, that is, the C signal receives the result of the operation and
between A and B. The operator and
for operations of the type bit
already has native implementation in VHDL and is interpreted correctly by any synthesizer. The full AND port code would be:
entity porta_e is
port (
signal A: in bit;
signal B: in bit;
signal C: out bit
);
end entity;
architecture rtl of porta_e is
begin
C <= A and B;
end architecture;
By way of example, synthesizing the above code with Altera’s Quartus Prime Lite Edition (one of the largest companies in the Fpgas business), generates the following circuit:
Exactly the circuit we hoped to get, but this is one of the most basic applications of language. Its application itself cannot be described, it varies according to the need and creativity of each, because any digital circuit can be implemented using VHDL. It can go from a simple logic port, as shown, to a modem for high-speed transmissions through fiber optics or more complex than that. By way of example, it is possible to recreate microcontrollers, even allowing you to program it using other languages, such as C or Assembly. It is possible to create video drivers from scratch, audio drivers, memories, etc. Basically any digital circuit. The VHDL generated circuit that makes the calculus of the Fourier transform, for example, is so great that it is impossible to represent it visibly here (nor is it complete):
A Little Jabá
An example of what can be done with VHDL is a project I developed together with 2 colleagues during graduation. The project consists of connecting a camcorder and a monitor to the development board. With VHDL, a standard image (black and gray stripes in the video below) is generated that is displayed on the monitor. With the camcorder, the monitor image is captured and sent to the board where the image will be treated by VHDL. The VHDL then compares the image it received from the camcorder to the image it sent to the monitor and performs certain actions according to the difference in the image. In this case, the VHDL recognized the position of the hand in front of the monitor and played a different sound for each stripe of the image. The goal was to recreate a behavior similar to touch screen, or better, motion sensitive completely with VHDL, ie, all the logic and digital image processing is done in hardware, without any other programming language or use of image processing libraries.
https://youtu.be/xXxqDf_zIt8
This question was created mainly in order to test the reception of the community before the VHDL language, which is being discussed at the finish line.
– Woss
But it exists in Soen: https://stackoverflow.com/questions/tagged/vhdl?sort=votes
– Maniero
https://pt.meta.stackoverflow.com/a/6129/132
– Victor Stafusa
And we even have syntax coloring specific for VHDL with
<!-- language: lang-vhdl -->
– Victor Stafusa