0
0
VHDLprogramming~10 mins

First VHDL design (AND gate) - 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 the AND gate entity name.

VHDL
entity [1] is
  Port ( A : in STD_LOGIC;
         B : in STD_LOGIC;
         Y : out STD_LOGIC);
end [1];
Drag options to blanks, or click blank then click option'
Axor_gate
Bor_gate
Cnot_gate
Dand_gate
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different gate name like or_gate or not_gate.
Mismatching entity name and end statement.
2fill in blank
medium

Complete the architecture header to define the AND gate behavior.

VHDL
architecture Behavioral of and_gate is
begin
  [1] : process(A, B)
  begin
    Y <= A and B;
  end process [1];
end Behavioral;
Drag options to blanks, or click blank then click option'
ANOT_Process
BOR_Process
CAND_Process
DXOR_Process
Attempts:
3 left
💡 Hint
Common Mistakes
Using process names that do not match the logic function.
Leaving the process name blank.
3fill in blank
hard

Fix the error in the signal assignment inside the process.

VHDL
architecture Behavioral of and_gate is
begin
  AND_Process : process(A, B)
  begin
    Y <= [1];
  end process AND_Process;
end Behavioral;
Drag options to blanks, or click blank then click option'
AA and B
BA or B
CA nand B
DA xor B
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'or' or 'xor' instead of 'and'.
Using 'nand' which is the inverse of 'and'.
4fill in blank
hard

Fill both blanks to complete the port declaration for inputs and output.

VHDL
entity and_gate is
  Port ( A : [1] STD_LOGIC;
         B : [1] STD_LOGIC;
         Y : [2] STD_LOGIC);
end and_gate;
Drag options to blanks, or click blank then click option'
Ain
Bout
Cbuffer
Dinout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'out' for inputs or 'in' for outputs.
Using 'buffer' or 'inout' incorrectly.
5fill in blank
hard

Fill all three blanks to complete the architecture with concurrent signal assignment.

VHDL
architecture Behavioral of and_gate is
begin
  [1] <= [2] [3] B;
end Behavioral;
Drag options to blanks, or click blank then click option'
AY
BA
Cand
Dor
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'or' instead of 'and'.
Swapping output and input signals.