definition of "and" operator using boolean arguments

Guest #2306888
Rate this post
• ▲ useful
▼ not useful
if you have an if statement with a condition:

  use ieee.std_logic_1164.all;
  ...
  signal x, y : std_logic;
  ...
  if(x = '1' AND y = '1') then

The "=" operator will return a boolean value, which simplifies the 
matter to any case with:

  if([boolean] AND [boolean]) then

Since VHDL is a strong-typed language, I assumed that the 
ieee.std_logic_1164 library would contain a definition for the "and" 
function with boolean arguments, but I cannot find it.  The only 
arguments are for std_logic_vector, signed, and unsigned types.  I don't 
think that VHDL would automatically cast TRUE as '1' and FALSE as '0' 
either, as that is not always the case.  Does anyone have some insight 
as to how this issue is resolved in VHDL during compilation?

Thanks

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.