Initialising a signal

J

jan

Hello all,

Is there a difference between:

architecture b of e is
signal mysig: std_logic := '0';
begin
...
end architecture b;

AND,

architecture b of e is
signal mysig: std_logic;
begin
mysig <= '0';
...
end architecture b;
?

Thanks in advance.
 
V

valentin tihomirov

architecture b of e is
signal mysig: std_logic := '0';
begin
...
end architecture b;
simulation shows you constant '0', systesys will result in undefined output
architecture b of e is
signal mysig: std_logic;
begin
mysig <= '0';
...
end architecture b;
both syth and sim give you '0'.
 
J

jan

valentin said:
simulation shows you constant '0', systesys will result in undefined output


both syth and sim give you '0'.
Thanks, I have been porting some Verilog, and had lots of
wire mywire = 1'b0;
but Verilog doesn't have a seperate declaration area...
I have translated this like the second example above.
I am glad to see it is the better choice.
 
D

David Jones

Hello all,

Is there a difference between:

architecture b of e is
signal mysig: std_logic := '0';
begin
...
end architecture b;

AND,

architecture b of e is
signal mysig: std_logic;
begin
mysig <= '0';
...
end architecture b;

Yup.

At time zero, mysig in the first architecture will have value '0'.
For the second, it will have 'U' for a delta delay, at which point
the assignment to '0' will take effect.

For ASIC synthesis, the initialization to '0' might get kicked out
in the first architecture, while you are tying to ground in the
second.

FPGAs that feature initialization without reset will tolerate the
initial value in the first case. Still not recommended, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top