Which of the following is the correct syntax for declaring a SUBTYPE?

Bờm

Member
Which of the following is the correct syntax for declaring a SUBTYPE?
A. TYPE type_name IS type_range AND SUBTYPE subtype_name IS subtype_range
B. SUBTYPE subtype_name IS subtype_range TYPE type_name
C. SUBTYPE subtype_name TYPE type_name IS subtype_range
D. SUBTYPE subtype_name IS TYPE subtype_range
 
Answer: d
Explanation: The correct way to define a SUBTYPE is the syntax shown in option d. For example, if we want to define a SUBTYPE of STD_LOGIC with 3 values only like X, 0 and 1. We can define it as SUBTYPE my _ subtype IS STD_LOGIC RANGE ‘X’ TO ‘1’.
 

Tìm kiếm

Back
Top