Challenge - 5 Problems
VHDL Process Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of a combinational process
What is the output of the signal
y after the following VHDL combinational process executes with inputs a = '1' and b = '0'?VHDL
process(a, b) begin if a = '1' then y <= '1'; else y <= b; end if; end process;
Attempts:
2 left
💡 Hint
Remember that in a combinational process, output depends immediately on inputs.
✗ Incorrect
Since
a = '1', the condition if a = '1' is true, so y is assigned '1'.❓ Predict Output
intermediateOutput behavior of a sequential process
Given the following VHDL sequential process triggered on the rising edge of clock
clk, what is the value of q after the clock rises if d = '0' and q was previously '1'?VHDL
process(clk) begin if rising_edge(clk) then q <= d; end if; end process;
Attempts:
2 left
💡 Hint
Sequential processes update outputs only on clock edges.
✗ Incorrect
At the rising edge of
clk, q is assigned the value of d, which is '0'.🧠 Conceptual
advancedDifference in sensitivity lists
Which statement correctly describes the difference in sensitivity lists between combinational and sequential processes in VHDL?
Attempts:
2 left
💡 Hint
Think about when each process should react to signal changes.
✗ Incorrect
Combinational processes react to any input change, so all inputs must be in the sensitivity list. Sequential processes react only on clock edges, so only the clock is listed.
🔧 Debug
advancedIdentify the error in a combinational process
What error will occur with the following VHDL combinational process?
VHDL
process(a, b) begin if a = '1' then y <= '1'; end if; end process;
Attempts:
2 left
💡 Hint
Think about what happens to
y when a is not '1'.✗ Incorrect
Because
y is not assigned a value when a is not '1', the synthesizer infers a latch to hold the previous value.❓ Predict Output
expertOutput of mixed combinational and sequential process
Consider the following VHDL code snippet. What is the value of
z after the rising edge of clk if a = '1', b = '0', and z was initially '0'?VHDL
process(a, b) begin if a = '1' then temp <= '1'; else temp <= b; end if; end process; process(clk) begin if rising_edge(clk) then z <= temp; end if; end process;
Attempts:
2 left
💡 Hint
Remember that
temp is updated combinationally and z updates on clock edge.✗ Incorrect
The combinational process sets
temp to '1' because a = '1'. On the rising edge of clk, z takes the value of temp, which is '1'.