How to declare a constant in VHDL?

How to declare a constant in VHDL?
A. CONSTANT name : type := value;
B. CONSTANT name := value;
C. CONSTANT name := type := value;
D. CONSTANT name := type : value;
 
Answer: a
Explanation: The correct syntax to declare a CONSTANT data object in VHDL is shown in option a. The keyword CONSTANT is followed by the name of the constant which in turn is followed by a colon :)) sign. After the colon sign, the type of constant is specified and the value is assigned by using := assignment operator.
 

Tìm kiếm

Back
Top