Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Vhdl question: about the difference of variable and signal.

Status
Not open for further replies.

ambar686

Junior Member level 1
Junior Member level 1
Joined
Sep 1, 2013
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Dankuni, India, India
Visit site
Activity points
128
I want to know when i have to use variable in a VHDL program and when i have to use signal in a program. Please help me.
 
Last edited by a moderator:

Dont call VHDL a program. It is a description of hardware (VHSIC Hardware description language).

Variables can always be avoided. Always use signals until you are confident you know what you are doing.

Signals are assigned when a process suspends, variables are assigned immediatly. Signals in a clocked process will always map to a register, and outside a process map to a wire. Variables can map to different things depending on where they are assigned (hence why you need to be careful).

So there is no rule when to use a variable over a signal. It depends what logic you want and what you want the code to look like. Too many software programmers use variables because it makes their VHDL simulation behave like software. But they end up with terrible hardware.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top