Digital Design Tip: A Few HDL "No-Nos"

Sept. 14, 2006
If you're designing a circuit in a high-level design language like Verilog or VHDL, there are a few simple rules to follow to ensure the synthesizer generates the intended circuit. First, avoid using both positive and negative edge-triggered flip-flo

If you're designing a circuit in a high-level design language like Verilog or VHDL, there are a few simple rules to follow to ensure the synthesizer generates the intended circuit.

First, avoid using both positive and negative edge-triggered flip-flops for the same clock signal. Triggering flip-flops off different edges of the same clock likely will result in one or more inverters being introduced into the clock path. This normally will cause an unwanted skew in the clock signal.

Second, always specify all logic conditions explicitly or use a default assignment. The most common mistake is to specify an IF-THEN statement with no ELSE when designing a multiplexer. Frequently, this will be interpreted as a level-sensitive latch. A similar mistake often is made with case statements where one specific case is forgotten or the default case is not specified.

Third, watch out for multiple assignments to the same variable. Typically, the cause of this might be a simple copy and paste of code where the variable name change was forgotten. If the synthesis engine even allows this type of error, you can be sure the results will be undesirable.

Note that most HDL design tools would provide warnings for the above issues, which is why they should never be turned off or ignored. Keep your compiler and synthesis tool happy, and you will be happy.

Have a design tip? Send it to [email protected]

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!