Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case? statement in listing 5.12 #41

Open
maltaisn opened this issue Mar 3, 2021 · 1 comment
Open

case? statement in listing 5.12 #41

maltaisn opened this issue Mar 3, 2021 · 1 comment

Comments

@maltaisn
Copy link

maltaisn commented Mar 3, 2021

begin
case (ABC) is
when "100" => F_OUT <= '1';
when "-11" => F_OUT <= '1';
when others => F_OUT <= '0';
end case;
end process my_proc;

That didn't work for me when using GHDL, it outputs 0 for 011 and 111, not 1. I found this StackOverflow question mentioning that a case? statement should be used with don't cares, however that requires VHDL-2008.

@fabriziotappero
Copy link
Owner

thanks for the question.
The "don't care" (symbol "-") is valid VHDL but not very commonly used. As discussed at pag 64 it is advised not to use it because not always implemented everywhere. GHDL is great tool but not a industry reference.

What would be your suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants