Functions and Subprograms – 2 MCQ’s

Electronics & Communication Engineering VHDL

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

1. What should be the mode of signal a in the following function definition?

FUNCTION my_func (SIGNAL a : STD_LOGIC_VECTOR) RETURN INTEGER IS
…..;

a) IN
b) OUT
c) INOUT
d) BUFFER

2. Functions are called using ______ no of ________ statement(s).
a) 1, If
b) 1, Assignment
c) 2, If
d) 2, Assignment

3. Refer to the function defined below, a and b have respectively following data objects.

FUNCTION my_func (SIGNAL a : STD_LOGIC_VECTOR; b : STD_LOGIC) RETURN BOOLEAN IS
…..;

a) Constant, Constant
b) Constant, Signal
c) Signal, Constant
d) Signal, Signal

4. Which of the following type can’t be a parameter of a function?
a) Signals
b) Constants
c) Files
d) Variables

5. What is the use of resolution functions?
a) Return the value of a signal with multiple drivers
b) Resolve value of a constant with multiple drivers
c) Convert one data type into another
d) Convert one data object into another

6. A component may be declared and instantiated inside a function.
a) True
b) False

7. It is not possible to use multiple driver signals without a resolution function.
a) True
b) False

8. How many parameters are there in a resolution function?
a) 3
b) 2
c) 0
d) 1

9. A resolution function is invoked when ________
a) The signal is assigned multiple values
b) All the drivers has changed their value for once at least
c) Any of the driver changes its value
d) The signal is assigned a second value

10. What would be the length of array used as a parameter to the resolution function which resolves the value of a signal having 2 drivers?
a) 1
b) 2
c) 3
d) Infinite

Leave a Reply

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