Functions and Subprograms – 1 MCQ’s

Electronics & Communication Engineering VHDL

This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Functions and Subprograms – 1″.

1. A function is a ________ code.
a) Concurrent
b) Sequential
c) Concurrent as well as sequential
d) Process oriented

2. Which of the following sequential statement can’t be used in a function?
a) WAIT
b) IF
c) CASE
d) LOOP

3. Functions and subprograms are both same.
a) True
b) False

4. What is the correct syntax for declaration of a function?
a)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     declaration_part;
     BEGIN
     sequential_statements;
     END FUNCTION;

b)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     BEGIN
     declaration_part;
     sequential_statements;
     RETURN expression;
     END FUNCTION;

c)

    FUNCTION function_name (parameter_list) RETURN return_type IS
     BEGIN
     declaration_part;
     sequential_statements;
     RETURN expression;
     END function_name;

d)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     declaration_part;
     BEGIN
     sequential_statements;
     RETURN expression;
     END function_name;

5. The parameters used at the time of function call are called _________
a) Formal parameters
b) Actual parameters
c) Real parameters
d) Complex parameters

6. The function is called from the ________
a) Function itself
b) Library
c) Main code
d) Package

7. Functions are always invoked as a(n) _________
a) Constant
b) Variable
c) Signal
d) Expression

8. Which of the following can’t be the parameter of function?

SIGNAL a, b : IN STD_LOGIC
VARIABLE c : INTEGER
CONSTANT d : INTEGER

a) a
b) b
c) c
d) d

9. How many return arguments can be there in the function?
a) 1
b) 2
c) 3
d) 4

10. A function call can be a concurrent as well as a sequential statement.
a) True
b) False

Leave a Reply

Your email address will not be published. Required fields are marked *