A field-programmable gateway range (FPGA) is an integrated circuit (IC) that lets you execute custom digital circuits. You can utilize an FPGA to create optimized digital logic for things like electronic signal handling (DSP), artificial intelligence, as well as cryptocurrency mining. You can commonly implement entire cpus using its digital logic since of the FPGA’s adaptability. You can locate FPGAs in consumer electronic devices, satellites, and in servers used to execute specific estimations.
In this collection, we will certainly see how an FPGA functions and show exactly how to create personalized digital logic using the Verilog hardware summary language (HDL).
Formerly, we showed how to develop limited state machines in Verilog and deploy them to our FPGA (https://youtu.be/pK6XN7sFosI). In this episode, we show just how to create components in Verilog as well as use criteria to make ordered designs.
The service to the challenge at the end of the episode can be found right here: https://www.digikey.com/en/maker/projects/introduction-to-fpga-part-6-verilog-modules-and-parameters/c7d4d01274be43278d8bc531e6b7acb7
All code instances and options for this series can be found here: https://github.com/ShawnHymel/introduction-to-fpga
A module in Verilog resembles a feature or course in programming languages. It allows you to recycle code without requiring to copy-and-paste components of your design. Furthermore, you can produce hierarchical designs that are typically less complicated to diagram and comprehend from a top-level point of view.
We show exactly how to develop a module out of our clock divider code from a previous episode. This code is wrapped in a module header to make sure that we can instantiate it in one more module. Note that it’s often taken into consideration great method to have one component per file.
We likewise introduce the idea of specifications. Unlike the “defparam” search phrase, the “specification” key words enables the instantiating code to change worths and performance within the instantiated module. For example, as opposed to utilizing a static MAX_COUNT worth that produces the exact same clock divider every single time, we turn MAX_COUNT into a criterion. This permits the instantiating code to transform just how much the module divides the input clock by.
Additionally, we show exactly how to utilize a variable bit-width value as a parameter. The instantiating code can alter COUNT_WIDTH, which alters the number of little bits are utilized for the counter in the clock divider panel component.
We create a high-level design that instantiates 2 various variations of the module to blink LEDs at different prices (by setting the criteria for each divider panel module differently).
We demonstrate how to define parameters making use of the 1995 variation of Verilog as well as the even more usual ANSI-style introduced in the 2001 variation.
Your challenge is to develop a layout that continually counts up and also down (alternating in between counting up from 0x0 to 0xF as well as down from 0xF to 0x0). You are to make use of components to accomplish this objective. Keep in mind that you are welcome to use the clock divider panel code and counter code from this and also previous episodes as a beginning factor.
Find out more:
Maker.io – https://www.digikey.com/en/maker
Digi-Key’s Blog– TheCircuit https://www.digikey.com/en/blog
Get in touch with Digi-Key on Facebook https://www.facebook.com/digikey.electronics/
And also follow us on Twitter https://twitter.com/digikey