

MCQOPTIONS
Saved Bookmarks
This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Vhdl knowledge and support exam preparation. Choose a topic below to get started.
1. |
What is the correct syntax to define a function which overloads any operator, say + operator for bit_vector type? |
A. | FUNCTION + (L : bit_vector, R : bit_vector) RETURN bit_vector IS |
B. | FUNCTION ‘+’ (L : bit_vector, R : bit_vector) RETURN bit_vector IS |
C. | FUNCTION “+” (L : bit_vector, R : bit_vector) RETURN bit_vector IS |
D. | FUNCTION (+) (L : bit_vector, R : bit_vector) RETURN bit_vector IS |
Answer» D. FUNCTION (+) (L : bit_vector, R : bit_vector) RETURN bit_vector IS | |
2. |
It is possible to define a new operator ++ in VHDL. |
A. | True |
B. | False |
Answer» C. | |
3. |
In the two functions defined below, which would generate an error? |
A. | Only function 1 |
B. | Only function 2 |
C. | Both functions 1 and 2 |
D. | No errorView Answer |
Answer» E. | |
4. |
A user wants to perform a different operation on an array type and the function can be overloaded but the parameter is of same base type. How to do the same by using a single function? |
A. | By using conditional statement with ‘LENGTH attribute |
B. | By using loop statement with ‘LENGTH attribute |
C. | By using unconstrained array in parameters |
D. | It can’t be done by using single function |
Answer» B. By using loop statement with ‘LENGTH attribute | |
5. |
Which of the following function definition will return an error? |
A. | Only first call |
B. | Only second call |
C. | Both first and second call |
D. | No errorView Answer |
Answer» C. Both first and second call | |
6. |
Which of the following is true about the overloading of ‘+’ and ‘-‘ operators? |
A. | They can be defined as binary operators only |
B. | They can be defined as unary operators only |
C. | They can be defined as ternary operators only |
D. | They can be defined as either binary or unary operators |
Answer» E. | |
7. |
ONLY_FIRST_CALL?$ |
A. | Only second call |
B. | Both first and second call |
C. | No error |
Answer» B. Both first and second call | |
8. |
A_user_wants_to_perform_different_operation_on_an_array_type_and_the_function_can_be_overloaded_but_the_parameter_is_of_same_base_type._How_to_do_the_same_by_using_a_single_function?$ |
A. | By using conditional statement with ‘LENGTH attribute |
B. | By using loop statement with ‘LENGTH attribute |
C. | By using unconstrained array in parameters |
D. | It can’t be done by using single function |
Answer» E. | |
9. |
Only function 1 |
A. | Only function 2 |
B. | Both functions 1 and 2 |
C. | No error |
Answer» D. | |
10. |
Apart from subprogram and operator overloading, which of the following can be overloaded in VHDL? |
A. | Attributes |
B. | Types |
C. | IF statement |
D. | CASE statement |
Answer» C. IF statement | |
11. |
Which of the following is true about overloading of ‘+’ and ‘-‘ operators?$ |
A. | They can be defined as binary operators only |
B. | They can be defined as unary operators only |
C. | They can be defined as ternary operators only |
D. | They can be defined as either binary or unary operators |
Answer» E. | |
12. |
By overloading + operator, it is possible to _________ |
A. | Use binary addition |
B. | Use arithmetic addition |
C. | Use it as subtract operator |
D. | Use it as ternary operator |
Answer» B. Use arithmetic addition | |
13. |
What is the necessary condition to overload parameters type of a subprogram? |
A. | The base type of two parameters must be same |
B. | The parameters must have a different name |
C. | The parameters can’t be of integer type |
D. | The base type of two parameters must differ |
Answer» E. | |
14. |
Using overloaded subprograms and operators increase readability of code. |
A. | True |
B. | False |
Answer» B. False | |
15. |
Overloading a subprogram allows subprogram to ________ |
A. | Operate on objects of different types |
B. | Operate on objects of same name |
C. | Operate on objects of different name |
D. | Operate on objects of same types |
Answer» B. Operate on objects of same name | |
16. |
What is the meaning of overloading? |
A. | To use single function many times |
B. | To use same object for different subprograms |
C. | To use same name for different objects |
D. | To use single function many time with single call |
Answer» D. To use single function many time with single call | |