# Attributes

This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Value Kind Attributes”.

1. What does a value kind attribute return?
a) A single value
b) A signal
c) A function
d) A type

2. Value attributes are classified into _______ subclasses.
a) 1
b) 2
c) 3
d) 4

3. Which of the following is not a category of Value kind attribute?
a) Value type attributes
b) Value array attributes
c) Value block attributes
d) Value function attributes

4. If T is an object, then T’LEFT attribute returns ________
a) Upper bound of object
b) Leftmost value of object
c) Leftmost value of an array
d) Lower bound of the object

5. What does the attribute T’HIGH returns?
a) Upper bound of the object
b) Lower bound of the object
c) Highest value of the object
d) Rightmost value of the object

6. What will be the value of x and y?

```TYPE my_type IS ARRAY (15 DOWNTO 0) OF BIT;
…
VARIABLE x, y : INTEGER;
x := my_type’LEFT;
y := my_type’HIGH;
…```

a) 0, 0
b) 0, 15
c) 15, 0
d)15, 15

7. What will be the value of x and y in the code given below?

```TYPE bit_range IS ARRAY (0 TO 15) OF BIT;
VARIABLE x, y : INTEGER;
x := bit_range’RIGHT;
y := bit_range’LOW;
…```

a) 0, 0
b) 0, 15
c) 15, 0
d) 15, 15

8. What will be the type of value returned by the attribute T’LENGTH?
a) BIT
b) INTEGER
c) STD_LOGIC
d) BOOLEAN

9. What will be the value of my_array’LENGTH, if my_array is defined as below code?

`TYPE my_array IS ARRAY (15 DOWNTO 0) OF STD_LOGIC;`

a) 15
b) 16
c) 0
d) 32

10. The formula for T’LENGTH is best described by which of the following?
a) T’HIGH – T’LOW + 1
b) T’HIGH – T’LOW
c) T’HIGH + T’LOW – 1
d) T’HIGH + T’LOW

11. Which of the following is the return type of value T’ASCENDING?
a) Bit
b) Integer
c) Boolean
d) Same as T

12. For which of the following declarations, the value returned by ‘ASCENDING attribute will be true?

```TYPE array_1 IS ARRAY (0 TO 31) OF BIT;
TYPE array_2 IS ARRAY (15 DOWNTO 0) OF BOOLEAN;```

a) For array_1 only
b) For array_2 only
c) For both array_1 and array_2
d) Neither for array_1 nor for array_2

13. Which of the following attribute is available for all types?
a) ‘LEFT
b) ‘ASCENDING
c) ‘BASE
d) ‘HIGH

14. What kind of information is provided by the value block attributes?
a) About the block name
b) About the modeling of block
c) About the architecture name
d) About the inputs used in block

15. Which of the following returns TRUE if there is no component instantiation statement in the block?
a) ‘STRUCTURE
b) ‘BLOCK_COMPONENT
c) ‘BLOCK_BEHAVIOUR
d) ‘BEHAVIOR