Challenge - 5 Problems
VHDL Synthesizable Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of a process with wait statement
Consider the following VHDL process. What will be the output on signal
out_signal after simulation?VHDL
process begin out_signal <= '1'; wait for 10 ns; out_signal <= '0'; wait; end process;
Attempts:
2 left
💡 Hint
Think about how wait statements affect simulation and synthesis differently.
✗ Incorrect
The wait statement pauses the process in simulation, so
out_signal changes after 10 ns. This is valid for simulation but not synthesizable. However, the question asks about simulation output.🧠 Conceptual
intermediateIdentifying synthesizable constructs
Which of the following VHDL constructs is synthesizable?
Attempts:
2 left
💡 Hint
Synthesizable code must be implementable in hardware.
✗ Incorrect
Concurrent signal assignments with conditions are synthesizable. Wait statements and file I/O are not synthesizable. Infinite loops without wait or sensitivity cause simulation hang and are not synthesizable.
🔧 Debug
advancedWhy does this VHDL code fail synthesis?
Given the following code snippet, why will synthesis tools reject it?
VHDL
process(clk) begin if rising_edge(clk) then for i in 0 to 7 loop data_out(i) <= data_in(i) when enable = '1' else '0'; end loop; end if; end process;
Attempts:
2 left
💡 Hint
Check the syntax of the conditional assignment inside the loop.
✗ Incorrect
The syntax
signal <= value when condition else other_value; is a concurrent statement and cannot be used inside a sequential process. Inside a process, you must use if-else statements.📝 Syntax
advancedWhich code snippet is synthesizable?
Which of the following VHDL code snippets is synthesizable?
Attempts:
2 left
💡 Hint
Consider the correct way to write a clocked process for synthesis.
✗ Incorrect
Option C uses the standard rising_edge(clk) check which is synthesizable. Option C uses wait until which is not synthesizable. Option C uses wait for which is not synthesizable. Option C uses a level check instead of edge detection, which is not recommended and may not synthesize correctly.
🚀 Application
expertDetermining synthesizable code from mixed constructs
Given the following VHDL code, how many signals will be correctly synthesized into hardware registers?
VHDL
signal a, b, c : std_logic; process(clk) begin if rising_edge(clk) then a <= b and c; wait for 5 ns; b <= a or c; end if; end process;
Attempts:
2 left
💡 Hint
Wait statements inside clocked processes are not synthesizable.
✗ Incorrect
The presence of a wait statement inside a clocked process makes the entire process non-synthesizable. Therefore, no registers will be created for signals
a or b.