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

How does the size of PMOS Pull Up transistors (for bit & bit- lines) affect SRAM's performance?

740


Cross section of a PMOS transistor?

4253


what is the use of defpararm?

721


Working of a 2-stage OPAMP?

2607


Describe the various effects of scaling?

4320






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

946


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

2743


Write a program to explain the comparator?

677


Tell me how MOSFET works.

1932


Write a VLSI program that implements a toll booth controller?

3498


Draw the stick diagram of a NOR gate. Optimize it

758


What are the main issues associated with multiprocessor caches and how might you solve them?

1742


Give a big picture of the entire SRAM Layout showing your placements of SRAM Cells, Row Decoders, Column Decoders, Read Circuit, Write Circuit and Buffers

637


You have a driver that drives a long signal & connects to an input device. At the input device there is either overshoot, undershoot or signal threshold violations, what can be done to correct this problem?

2183


Explain how MOSFET works?

2806