Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

way to use NOT() or ! operator in ADHL to switch between VCC and GND?

I inherited a AHDL code in Quartus II, that I have been able to modify, but I'm not proficient. Is there anyway to negate a variable that is set to either VCC or GND? I've seen that ! works in VHDL, but it doesn't appear to work in AHDL. And neither does NOT(). I'm basically looking for a way to switch between two states on every run. Hopefully the example (and purely illustrative) code makes this clearer.

skip = VCC;

ccd_state = state1;

some kind of loop

{

IF (skip == VCC) THEN

ccd_state = state1;

skip = !skip;

ELSIF (some other condition) THEN

ccd_state = state2;

skip = !skip;

ELSE

Something else

}

Thanks,

Elliot

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ! is not an operator in VHDL.

    ! is the not operator in AHDL.

    Where are you trying to compile this code?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm not sure what you mean about where I'm compiling the code. I'm doing everything in Quartus II. Like I said, I'm far from proficient in this.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It was just that you got your languages mixed up in your origional post and wondered if you tried to compile AHDL in modelsim or something.

    You never actually said what the problem was other than "it doesnt work". Are there any error messages? is it just not working on hardware like you expected?