Bird
Raised Fist0
VHDLprogramming~20 mins

Synthesizable vs non-synthesizable constructs in VHDL - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
VHDL Synthesizable Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
Output 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;
ASignal <code>out_signal</code> first becomes '1' then after 10 ns becomes '0' and stays '0'.
BSignal <code>out_signal</code> stays '1' forever because wait statements are ignored in synthesis.
CSignal <code>out_signal</code> becomes '0' immediately without delay.
DThe code will cause a synthesis error due to the wait statement.
Attempts:
2 left
💡 Hint
Think about how wait statements affect simulation and synthesis differently.
🧠 Conceptual
intermediate
1:30remaining
Identifying synthesizable constructs
Which of the following VHDL constructs is synthesizable?
AA concurrent signal assignment with a conditional expression.
BA process containing a wait statement.
CA function that uses file I/O operations.
DA process with an infinite loop without any wait or sensitivity list.
Attempts:
2 left
💡 Hint
Synthesizable code must be implementable in hardware.
🔧 Debug
advanced
2:30remaining
Why 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;
ABecause conditional signal assignments inside a for loop are not synthesizable.
BBecause the for loop variable <code>i</code> is not declared.
CBecause signal assignments inside a clocked process must not use conditional expressions.
DBecause the conditional signal assignment syntax inside the loop is invalid.
Attempts:
2 left
💡 Hint
Check the syntax of the conditional assignment inside the loop.
📝 Syntax
advanced
2:00remaining
Which code snippet is synthesizable?
Which of the following VHDL code snippets is synthesizable?
A
process
begin
  q &lt;= d;
  wait for 10 ns;
end process;
B
process
begin
  wait until clk = '1';
  q &lt;= d;
end process;
C
process(clk)
begin
  if rising_edge(clk) then
    q &lt;= d;
  end if;
end process;
D
process(clk)
begin
  if clk = '1' then
    q &lt;= d;
  end if;
end process;
Attempts:
2 left
💡 Hint
Consider the correct way to write a clocked process for synthesis.
🚀 Application
expert
3:00remaining
Determining 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;
ABoth signals <code>a</code> and <code>b</code> will be synthesized as registers.
BNo signals will be synthesized because of the wait statement inside the process.
COnly signal <code>a</code> will be synthesized as a register.
DOnly signal <code>b</code> will be synthesized as a register.
Attempts:
2 left
💡 Hint
Wait statements inside clocked processes are not synthesizable.

Practice

(1/5)
1. Which of the following VHDL constructs is synthesizable and can be implemented in hardware?
easy
A. Use of assert statements for debugging
B. A process containing wait for 10 ns; statements
C. File I/O operations like reading from a text file
D. A process with only clocked assignments and no wait statements

Solution

  1. Step 1: Identify synthesizable constructs

    Synthesizable code must describe hardware behavior, typically using clocked processes without delays or waits.
  2. Step 2: Analyze each option

    A process with only clocked assignments and no wait statements uses clocked assignments without waits, so it is synthesizable. Options A, B, and D use waits, assertions, or file I/O, which are non-synthesizable.
  3. Final Answer:

    A process with only clocked assignments and no wait statements -> Option D
  4. Quick Check:

    Synthesizable = clocked process without wait [OK]
Hint: Synthesizable means no waits or file I/O, just clocked logic [OK]
Common Mistakes:
  • Thinking wait statements are synthesizable
  • Confusing assert for hardware logic
  • Assuming file I/O can be synthesized
2. Which VHDL syntax is not synthesizable?
easy
A. A process with a wait until clk = '1'; statement
B. Concurrent signal assignment outside any process
C. Signal assignment inside a clocked process
D. Using rising_edge(clk) inside a process

Solution

  1. Step 1: Understand wait statement restrictions

    Wait statements like wait until clk = '1'; are not synthesizable because hardware cannot implement arbitrary waits.
  2. Step 2: Check other options

    Options A, B, and C are standard synthesizable constructs: clock edge detection, signal assignments in processes, and concurrent assignments.
  3. Final Answer:

    A process with a wait until clk = '1'; statement -> Option A
  4. Quick Check:

    Wait statements = non-synthesizable [OK]
Hint: Wait statements inside processes are never synthesizable [OK]
Common Mistakes:
  • Assuming wait until is synthesizable
  • Confusing sensitivity list with wait statements
  • Thinking concurrent assignments are non-synthesizable
3. What is the output behavior of this VHDL process when synthesized?
process(clk)
begin
  if rising_edge(clk) then
    if reset = '1' then
      q <= '0';
    else
      q <= d;
    end if;
  end if;
end process;
medium
A. q synchronously resets to '0' on clock edge when reset is '1'
B. q asynchronously resets to '0' when reset is '1'
C. q changes immediately when reset is '1', ignoring clock
D. q never resets because reset is ignored

Solution

  1. Step 1: Analyze reset behavior inside clocked process

    The reset check is inside the rising_edge(clk) condition, so reset is synchronous.
  2. Step 2: Understand output assignment timing

    q is assigned '0' only on clock edge when reset is '1', otherwise q follows d on clock edges.
  3. Final Answer:

    q synchronously resets to '0' on clock edge when reset is '1' -> Option A
  4. Quick Check:

    Synchronous reset inside clock edge = q synchronously resets to '0' on clock edge when reset is '1' [OK]
Hint: Reset inside rising_edge means synchronous reset [OK]
Common Mistakes:
  • Thinking reset is asynchronous here
  • Assuming q changes immediately without clock
  • Ignoring the rising_edge condition
4. Identify the error in this VHDL code snippet that prevents synthesis:
process(clk)
begin
  wait until clk = '1';
  q <= d;
end process;
medium
A. Signal assignment outside process
B. Missing sensitivity list in process
C. Using wait statement inside a clocked process
D. Incorrect use of <= operator

Solution

  1. Step 1: Check for wait statement usage

    Wait statements inside processes are not synthesizable and cause synthesis errors.
  2. Step 2: Verify other syntax elements

    The process has a sensitivity list (clk), signal assignment is inside process, and <= is correctly used.
  3. Final Answer:

    Using wait statement inside a clocked process -> Option C
  4. Quick Check:

    Wait inside process = synthesis error [OK]
Hint: Wait statements inside processes cause synthesis errors [OK]
Common Mistakes:
  • Ignoring that wait is not synthesizable
  • Confusing sensitivity list with wait usage
  • Thinking <= operator is wrong here
5. You want to write a testbench to verify a VHDL design. Which construct is non-synthesizable but useful for simulation only?
hard
A. A clocked process with if rising_edge(clk) condition
B. A process with wait for 20 ns; to generate clock signals
C. Concurrent signal assignment for output signals
D. Signal assignment inside a synchronous reset process

Solution

  1. Step 1: Identify testbench constructs

    Testbenches often use wait for statements to simulate timing delays, which are non-synthesizable.
  2. Step 2: Compare with synthesizable constructs

    Options A, C, and D describe synthesizable hardware behavior, not simulation-only code.
  3. Final Answer:

    A process with wait for 20 ns; to generate clock signals -> Option B
  4. Quick Check:

    Wait for delays = simulation only [OK]
Hint: Use wait for delays only in testbenches, not hardware [OK]
Common Mistakes:
  • Using wait for in synthesizable design code
  • Confusing testbench and design code constructs
  • Assuming clocked processes are non-synthesizable
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard