Complete the code to declare a subprogram in VHDL.
procedure [1] is
begin
null;
end procedure;The name of the subprogram is declared after the keyword procedure. Here, my_subprogram is the correct name.
Complete the code to call a subprogram named 'compute' inside a process.
process
begin
[1];
wait;
end process;In VHDL, to call a procedure, you use its name followed by parentheses (). So compute() is correct.
Fix the error in the subprogram declaration by completing the missing keyword.
function add_numbers(a : integer; b : integer) [1] integer is begin return a + b; end function;
The correct keyword to specify the return type of a function in VHDL is return.
Fill both blanks to complete the subprogram call with parameters.
process begin [1](5, [2]); wait; end process;
The subprogram name is compute_sum and the second parameter passed is 20.
Fill all three blanks to create a function that returns the maximum of two integers.
function max_val(a : integer; b : integer) [1] integer is begin if a [2] b then return a; else return [3]; end if; end function;
The function uses return to specify the return type, compares a > b, and returns b if the condition is false.
