Bird
Raised Fist0
VHDLprogramming~20 mins

Concurrent signal assignment in VHDL - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Concurrent Signal Assignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
Output of concurrent signal assignment with multiple drivers
What is the value of signal out_signal after simulation if the following concurrent assignments are used?

signal out_signal : std_logic;

begin
  out_signal <= '0';
  out_signal <= '1';
end;
VHDL
signal out_signal : std_logic;
begin
  out_signal <= '0';
  out_signal <= '1';
end;
A'0'
BX (unknown)
CZ (high impedance)
D'1'
Attempts:
2 left
💡 Hint
In VHDL, multiple concurrent assignments to the same std_logic signal create multiple drivers. Conflicting values ('0' and '1') resolve to 'X'.
❓ Predict Output
intermediate
2:00remaining
Concurrent assignment with conditional signal assignment
Given the following concurrent signal assignment, what is the value of out_signal when enable = '0'?

signal out_signal : std_logic;
signal enable : std_logic;

begin
  out_signal <= '1' when enable = '1' else '0';
end;
VHDL
signal out_signal : std_logic;
signal enable : std_logic;
begin
  out_signal <= '1' when enable = '1' else '0';
end;
A'1'
BZ (high impedance)
C'0'
DX (unknown)
Attempts:
2 left
💡 Hint
Check the condition in the conditional assignment carefully.
🔧 Debug
advanced
2:00remaining
Identify the error in concurrent signal assignment
What error will the following VHDL code produce?

signal a, b : std_logic;
signal c : std_logic;

begin
  c <= a and b;
  c <= a or b;
end;
VHDL
signal a, b : std_logic;
signal c : std_logic;
begin
  c <= a and b;
  c <= a or b;
end;
ANo error, c will be resolved from both assignments
BMultiple drivers error (signal driven by multiple sources without resolution)
CSyntax error: missing semicolon
DType mismatch error
Attempts:
2 left
💡 Hint
std_logic is a resolved type, so multiple drivers from concurrent assignments are allowed.
📝 Syntax
advanced
2:00remaining
Correct syntax for concurrent signal assignment with selected signal assignment
Which of the following is the correct syntax for a concurrent selected signal assignment in VHDL?

Awith sel select out_signal <= '0' when "00"; '1' when "01"; 'Z' when others;
Bwith sel select out_signal <= '0' when "00" else '1' when "01" else 'Z' when others;
Cwith sel select out_signal <= '0' when "00" | '1' when "01" | 'Z' when others;
Dwith sel select out_signal <= '0' when "00", '1' when "01", 'Z' when others;
Attempts:
2 left
💡 Hint
Remember the syntax uses commas to separate choices, not else or semicolons.
🚀 Application
expert
2:00remaining
Number of drivers in concurrent signal assignment
Consider the following VHDL code snippet:

signal x, y, z : std_logic;
signal out_signal : std_logic;

begin
  out_signal <= x and y;
  out_signal <= z;
end;

How many drivers does out_signal have during simulation?
VHDL
signal x, y, z : std_logic;
signal out_signal : std_logic;
begin
  out_signal <= x and y;
  out_signal <= z;
end;
A2 drivers
B1 driver
C3 drivers
D0 drivers
Attempts:
2 left
💡 Hint
Each concurrent assignment to the same signal creates a driver.

Practice

(1/5)
1. What does a concurrent signal assignment in VHDL do?
signal_name <= expression;
easy
A. Continuously updates the signal with the expression value in parallel
B. Executes the assignment only once at the start
C. Assigns the signal value sequentially after a delay
D. Creates a variable instead of a signal

Solution

  1. Step 1: Understand concurrent assignment meaning

    Concurrent signal assignment updates the signal continuously and in parallel with other concurrent statements.
  2. Step 2: Compare with other options

    Options B and C describe sequential or one-time behavior, which is incorrect. Creates a variable instead of a signal confuses signals with variables.
  3. Final Answer:

    Continuously updates the signal with the expression value in parallel -> Option A
  4. Quick Check:

    Concurrent assignment = continuous parallel update [OK]
