Re: VHDL Newbie - Is this a valid statement?



have a nice synthesis

All,

Thank you very much for your help - I didn't realize it until I read
this last line that I hadn't included these signals in my synthesis,
and that was why my FSM was constantly looping when I synthesis.

Once again, thank you all for you quick responses,

nigel

backhus wrote:
Hi Nigel,
your source snippet seems to be ok. If your design isn't time critical
you can leave it the way it is.

To use a reset inside a design as a control signal is a philosophical
question.
But doing the compare inside your fsm increases the number of inputs
unnecessary. Better do that inside your counter and generate a
(synchronous) CountEnd signal there. This may speed up your FSM a little.


Comparing signals to constants is very common in VHDL. If your counter
has only four bits anyway it's sufficient to write
if(counter_q = "1101") THEN
...
end if;

One thing that may bother you is the chosen value. Is cnt_rst a
synchronous or an asynchronous input to the counter? If it's a
synchronous reset your counter may stay one count behind the expected
value (pipelinig effect, check your simulation). To overcome this you
can simply reduce the compare constant.

have a nice synthesis
Eilert




nigel502@xxxxxxxxx schrieb:
Hello,

My goal is to make a step in my FSM that loops until my counter reaches
it's desired value and then moves to it's next step - however I am
having issues detecting it reaching that desired value. I'm assuming
that something is wrong with my conditional statement. Can you compare
a signal against a constant value in VHDL

signal counter_q: std_logic_vector(3 downto 0);
.....
when read_del =>

cnt_rst <='0'; -- signal to reset counter - keep low here

if(counter_q(3 downto 0) = "1101") THEN
next_state <= blah;
else
next_state <= read_del;
end if;

What is the proper way to preform this action?

Thanks in advance


.



Relevant Pages

  • Re: phase comparator
    ... > I would like to compare the phase of two 1MHz sinewave and/or ... > squarewave) signals and get a output voltage proportional to their phase ... Is this because an IQ modulator/demodulator ... "Phase Lock Loop Circuit Design" by Dan Wolaver is a good book. ...
    (sci.electronics.design)
  • phase comparator
    ... I would like to compare the phase of two 1MHz sinewave and/or ... squarewave) signals and get a output voltage proportional to their phase ... shift, with a small phase angle error ie. 1% if possible. ... Is there a reason why an IQ modulator/demodulator can be made to operate ...
    (sci.electronics.design)
  • Re: VHDL Newbie - Is this a valid statement?
    ... To use a reset inside a design as a control signal is a philosophical question. ... But doing the compare inside your fsm increases the number of inputs unnecessary. ... Comparing signals to constants is very common in VHDL. ... If it's a synchronous reset your counter may stay one count behind the expected value ...
    (comp.lang.vhdl)
  • Re: Chart of HDTV freqs?
    ... Look at the spectra of the signals an compare the levels. ... Analog broadcast, ... because a weak digital signal's picture freezes or goes away. ...
    (rec.radio.amateur.antenna)
  • Re: PWM1 & PWM3 synchrounization problem of F2118 DSP!!
    ... I am setting COMPR1 and COMPR2 to produce two variable-duty cycle PWM ... although both signals are having the same period etc. (off ... if i use the same table (compare values) for both ... Is the timer a period register, or is this something perverse like ...
    (comp.dsp)