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

For a NMOS transistor acting as a pass transistor, say the gate is connected to VDD, give the output for a square pulse input going from 0 to VDD

0 Answers   Infosys,


what is Latch up?How to avoid Latch up?

3 Answers  


Explain sizing of the inverter?

0 Answers   Infosys,


Draw a transistor level two input NAND gate. Explain its sizing (a) considering Vth (b) for equal rise and fall times

0 Answers   Infosys,


Explain the sizing of the inverter?

1 Answers   Intel,






What is a D-latch? Write the VHDL Code for it?

3 Answers   Intel,


What is Noise Margin? Explain the procedure to determine Noise Margin?

4 Answers   Amkor, Cisco, Infosys, Intel,


Mention what are the different gates where Boolean logic are applicable?

0 Answers  


Tell me how MOSFET works.

0 Answers  


What was your role in the silicon evaluation or product ramp? What tools did you use?

0 Answers   Intel,


what is charge sharing?

0 Answers   Intel,


What is Fowler-Nordheim Tunneling?

2 Answers   Intel,


Categories