Hint: Concurrent means always active and parallel [OK]
Common Mistakes:
  • Thinking assignment happens only once
  • Confusing signals with variables
  • Assuming sequential execution
2. Which of the following is the correct syntax for a concurrent signal assignment in VHDL?
easy
A. signal_name <= expression;
B. signal_name = expression;
C. signal_name := expression;
D. signal_name -> expression;

Solution

  1. Step 1: Recall VHDL signal assignment syntax

    In VHDL, concurrent signal assignment uses the "<=" operator.
  2. Step 2: Eliminate incorrect options

    signal_name := expression; uses ":=", which is for variables, not signals. signal_name = expression; uses "=", which is not valid for signal assignment. signal_name -> expression; uses "->", which is invalid syntax.
  3. Final Answer:

    signal_name <= expression; -> Option A
  4. Quick Check:

    Signal assignment operator = <= [OK]
Hint: Use <= for signals, := for variables [OK]
Common Mistakes:
  • Using := instead of <=
  • Using = for signal assignment
  • Confusing signal and variable syntax
3. Given the following VHDL code snippet:
signal a, b, c : std_logic;
b <= '1';
c <= b;
a <= c;

What is the value of signal a after simulation stabilizes?
medium
A. '0'
B. '1'
C. 'U' (uninitialized)
D. Simulation error

Solution

  1. Step 1: Trace signal assignments

    b is assigned '1' concurrently, so b = '1'. Then c <= b means c = '1'. Then a <= c means a = '1'.
  2. Step 2: Understand concurrent updates

    All assignments happen in parallel, so signals propagate the value '1' through b, c, and a.
  3. Final Answer:

    '1' -> Option B
  4. Quick Check:

    Signal chain propagates '1' [OK]
Hint: Follow signal chain step-by-step [OK]
Common Mistakes:
  • Assuming initial 'U' remains
  • Thinking assignments happen sequentially
  • Confusing signal and variable updates
4. Identify the error in this VHDL concurrent signal assignment:
signal x : std_logic;
x = '1';
medium
A. Signal x must be declared as variable
B. Missing semicolon after signal declaration
C. Using '=' instead of '<=' for signal assignment
D. Signal cannot be assigned a constant

Solution

  1. Step 1: Check assignment operator

    In VHDL, signals use '<=' for assignment, not '='.
  2. Step 2: Verify other syntax

    Semicolon is present after declaration. Signal can be assigned constants. No need to declare as variable.
  3. Final Answer:

    Using '=' instead of '<=' for signal assignment -> Option C
  4. Quick Check:

    Signal assignment uses <= [OK]
Hint: Signals use <=, variables use := [OK]
Common Mistakes:
  • Using = instead of <=
  • Confusing signals with variables
  • Thinking signals can't hold constants
5. You want to create a 2-bit signal out_sig that is always the bitwise AND of two 2-bit input signals in1 and in2. Which concurrent signal assignment correctly implements this?
hard
A. out_sig <= in1 & in2;
B. out_sig <= in1 or in2;
C. out_sig := in1 and in2;
D. out_sig <= in1 and in2;

Solution

  1. Step 1: Identify correct operator for bitwise AND

    In VHDL, 'and' is the bitwise AND operator for std_logic_vector signals.
  2. Step 2: Check syntax and operators

    out_sig <= in1 and in2; uses 'and' with '<=' which is correct. out_sig <= in1 & in2; uses '&' which is concatenation, not AND. out_sig := in1 and in2; uses ':=' which is for variables, not signals. out_sig <= in1 or in2; uses 'or' which is incorrect logic.
  3. Final Answer:

    out_sig <= in1 and in2; -> Option D
  4. Quick Check:

    Bitwise AND uses 'and' with <= [OK]
Hint: Use 'and' for bitwise AND, not '&' [OK]
Common Mistakes:
  • Using '&' instead of 'and' for bitwise AND
  • Using := instead of <=
  • Using wrong logic operator
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