Questions tagged [hdl]

HDL is a Hardware Description Language, a language used to design chips. The two major ones are Verilog and VHDL.

Taken from G.J. Lipovsky, "Hardware Description Languages: Voices from the Tower of Babel", Computer, Vol. 10, No. 6, June 1977, pp. 14-17. Paper available here.

A hardware description language can be used to describe the logic gates, the sequential machines, and the functional modules, along with their interconnection and their control, in a digital system. In a general sense, Boolean equations, logic diagrams, programrning languages, and Petri nets are hardware description languages: they can be used to describe some aspect of hardware and they have definable syntax and semantics. Specifically, what is more commonly referred to as a hardware description language is a variation of a programming language tuned to the overall needs of describing hardware.

Adapted from Hardware Description Language tutorial with very few modifications:

Hardware description language (HDL) is a specialized computer language used to program electronic and digital logic circuits. The structure, operation and design of the circuits are programmable using HDL. HDL includes a textual description consisting of operators, expressions, statements, inputs and outputs. Instead of generating a computer executable file, the HDL compilers provide a gate map. The gate map obtained is then downloaded to the programming device to check the operations of the desired circuit. The language helps to describe any digital circuit in the form of structural, behavioral and gate level and it is found to be an excellent programming language for FPGAs, CPLDs and ASICs.

The three common HDLs are Verilog, VHDL, and SystemC. Of these, SystemC is the newest. The HDLs will allow fast design and better verification. In most of the industries, Verilog and VHDL are common. Verilog, one of the main Hardware Description Language standardized as IEEE 1364 is used for designing all types of circuits. It consists of modules and the language allows Behavioral, Dataflow and Structural Description. VHDL (Very High Speed Integrated Circuit Hardware Description Language) is standardized by IEEE 1164. The design is composed of entities consisting of multiple architectures. SystemC is a language that consist a set of C++ classes and macros. It allows electronic system level and transaction modeling.

Need for HDLs

The Moore’s Law in the year 1970 has brought a drastic change in the field of IC technology. This change has made the developers to bring out complex digital and electronic circuits. But the problem was the absence of a better programming language allowing hardware and software codesign. Complex digital circuit designs require more time for development, synthesis, simulation and debugging. The arrival of HDLs has helped to solve this problem by allowing each module to be worked by a separate team.

All the goals like power, throughput, latency (delay), test coverage, functionality and area consumption required for a design can be known by using HDL. As a result, the designer can make the necessary engineering tradeoffs and can develop the design in a better and efficient way. Simple syntax, expressions, statements, concurrent and sequential programming is also necessary while describing the electronics circuits. All these features can be obtained by using a hardware description language. Now while comparing HDL and C languages, the major difference is that HDL provides the timing information of a design.

Benefits of HDL

The major benefit of the language is fast design and better verification. The Top-down design and hierarchical design method allows the design time; design cost and design errors to be reduced. Another major advantage is related to complex designs, which can be managed and verified easily. HDL provides the timing information and allows the design to be described in gate level and register transfer level. Reusability of resources is one of the other advantage.

See also:

906 questions
7
votes
1 answer

Verilog signed vs unsigned samples and first

Assuming I have a register reg [15:0] my_reg, which contains a 16-bit signed sample: How do I convert the sample from signed to unsigned? I have read this Wikipedia article, and am aware of the 2-bit complement for signed numbers, but how do I…
titus.andronicus
  • 517
  • 1
  • 7
  • 19
7
votes
5 answers

Prevent systemverilog compilation if certain macro isn't set

I am writing a systemverilog module and I need to make sure that a certain macro is set to allow compilation to proceed. I have tried the below, but it simply gives the syntax error "unexpected SYSTEM_IDENTIFIER" $fatal. I know that does technically…
miles.sherman
  • 171
  • 3
  • 11
7
votes
1 answer

Verilog: value(s) does not match array range, simulation mismatch

The following code synthesizes and simulates correctly as far as I can tell, but XST is still giving the following warning: value(s) does not match array range, simulation mismatch. Is there something I'm missing? Tool used: Xilinx ISE Project…
verigolfer
  • 359
  • 1
  • 10
