Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to concatenate two std_logic_vectors.
VHDL
result <= vector1 [1] vector2; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' instead of '&' for concatenation.
Using '|' which is not valid for concatenation in VHDL.
✗ Incorrect
In VHDL, the concatenation operator is '&'. It joins two vectors end to end.
2fill in blank
mediumComplete the code to concatenate a single bit 'a' with a 3-bit vector 'b'.
VHDL
output_vector <= a [1] b; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using arithmetic operators like '+' or '-' instead of '&'.
✗ Incorrect
The '&' operator concatenates a single bit with a vector in VHDL.
3fill in blank
hardFix the error in the concatenation of two std_logic_vectors 'x' and 'y'.
VHDL
combined <= x [1] y; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '||' which is not a VHDL operator.
Using '+' which is for arithmetic, not concatenation.
✗ Incorrect
The correct concatenation operator in VHDL is '&'. '+' or '||' are invalid here.
4fill in blank
hardFill both blanks to concatenate 'a' and 'b' and then concatenate the result with 'c'.
VHDL
final_vector <= (a [1] b) [2] c;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' or '*' instead of '&' for concatenation.
✗ Incorrect
Use '&' to concatenate vectors step by step in VHDL.
5fill in blank
hardFill all three blanks to create a 6-bit vector by concatenating 'a', 'b', and 'c' in order.
VHDL
six_bit_vector <= a [1] b [2] c [3] "00";
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using arithmetic or bitwise operators instead of '&'.
✗ Incorrect
Use '&' to concatenate all parts into one vector in VHDL.