0
0
VHDLprogramming~20 mins

Concurrent signal assignment in VHDL - Practice Problems & Coding Challenges

Choose your learning style9 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.