7
votes
2 answers

What to use to compile and simulate Verilog programs on Mac OS X 10.6.8?

I am required to simulate Verilog programs as part of my syllabus. But, my college uses Xilinx ISE, and it isn't available for Mac. So please help me out with the best software and also some detailed steps on how to install and use them.
BharathYes
  • 787
  • 2
  • 9
  • 25
7
votes
3 answers

How to implement a (pseudo) hardware random number generator

How do you implement a hardware random number generator in an HDL (verilog)? What options need to be considered? This question is following the self-answer format. Addition answers and updates are encouraged.
Morgan
  • 19,934
  • 8
  • 58
  • 84
6
votes
2 answers

Difference between D Latch Schematic and D Flip Flop Schematic

I heard that the main difference between latch and flip flops is that latches are asynchronous while flip flops are edge triggered which makes sense. But when I check out their shematic they seem pretty much same. Here is the design of a dlatch from…
Crazy_Boy53
  • 241
  • 2
  • 4
  • 10
6
votes
2 answers

BCD Adder in Verilog

I am trying to write a BCD Adder in Verilog, but I am having trouble with one of the modules. Specifically, the adder that takes two BCD digits and adds them. So, the idea is if the sum of the two digits is less than or equal to nine, then it is…
DemonicImpact
  • 307
  • 2
  • 6
  • 12
6
votes
2 answers

What's the general procedure for compiling an HDL Program for an FPGA?

I have a question regarding the compilation of HDL programs within the context of FPGA design. 1) Why does the compilation process take so long? Is it really the compilation process that takes a long time, or is it the writing of individual logic…
Izzo
  • 4,461
  • 13
  • 45
  • 82
6
votes
3 answers

Is there a way to define something like a C struct in Verilog

I have a project, written in Verilog (importantly not SystemVerilog) which has gotten a little unmanageable due to the number of signals being passed along between different parts of the design. Since I have several modules which all need the same…
seanmk
  • 1,934
  • 15
  • 28
6
votes
2 answers

Parameter array in Verilog

Is it possible to create a parameter array in Verilog? For example, anything like the following: parameter[TOTAL-1 : 0] PARAM_ARRAY = {1, 0, 0, 2} If it is not possible, what could be the alternative solution?
user3610437
  • 71
  • 1
  • 1
  • 3
6
votes
2 answers

Why are nonblocking assignments not allowed in Verilog functions?

I have read that use of nonblocking assignments is not allowed in Verilog functions. Can anyone suggest a plausible explanation for this?
Akash
  • 89
  • 3
  • 8
5
votes
1 answer

Why use functions in verilog when there is module

Part 1: I was always told to use functions in Verilog to avoid code duplication. But can't I do that with a module? If my understanding is correct, all functions can be re-written as modules in Verilog except that modules cannot be instantiated from…
user3219492
  • 774
  • 1
  • 10
  • 18
5
votes
1 answer

"component instance "uut" is not bound" when simulating test bench with GHDL simulator

I am having a problem with using GHDL (http://ghdl.readthedocs.io/en/latest/) to simulate my VHDL design. So, when I use the command ghdl -e Averager_tb to compile the test bench with GHDL I get the warning: Averager_tb.VHD:33:3:warning: component…
SomeRandomPhysicist
  • 1,531
  • 4
  • 19
  • 42
5
votes
2 answers

logic gate XOR HDL not working with Nand2Tetris

i'm not too sure why my Nand2tetris simulator keep telling me line 3 error. can anyone tell me any problem with the following code: CHIP Xor { IN a, b; OUT out; PARTS: Not(in=a, out=nota); Not(in=b, out=notb); And(a=a,…
5
votes
1 answer

Verify Parameters in Verilog

I have created a module which accepts a single parameter specifying the byte width of the module's data lines. It looks something like: module wrapper# ( parameter DATA_BYTE_WIDTH = 1 ) ( din, dout, .. ); localparam DATA_BIT_WIDTH =…
Chris
  • 187
  • 1
  • 6
1
2
3
60 61