0
0
VHDLprogramming~10 mins

Selected assignment (with-select) in VHDL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A'1'
B'Z'
C'0'
D'X'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' instead of '0' for the when clause.
Forgetting the quotes around the value.
2fill in blank
medium

Complete 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'
A"00"
B"11"
C"01"
D"10"
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.
3fill in blank
hard

Fix 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'
A;
B,
C.
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using a comma instead of a semicolon at the end.
Omitting the punctuation entirely.
4fill in blank
hard

Fill 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'
A"00"
B"01"
C"10"
D"11"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up output values for '0' and '1'.
Using single quotes instead of double quotes for output.
5fill in blank
hard

Fill 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'
A"101"
B"110"
C"111"
D"100"
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the order of output values.
Using single quotes instead of double quotes for vectors.