Altera_Forum
Honored Contributor
14 years agosimulation unexpected output
Hi everybody,
I'm currently writing some vhdl just for my own personal interest and i have a signal that I want to be a '0' or '1' based on some integer input, here's the line of code: cout <= '1' when variable_length_int /= 0 else '0'; and everything works fine except when the signal should be '0' in the simulation it turns to unknown instead. I've tried a few ways around this, having a constant zero signal assigned instead of just '0', switching it to "cout <= '0' when variable_length_int = 0 else '1';" neither of which has changed the behavior in simulation one idea is if I could OR all the digits of this integer (in a generic way) but I dont know how to do that just yet either so i have 2 questions, why is the signal unknown when it should be zero, and is there a way in standard IEEE vhdl to OR individual bits of an integer or signal in a generic way (like a signal thats a bit vector 0 to n-1)? thanks!