Which of the following is legal?

Which of the following is legal?
A.
Code:
     label : FOR n IN 7 DOWNTO 0 GENERATE
     concurrent_statement; 
      END GENERATE;
B.
Code:
     label : FOR n IN 7 DOWNTO 0 GENERATE
     declarations;     
      concurrent_statement; 
      END GENERATE;
C.
Code:
    label : FOR n IN 7 DOWNTO 0 GENERATE
     begin
     declarations; 
     concurrent_statement; 
      END GENERATE;
D.
Code:
    label : FOR n IN 7 DOWNTO 0 GENERATE
    begin 
    concurrent_statement; 
     END GENERATE label;
 
Answer: a
Explanation: If the generate statement has no local declaration which means it has only statement part then there is no need to use the BEGIN keyword. Also, label is compulsory for a generate statement but it is not mandatory to use a label at the end of the generate statement.
 

Tìm kiếm

Back
Top