Forum Discussion

Peter678's avatar
Peter678
Icon for New Contributor rankNew Contributor
3 years ago
Solved

Need help with this vhdl code

I have this code and the problem is that it says that G does not agree with his usage as a boolean operator when I try to give value to Z1 and I cant see the error. Please help and thank you. libr...
  • RichardT_altera's avatar
    3 years ago

    B is std_logic_vector (3 downto 0) while G is std_logic.

    The or operator needs operands of the same type, i.e all operands are boolean, or all of type std_logic.

    Try this:

    Z1 <= VB when (B = "0000") or (G = '0') else VA;


    Best Regards,

    Richard Tan

    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.