This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Architecture”.
1. What does the architecture of an entity define?
a) External interface
b) Internal functionality
c) Ports of the entity
Explanation: Basically, entity describes the interface to the VHDL model and its architecture describes the internal view of that entity. It describes the functionality and contains the statements which describe the behavior of entity.
2. Which of the following is the correct syntax for architecture declaration and definition?
ARCHITECTURE architecture_type OF entity_name IS Declarations_for_architecture; BEGIN Code; …. END architecture_name;
ARCHITECTURE architecture_name OF entity_name IS BEGIN Declarations_for_architecture; Code; …. END architecture_name;
ARCHITECTURE architecture_type OF entity_name IS BEGIN Declarations_for_architecture; Code; …. END architecture_type;
ARCHITECTURE architecture_name OF entity_name IS Declarations_for_architecture BEGIN Code; …. END architecture_name;
Explanation: Architecture has two parts which are declarative part and the code part containing concurrent and sequential statements. Declaration part is optional but the code part is essential. The declaration of architecture is started with the keyword ARCHITECTURE followed by its name and then the name of entity. Then, the declaration part is used to declare and then BEGIN keyword is used to start the code part.
3. What does the declarative part of architecture contain?
a) Declaration of another entity
b) Declaration of libraries and packages
c) Declaration of local signals, constants or subprograms
d) Declaration of Architecture type
Explanation: Declarative part is the optional part of architecture definition. In this section, the local signals, constants, variables or subprograms are declared which are needed in the architecture. The scope of variables declared in this region is limited to the architecture only.
4. The statements in between the keyword BEGIN and END are called _______
a) Concurrent statements
c) Declaration statement
d) Entity function
Explanation: The proper word for the statements between BEGIN and END is Concurrent statements since they are executed concurrently. The code in between BEGIN and END describes the functionality or structure of the entity. BEGIN keyword specifies the starting of code.
5. Which of the following is the correct architecture for a simple Nand gate?
ARCHITECTURE my_arch OF nand_gate IS BEGIN x <= a NAND b; END my_arch;
BEGIN ARCHITECTURE my_arch OF nand_gate IS x <= a NAND b; END behavioral;
BEGIN ARCHITECTURE behavioral OF nand_gate IS x <= a NAND b; END my_arch;
ARCHITECTURE nand OF nand_gate IS BEGIN x <= a NAND b; END nand;
Explanation: For correct syntax, the word ARCHITECTURE must be followed by the name of architecture which may not contain the reserved words. After which BEGIN keyword is used to show the beginning of code section of the architecture and at last END keyword is used followed by name of architecture. Therefore, only option a is correct architecture of NAND gate explaining its functionality.
6. Which of the following can be a name of an architecture?
a) arch 1
Explanation: The name of architecture is its identifier and hence, it will follow the same rule as that of identifiers. It may contain alphanumeric characters and underscore character starting with alphabet always. Also, name can’t be same as any of the reserved word of VHDL.
7. An entity can’t be described by more than one architecture.
Explanation: It is false that an entity can’t have two or more architectures. An entity can be described by using more than one architecture. For an instance, one can define its behavior and another can explain its structure. However, the converse of the statement is not true, one architecture can describe only one entity.
8. Which of the following can’t be declared in the declaration part of the architecture?
Explanation: In the declaration part of architecture, the local data objects and subprograms are defined which can be used in the architecture only. However, a library contains packages which are generally used in every VHDL model and they are declared globally at the starting of VHDL code.
9. It is not possible to declare an entity after declaring its architecture.
Explanation: An entity is required first to describe its architecture. First of all, entity create an external interface of the system after which we can describe the internal view of entity. Until there is no entity, architecture declaration is not possible.
10. Which of the following statements execute faster?
a) Sequential statements
b) Concurrent statements
c) Declaration statements
d) Loop statements
Explanation: Concurrent statements execute faster than sequential statements. Sequential statements are those which are executed one after another whereas concurrent statements execute concurrently or simultaneously. Therefore, concurrent are faster.
Sanfoundry Global Education & Learning Series – VHDL.
To practice all areas of VHDL, here is complete set of 1000+ Multiple Choice Questions and Answers.