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 transistor level design tools are you proficient with? What types of designs were they used on?

4571


Explain Cross section of a PMOS transistor?

748


Explain sizing of the inverter?

3907


Let A & B be two inputs of the NAND gate. Say signal A arrives at the NAND gate later than signal B. To optimize delay, of the two series NMOS inputs A & B, which one would you place near the output?

872


What are the steps involved in preventing the metastability?

652






Explain CMOS Inverter transfer characteristics?

3449


Explain how logical gates are controlled by Boolean logic?

630


How about voltage source?

1837


What types of I/O have you designed? What were their size? Speed? Configuration? Voltage requirements?

2008


What are the ways to Optimize the Performance of a Difference Amplifier?

1813


Tell me how MOSFET works.

1936


What are the different classification of the timing control?

579


Draw the Layout of an Inverter?

2049


What are the various regions of operation of mosfet? How are those regions used?

590


In Verilog code what does “timescale 1 ns/ 1 ps” signifies?

697