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

Reply

VHDL - can 2 if's to 1 if save 1 clock cycle?

 
Thread Tools Search this Thread
Old 05-04-2005, 11:23 AM   #1
Default can 2 if's to 1 if save 1 clock cycle?


Hi,
I would like to ask if altering 1st code into 2nd would help save 1 clock
cycle.

1)process(clk)
begin
if(reset='1') then
xyz<="00";
else
if(clk'event and clk='1') then
xyz<="11";
:
:
:


2)process(clk)
begin
if(reset='1') then
xyz<="00";
elsif(reset='0' and (clk'event and clk='1')) then
xyz<="11";
:
:
:

Thanks!



bxbxb3
  Reply With Quote
Old 05-04-2005, 11:30 AM   #2
Mohammed A khader
 
Posts: n/a
Default Re: can 2 if's to 1 if save 1 clock cycle?
Hi ,

Both are functionally same. You cannot save any clock cycle here.

your sensitivity list is not complete , it must include reset since
it is outside the synchronous condition.

-- Mohammed A Khader.



Mohammed A khader
  Reply With Quote
Old 05-06-2005, 05:13 AM   #3
Jim George
 
Posts: n/a
Default Re: can 2 if's to 1 if save 1 clock cycle?
bxbxb3 wrote:
> Hi,
> I would like to ask if altering 1st code into 2nd would help save 1 clock
> cycle.
>
> 1)process(clk)
> begin
> if(reset='1') then
> xyz<="00";
> else
> if(clk'event and clk='1') then
> xyz<="11";
> :
> :
> :
>
>
> 2)process(clk)
> begin
> if(reset='1') then
> xyz<="00";
> elsif(reset='0' and (clk'event and clk='1')) then
> xyz<="11";
> :
> :
> :
>
> Thanks!
>


Don't think of VHDL as a sequential language, in which statements
execute one after the other. All synthesizable statements in a vhdl
program synthesize into logic of some form, in your case it will form a
pair of registers (xyz<1> and xyz<0>) which have an asynchronous reset
and both D inputs are connected to logic '1'. Both pieces of code do the
same thing, one is not more efficient than the other.
-Jim


Jim George
  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
Users cannot save password in browser?? rmartin General Help Related Topics 2 08-11-2007 06:00 AM
Post-Route Simulation does not give output for the first clock cycle Options velocityreviews Software 0 04-17-2007 05:47 PM
DVD Verdict reviews: KYO KARA MAOH!: GOD SAVE OUR KING (VOLUME 3) and more! DVD Verdict DVD Video 0 11-10-2005 09:16 AM
New Releases: Revelations, The Librarian & My Left Foot: Updated complete downloadable R1 DVD DB & Info lists Doug MacLean DVD Video 0 05-17-2005 06:57 AM
Hollywood Detective - The Buried Clock David Marsh DVD Video 1 09-27-2004 11:26 PM




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