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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What types of high speed CMOS circuits have you designed?

2060


What are the Factors affecting Power Consumption on a chip?

761


What is the ideal input and output resistance of a current source?

2513


Draw Vds-Ids curve for a MOSFET. Now, show how this curve changes with increasing transistor width.

782


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

1066






What is the difference between synchronous and asynchronous reset?

616


What is the critical path in a SRAM?

2614


Draw a 6-T SRAM Cell and explain the Read and Write operations

795


Explain what is the use of defpararm?

652


Explain the three regions of operation of a mosfet.

622


For f = AB+CD if B is S-a-1, what are the test vectors needed to detect the fault?

734


6-T XOR gate?

3786


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

1975


What is the difference between nmos and pmos technologies?

644


Explain Cross section of a PMOS transistor?

742