Consider the following VHDL stimulus process. What will be the value of signal_a after 30 ns?
process begin signal_a <= '0'; wait for 10 ns; signal_a <= '1'; wait for 10 ns; signal_a <= '0'; wait for 10 ns; wait; end process;
Think about how the signal changes at each wait statement and the total elapsed time.
The process assigns '0' at 0 ns, then waits 10 ns. At 10 ns, it assigns '1', then waits 10 ns. At 20 ns, it assigns '0' again, then waits 10 ns. At 30 ns, the last assignment was '0'.
Given this VHDL stimulus process, what is the value of signal_b at 25 ns?
process begin signal_b <= '1'; wait for 5 ns; signal_b <= '0'; wait for 15 ns; signal_b <= '1'; wait for 10 ns; wait; end process;
Calculate the time intervals and see which assignment is active at 25 ns.
At 0 ns, signal_b = '1'. After 5 ns, it changes to '0'. After 20 ns (5+15), it changes to '1'. At 25 ns, which is between 20 ns and 30 ns, signal_b is '1'. But wait, 25 ns is after 20 ns assignment to '1'. So the correct value is '1'.
What will be the value of signal_c at 50 ns given this process?
process begin signal_c <= '0'; wait until now = 20 ns; signal_c <= '1'; wait for 20 ns; signal_c <= '0'; wait; end process;
Consider how wait until and wait for affect the timing of assignments.
The process waits until 20 ns, then assigns '1'. Then it waits 20 ns more (until 40 ns), assigns '0'. At 50 ns, the last assignment was '0'.
What is the final value of signal_d after this process completes?
process begin signal_d <= '1'; wait for 10 ns; signal_d <= '0'; wait for 10 ns; signal_d <= '1'; wait for 10 ns; signal_d <= '0'; wait; end process;
Follow the signal assignments and wait times step by step.
The signal changes at 0 ns to '1', at 10 ns to '0', at 20 ns to '1', and at 30 ns to '0'. The process then waits indefinitely. So the final value is '0'.
In a VHDL stimulus process with multiple wait statements, what happens to the process execution after the last wait; statement?
Think about how wait; without conditions affects process behavior.
A wait; statement without any condition causes the process to suspend indefinitely. It will only resume if an external event triggers it (like a signal change if sensitivity list or wait conditions exist). It does not restart or terminate.