This set of VHDL Problems on “All Keywords in VHDL – 3”.
1. The use of NEXT in VHDL is similar to _________ in C.
a) Break
b) Continue
c) Exit
d) Do
Answer: b
Clarification: NEXT statement is used to skip the current iteration of the loop and start with the next iteration. The same is being done by the continue statement is traditional programming languages like C, C++, etc.
2. NULL keyword is most of the time useful with _______ part of _______ statement.
a) IF, IF
b) ELSIF, IF
c) OTHERS, CASE
d) NEXT, LOOP
Answer: c
Clarification: NULL keyword is useful in situations where we have to explicitly specify that no action is needed. It is generally useful in the CASE statement with OTHERS. When all the cases are specified and we don’t want to perform anything when any other case occurs, then it can be used.
3. When a port of a component is not connected to any signal, then which of the following keyword is used to indicate the situation?
a) OPEN
b) CLOSED
c) ON
d) OFF
Answer: a
Clarification: When any of the port is not connected to any signal in the component instantiation statement, then OPEN keyword is used in the association list of the statement to indicate the open port.
4. Which of the line(s) in following code is not legal?
L1 : PROCESS(a,b) L2 : SIGNAL x; L3 : BEGIN L4 : c<= a AFTER 10 ns; L5: END PROCESS
a) L2 only
b) L4 only
c) No error
d) Both L2 and L4
Answer: d
Clarification: A SIGNAL keyword is used to declare a signal which can’t be declared inside a process. So, L2 isn’t legal. Similarly, there is no role of delay for a sequential assignment statement. So, AFTER keyword is valid for concurrent assignment statement only.
5. A POSTPONED keyword used with a process will make it wait till _________
a) A specific process is suspended
b) A signal from the sensitivity list changes
c) All the processes are suspended
d) All the signals in sensitivity list changes
Answer: c
Clarification: A POSTPONED process is the one which is executed after the end of all processes. When all of the normal processes are suspended then the execution of postponed process starts.
6. Which of the following keyword is used to identify a clocked process?
a) CLOCKED
b) CLKED
c) SEQ
d) No specific keyword
Answer: d
Clarification: A clocked process also looks like a simple process. The only difference being a clock signal is used inside a clocked process. Whenever the clock event is identified or clock is simply used in the process then it is called a clocked process.
7. RANGE keyword is always used in _______
a) Type declaration
b) Array declaration
c) Loop declaration
d) Process declaration
Answer: a
Clarification: A Type declaration always includes three parts. The name of the Type, the base type and the range for the type. This range is always declared by using keyword RANGE followed by some values.
8. If we don’t use any keyword in the function definition, then which of the following is the type of function?
a) IMPURE
b) PURE
c) CASE
d) CONCURRENT
