Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to assign output based on input using with-select.
VHDL
with input select output <= '1' when '1', '0' when [1], 'Z' when others;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' instead of '0' for the when clause.
Forgetting the quotes around the value.
✗ Incorrect
The with-select statement assigns '0' to output when input is '0'.
2fill in blank
mediumComplete the code to select the correct output value for input '2'.
VHDL
with input select output <= "00" when '0', "01" when '1', [1] when '2', "11" when others;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using output "11" for input '2' which is reserved for others.
Forgetting to use double quotes for output values.
✗ Incorrect
When input is '2', output should be "10" as per the selected assignment.
3fill in blank
hardFix the error in the with-select statement to assign output correctly.
VHDL
with input select output <= '0' when '0', '1' when '1', 'Z' when others [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a comma instead of a semicolon at the end.
Omitting the punctuation entirely.
✗ Incorrect
The with-select statement must end with a semicolon after the last when clause.
4fill in blank
hardFill both blanks to complete the with-select statement for a 2-bit output.
VHDL
with sel select out <= [1] when '0', [2] when '1', "11" when others;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up output values for '0' and '1'.
Using single quotes instead of double quotes for output.
✗ Incorrect
Output is "00" when sel is '0' and "10" when sel is '1'.
5fill in blank
hardFill all three blanks to complete the with-select statement for a 3-bit output.
VHDL
with address select data_out <= [1] when "000", [2] when "001", [3] when others;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the order of output values.
Using single quotes instead of double quotes for vectors.
✗ Incorrect
data_out is "100" for "000", "101" for "001", and "111" for others.