Challenge - 5 Problems
Concurrent Signal Assignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2: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;
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'.
✗ Incorrect
In VHDL, concurrent signal assignments create separate drivers for the signal. std_logic is resolved, so the value is determined by the resolution function. '0' and '1' from different drivers conflict, resulting in 'X'.
❓ Predict Output
intermediate2: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;
Attempts:
2 left
💡 Hint
Check the condition in the conditional assignment carefully.
✗ Incorrect
The conditional assignment sets
out_signal to '1' only if enable is '1'. Otherwise, it sets it to '0'. Since enable is '0', out_signal is '0'.🔧 Debug
advanced2: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;
Attempts:
2 left
💡 Hint
std_logic is a resolved type, so multiple drivers from concurrent assignments are allowed.
✗ Incorrect
In VHDL, signals of resolved types like std_logic can have multiple drivers from concurrent assignments. No error occurs; the value is the result of applying the resolution function to all driver values.
📝 Syntax
advanced2: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?
Attempts:
2 left
💡 Hint
Remember the syntax uses commas to separate choices, not else or semicolons.
✗ Incorrect
The correct syntax for selected signal assignment uses commas to separate choices and the keyword
when for each choice, ending with a semicolon.🚀 Application
expert2:00remaining
Number of drivers in concurrent signal assignment
Consider the following VHDL code snippet:
How many drivers does
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;Attempts:
2 left
💡 Hint
Each concurrent assignment to the same signal creates a driver.
✗ Incorrect
Each concurrent assignment statement creates a separate driver for the signal. Here,
out_signal has two concurrent assignments, so it has two drivers.