MCQOPTIONS
Saved Bookmarks
This section includes 4 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. |
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 | |
| 4. |
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. | |