![]() |
|
|
|||||||
![]() |
VHDL - can 2 if's to 1 if save 1 clock cycle? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |