I'm writing a sequential counter which is comprised of a series of single-counter components which use D-flip-flop components. Within the single-counter, I need to start with an initial value of '0' for q, but I am having problems initializing this.
q is a STD_LOGIC signal, and I have attempted to initialize it as follows:
signal q : STD_LOGIC := '0';
However, when I run the program using ModelSim it shows a value of U as though it is unassigned. If I force freeze a signal of '0' to q when I run it in ModelSim, then it works.
Is the only way to accomplish this to check the value at the beginning of the behavioral description and set it to '0' if it is unassigned?
If I use BIT instead of STD_LOGIC, everything works perfectly.
I would post my code, but I don't want to risk academic integrity violations as this is for a school project.
0and there is a driver driving 'U', the two values resolve to 'U'. (And if you didn't understand that, read up about resolution functions). - user_1818839qfrom a D-flip-flop component to theqspecified in the question. Is this what you mean? - Ryan McClure