0
0
VHDLprogramming~10 mins

Component instantiation in testbench 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 instantiate the component named 'my_component' in the testbench.

VHDL
uut: entity work.my_component port map([1]);
Drag options to blanks, or click blank then click option'
Aclk => clk rst => rst
Bclk, rst
Cclk => clk, rst => rst
Dclk => rst, rst => clk
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the => operator in port mapping.
Not separating port mappings with commas.
2fill in blank
medium

Complete the code to declare the component 'my_component' in the testbench architecture.

VHDL
component my_component is
  port(
    clk : in std_logic;
    rst : in std_logic
  );
end component;

signal clk : std_logic := '0';
signal rst : std_logic := '1';

begin
  [1]
end;
Drag options to blanks, or click blank then click option'
Auut: my_component port map(clk => clk, rst => rst);
Buut: entity work.my_component port map(clk, rst);
Cuut: my_component port map(clk, rst);
Duut: entity my_component port map(clk => clk, rst => rst);
Attempts:
3 left
💡 Hint
Common Mistakes
Using entity keyword incorrectly in component instantiation.
Using positional port mapping without parentheses.
3fill in blank
hard

Fix the error in the component instantiation by completing the port map correctly.

VHDL
uut: entity work.my_component port map(clk => [1], rst => rst);
Drag options to blanks, or click blank then click option'
Arst
B'1'
C'0'
Dclk
Attempts:
3 left
💡 Hint
Common Mistakes
Connecting clk port to a constant like '1' or '0'.
Swapping clk and rst signals.
4fill in blank
hard

Fill both blanks to complete the component instantiation with correct port mapping and label.

VHDL
[1]: entity work.my_component port map([2]);
Drag options to blanks, or click blank then click option'
Auut
Bclk => clk, rst => rst
Cclk, rst
Dmy_component
Attempts:
3 left
💡 Hint
Common Mistakes
Using positional port mapping without parentheses.
Omitting the instance label.
5fill in blank
hard

Fill all three blanks to instantiate 'my_component' with label, entity, and port map correctly.

VHDL
[1]: entity [2] port map([3]);
Drag options to blanks, or click blank then click option'
Ainst1
Bwork.my_component
Cclk => clk, rst => rst
Dmy_component
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect entity name without library prefix.
Using positional port mapping instead of named.