![]() |
|
|
|
#1 |
|
Hey Everyone,
Is this VHDL code valid: sig_a <= sig_b when sig_c = '1'; when sig_c = '0' I want sig_a to keep its current value. Or must the when clause always end with an else e.g. sig_a <= sig_b when sig_c = '1' else '0'; TIA Hans |
|
|
|
|
#2 |
|
Posts: n/a
|
Hans,
> Is this VHDL code valid: > > sig_a <= sig_b when sig_c = '1'; In VHDL-93 and beyond, yes. It simulates as a latch (level sensitive storage) just like you want. For synthesis, I would be cautious as some synthesis tools may not support this. If you are conservative, you would do well to use the equvalent process: process (sig_b, sig_c) begin if sig_c = '1' then sig_a <= sig_b ; end if ; end process ; The synthesis standard, 1076.6-2004 says compliant synthesis tools must support this, so if you find a tool that does not, kick them. Cheers, Jim -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ Jim Lewis Director of Training private.php?do=newpm&u= SynthWorks Design Inc. http://www.SynthWorks.com 1-503-590-4787 Expert VHDL Training for Hardware Design and Verification ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ Jim Lewis |
|
|
|
#3 |
|
Posts: n/a
|
> when sig_c = '0' I want sig_a to keep its current value. Or must the when
> clause always end with an else e.g. > > sig_a <= sig_b when sig_c = '1' else '0'; > > TIA The assignment you make is a combinational one that is you need to register sig_a if you want to keep the value. For that purpose you need a clock. process(Clk) begin if rising_edge(Clk) then sig_a <= sig_a; -- else tree of sic_c condition: you do not need it here, -- but it is good for visualization if sig_c='1' then sig_a <= sig_b; end if; end if; end process; ALuPin |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VHDL sll shift question | ohaqqi | Hardware | 4 | 09-29-2009 11:27 AM |
| How to execute an external software from VHDL? And how to interface VHDL with JAVA? | becool_nikks | Software | 0 | 03-06-2009 07:08 PM |
| Help on auto conversion from Matlab to vhdl on filter design | hardheart | Hardware | 0 | 12-07-2007 09:19 AM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | God | DVD Video | 3 | 04-25-2005 04:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | Filthy Mcnasty | DVD Video | 0 | 04-25-2005 04:29 AM |