Challenge - 5 Problems
Process Execution Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateProcess sensitivity list behavior
Consider the following VHDL process. What is the output on signal
out_sig after the process executes once, assuming clk = '1' and rst = '0' at the start?process(clk, rst)
begin
if rst = '1' then
out_sig <= '0';
elsif rising_edge(clk) then
out_sig <= not out_sig;
end if;
end process;VHDL
signal out_sig : std_logic := '0'; signal clk, rst : std_logic; -- Initial values: clk = '1', rst = '0' -- Process runs once
Attempts:
2 left
💡 Hint
Remember that the process triggers on changes to clk or rst, and the rising_edge function checks for a 0 to 1 transition. At simulation start with clk='1', there is no rising edge event.
✗ Incorrect
At simulation time 0, the process executes once. rst='0', so reset skipped. rising_edge(clk) requires clk='1', clk'EVENT=true, and clk'LAST_VALUE='0', but at t=0 with clk='1', no event occurred, so false. No assignment, out_sig remains '0'.
🧠 Conceptual
intermediateProcess execution and delta cycles
In VHDL simulation, what happens when multiple processes are sensitive to the same signal and that signal changes?
Choose the correct statement about process execution and delta cycles.
Choose the correct statement about process execution and delta cycles.
Attempts:
2 left
💡 Hint
Think about how VHDL schedules processes and updates signals in simulation time.
✗ Incorrect
When a signal changes, all processes sensitive to it are scheduled to run in the same delta cycle but execute sequentially in an arbitrary order. Signal assignments take effect after the delta cycle, so other processes see old values during the current delta cycle.
🔧 Debug
advancedUnexpected output due to missing sensitivity list
Given this VHDL process, what is the main reason
out_sig does not update as expected?process begin wait until clk = '1'; out_sig <= not out_sig; end process;
Attempts:
2 left
💡 Hint
Consider how processes with wait statements behave in VHDL simulation, especially level-sensitive conditions.
✗ Incorrect
This process uses level-sensitive 'wait until clk = "1"'. On rising edge, it toggles and loops back. If clk remains '1', the wait condition is true, process does not suspend, loops infinitely toggling in zero time, causing simulation deadlock (infinite delta cycles). Use 'wait until rising_edge(clk)' for proper edge sensitivity.
📝 Syntax
advancedIdentify the syntax error in process declaration
Which option contains the correct syntax for a VHDL process with sensitivity list for signals
a and b?Attempts:
2 left
💡 Hint
Check the punctuation and keywords used in the process header.
✗ Incorrect
The correct syntax uses parentheses with signals separated by commas. Option A correctly uses process(a, b). Options B, C, and D have syntax errors: missing parentheses, missing commas, or wrong separators.
🚀 Application
expertProcess execution order with multiple signals
Given two processes below, what is the value of
out1 and out2 after signal sig changes from '0' to '1' in simulation?signal sig : std_logic := '0'; signal out1, out2 : std_logic := '0'; process(sig) begin out1 <= sig; end process; process(sig) begin out2 <= not sig; end process;
Attempts:
2 left
💡 Hint
Remember that signal assignments take effect after the process completes and delta cycles separate updates.
✗ Incorrect
sig changes to '1', generating an event. Both processes sensitive to sig are resumed in the current delta cycle, execute sequentially in arbitrary order, and read the new value sig='1'. out1 <= '1'; out2 <= not '1' = '0'. The <= assignments schedule updates for the next delta cycle. Thus, after the delta cycle, out1='1', out2='0'.
