Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Initialising a signal

 
Thread Tools Search this Thread
Old 12-16-2003, 02:30 PM   #1
Default Initialising a signal


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.

--
Jacques Viviers



jan
  Reply With Quote
Old 12-16-2003, 03:05 PM   #2
valentin tihomirov
 
Posts: n/a
Default Re: Initialising a signal
> 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'.




valentin tihomirov
  Reply With Quote
Old 12-16-2003, 07:35 PM   #3
jan
 
Posts: n/a
Default Re: Initialising a signal
valentin tihomirov wrote:
>>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'.
>
>

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.

--
JV



jan
  Reply With Quote
Old 12-23-2003, 01:25 PM   #4
David Jones
 
Posts: n/a
Default Re: Initialising a signal
In article <brn55b$b4j$>,
jan <> wrote:
>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.



David Jones
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I am having trouble editing a signal in a sub program. Haai Hardware 0 08-28-2007 02:58 PM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
IMHO, Digital SECAM video is better than Analog NTSC video Radium DVD Video 167 10-25-2006 04:16 AM
Convert S-video to RF signal Monkey Monkey DVD Video 10 01-14-2004 08:17 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46