1. What are the major differences between VHDL functions and VHDL procedures?
2. Write a VHDL procedure that counts the number of ones in an input bit-vector that is N bits long (N ≤ 31). The output should be an unsigned vector that is 5 bits long.
3. X and Y are bit-vectors of length N that represent signed binary numbers, with negative numbers represented in 2's complement. Write a VHDL procedure that will compute D = X Y. This procedure should also return the borrow from the last bit position (B) and an overflow flag (V). Do not call any other functions or procedures in your code. The procedure call should be of the form SUBVEC(X, Y, D, B, V, N);.