Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a state encoding attribute in VHDL.
VHDL
attribute [1] : string;Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names like 'encoding_type' or 'state_attr'.
Misspelling the attribute name.
✗ Incorrect
The attribute used to specify state encoding in VHDL is called 'state_encoding'.
2fill in blank
mediumComplete the code to apply the state encoding attribute to a signal named 'current_state'.
VHDL
attribute state_encoding of [1] : signal is "one_hot";
Attempts:
3 left
💡 Hint
Common Mistakes
Applying the attribute to the wrong signal name.
Using a variable instead of a signal.
✗ Incorrect
The attribute is applied to the signal 'current_state' to specify its encoding.
3fill in blank
hardFix the error in the attribute declaration for state encoding.
VHDL
attribute state_encoding [1] signal is "binary";
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'on' or 'for' instead of 'of'.
Omitting the keyword entirely.
✗ Incorrect
The correct syntax uses 'of' to specify the object the attribute applies to.
4fill in blank
hardFill both blanks to declare and apply a state encoding attribute with 'gray' encoding to 'state_reg'.
VHDL
attribute [1] : string; attribute state_encoding [2] state_reg : signal is "gray";
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong attribute names or keywords.
Mixing up 'on' and 'of'.
✗ Incorrect
The attribute name is 'state_encoding' and the keyword to apply it is 'of'.
5fill in blank
hardFill all three blanks to declare a state encoding attribute, apply it to 'fsm_state', and set encoding to 'one_hot'.
VHDL
attribute [1] : string; attribute state_encoding [2] [3] : signal is "one_hot";
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute or signal names.
Using wrong keywords like 'on' or 'for'.
✗ Incorrect
The attribute name is 'state_encoding', applied with 'of' to the signal 'fsm_state'.
