0
0
VHDLprogramming~10 mins

Entity-Architecture model 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 declare an entity named 'my_entity'.

VHDL
entity my_entity is
  port(
    clk : in std_logic;
    rst : in std_logic
  );
end [1];
Drag options to blanks, or click blank then click option'
Aarchitecture
Bentity
Ccomponent
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'architecture' instead of 'entity' to declare the entity.
Forgetting to end the entity declaration properly.
2fill in blank
medium

Complete the code to start an architecture named 'behavior' for entity 'my_entity'.

VHDL
architecture [1] of my_entity is
begin
  -- architecture body
end behavior;
Drag options to blanks, or click blank then click option'
Abehavior
Brtl
Cstructural
Ddataflow
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching architecture name in the begin and end statements.
Using an architecture name that does not match the design style.
3fill in blank
hard

Fix the error in the port declaration to correctly define an input signal 'data_in' of type std_logic_vector(7 downto 0).

VHDL
entity data_entity is
  port(
    data_in : [1] std_logic_vector(7 downto 0)
  );
end data_entity;
Drag options to blanks, or click blank then click option'
Ain
Binout
Cout
Dbuffer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'out' or 'buffer' for input signals.
Omitting the mode keyword before the type.
4fill in blank
hard

Fill both blanks to complete the architecture body that assigns 'output_signal' the value of 'input_signal'.

VHDL
architecture rtl of simple_entity is
begin
  process(clk)
  begin
    if rising_edge(clk) then
      [1] <= [2];
    end if;
  end process;
end rtl;
Drag options to blanks, or click blank then click option'
Aoutput_signal
Binput_signal
Cclk
Drst
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the signals on the assignment operator.
Using clock or reset signals instead of data signals.
5fill in blank
hard

Fill all three blanks to complete the entity and architecture that defines a 1-bit AND gate.

VHDL
entity and_gate is
  port(
    a : [1] std_logic;
    b : [2] std_logic;
    y : [3] std_logic
  );
end and_gate;

architecture behavior of and_gate is
begin
  y <= a and b;
end behavior;
Drag options to blanks, or click blank then click option'
Ain
Bout
Cbuffer
Dinout
Attempts:
3 left
💡 Hint
Common Mistakes
Declaring inputs as 'out' or 'buffer'.
Declaring output as 'in'.