This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Attributes”.
1. What is the use of an attribute?
a) To find all characteristics of an entity
b) To find all characteristics of architecture
c) To extract some additional information about some object
d) To extract information about clock signals
Explanation: An attribute is a feature of VHDL that allow you to extract additional information about any object. This object can be either a signal, variable or a type. It can also be associated with an entity but it returns a single value which means a single information.
2. Predefined attributes are defined as a part of _________ standard.
Explanation: The VHDL describes some fundamental kinds of attributes. These different attributes are defined as a part of 1076 standard. All other attributes which are defined outside this standard are called user defined attributes.
3. How many fundamental kinds of predefined attributes are there?
Explanation: There are five fundamental kinds of predefined attributes which are generally named after their return type. Value kind, Function kind, Signal kind, Type kind and Range kind are the five fundamental kinds of predefined attributes.
4. What is the basic syntax to write an attribute?
a) Object_name’ attribute_name (parameter)
b) Attribute_name’ Object_name (parameter)
c) Object_name : Attribute_name (parameter)
d) Attribute_name : Object_name (parameter)
Explanation: To use a predefined attribute, an object is used. First of all the object name is written followed by apostrophe sign and then the attribute name. There are parameters for some attributes which can be written within parentheses immediately after the attribute name.
5. Which can’t be a result of a predefined attribute?
a) A value
b) A function
c) An entity
d) A signal
Explanation: As specified before, an attribute can return a value, function, signal, type or range. It can’t return an entity. The result of an attribute can be a value in case of value kind attributes and similarly for other five fundamental types.
6. How to declare a user defined attribute?
a) ATTRIBUTE name’ return_type;
b) ATTRIBUTE name : return_type;
c) ATTRIBUTE’ name : return_type;
d) ATTRIBUTE’ name’ return_type;
Explanation: Apostrophe sign is used at the time when we need to use the attribute but not at the time of declaration. The declaration of user defined attribute includes the keyword ATTRIBUTE followed by the name of attribute. The type is also specified at the time of declaration which is placed after a colon sign.
7. Array attributes are those which ________
a) Returns array type
b) Can be used on arrays
c) Can’t be used on arrays
d) Returns scalar values
Explanation: Array attributes can be used on arrays. It can be used to find the range, length and other characteristics of an array. So, it can be used to find a particular index type.
8. Which of the following is used to extract information of non-array types?
a) Vector type
b) Scalar type
c) Non vector type
d) Array type
Explanation: Those attributes which are used to extract information of non-array types are called Scalar type or scalar kind attributes. It can be used only on pre-defined data types and not on enumeration data types.
9. Attributes on enumeration types are synthesizable.
Explanation: Attributes on enumeration types are not synthesizable and can’t be used in the design which we need to synthesize. Even there are some predefined attributes which are not completely synthesizable.
10. Attributes can be associated with the entities.
Explanation: It is true that the attributes can be associated with entities apart from functions, values or signals. The information about entities can also be extracted with the help of attributes.
Sanfoundry Global Education & Learning Series – VHDL.
To practice all areas of VHDL, here is complete set of 1000+ Multiple Choice Questions and Answers.