Differences between Signals and Variables in VHDL? If the
same code is written using Signals and Variables what does
it synthesize to?



Differences between Signals and Variables in VHDL? If the same code is written using Signals and Va..

Answer / seetharamukg

Signals updates a value after some "delta" time or at the
end of the process. But variable updates a value immediately.

Both variable and signals are synthesizable.
Designer should know hoe to use these 2 objects.

Ex: Signal usage
Library IEEE;
use IEEE.std_logic_1164.all;
entity xor_sig is
port (
A, B, C: in STD_LOGIC;
X, Y: out STD_LOGIC
);
end xor_sig;
architecture SIG_ARCH of xor_sig is
signal D: STD_LOGIC;
begin
SIG:process (A,B,C)
begin
D <= A; -- ignored !!
X <= C xor D;
D <= B; -- overrides !!
Y <= C xor D;
end process;
end SIG_ARCH;

Variable usage:
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity xor_var is
port (
A, B, C: in STD_LOGIC;
X, Y: out STD_LOGIC
);
end xor_var;
architecture VAR_ARCH of xor_var is
begin
VAR:process (A,B,C)
variable D: STD_LOGIC;
begin
D := A;
X <= C xor D;
D := B;
Y <= C xor D;
end process;
end VAR_ARCH;

Is This Answer Correct ?    48 Yes 9 No

Post New Answer

More VLSI Interview Questions

How do you detect if two 8-bit signals are same?

6 Answers  


How does Resistance of the metal lines vary with increasing thickness and increasing length?

3 Answers   Infosys,


Explain the operation considering a two processor computer system with a cache for each processor.

0 Answers   Intel,


Draw the Layout of an Inverter?

0 Answers   Intel,


If the current through the poly is 20nA and the contact can take a max current of 10nA how would u overcome the problem?

0 Answers   Intel,






Explain Clock Skew?

6 Answers   Intel, nvidia,


Draw the SRAM Write Circuitry

0 Answers   Infosys,


Draw the timing diagram for a SRAM Read. What happens if we delay the enabling of Clock signal?

0 Answers   Infosys,


What are the different limitations in increasing the power supply to reduce delay?

2 Answers  


why is the number of gate inputs to CMOS gates usually limited to four?

0 Answers  


what is Slack?

0 Answers  


What work have you done on full chip Clock and Power distribution? What process technology and budgets were used?

0 Answers   Intel,


Categories