Complete the code to declare a 4-bit input signal named 'A'.
signal A : std_logic_vector([1] downto 0);
The signal 'A' is declared as a 4-bit vector, so the highest index is 3 (0 to 3).
Complete the code to perform addition of two 4-bit vectors A and B and assign the result to SUM.
SUM <= std_logic_vector(unsigned(A) [1] unsigned(B));The '+' operator is used to add two unsigned vectors in VHDL.
Fix the error in the subtraction operation between A and B.
DIFF <= std_logic_vector(unsigned(A) [1] unsigned(B));The '-' operator correctly subtracts unsigned vectors in VHDL.
Fill both blanks to create a process sensitive to inputs A and B.
process([1], [2]) begin -- process body end process;
The process should be sensitive to inputs A and B to react when they change.
Fill all three blanks to assign the subtraction result to DIFF with proper type conversion.
DIFF <= std_logic_vector([1](A) [2] [3](B));
Both A and B are converted to unsigned before subtraction with '-'. The result is then converted back to std_logic_vector.