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
Answer: b
Clarification: There are two kinds of functions which are PURE and IMPURE. A function by default is considered as a pure function. If we want to declare an impure function then we need to write IMPURE, but this is not in the case of Pure function.
9. The REPORT keyword is usually associated with _______
a) RECORD
b) NULL
c) ASSERT
d) IF
Answer: c
Clarification: REPORT keyword is used with ASSERT statement. Assert statement checks the consistency of simulation and execution and report in conjunction with assert is used to report the kind of error through a message.
10. On which side of a signal assignment statement, UNAFFECTED keyword can be used?
a) Left hand side
b) Right hand side
c) On any of the side
d) Can’t be used in an assignment statement
Answer: b
Clarification: UNAFFECTED is a keyword used when we need not to assign a new value to the signal. This is the case used in a selected or conditional signal assignment statements. So, it can be used as a part of waveform only i.e. on the right hand side only.
VHDL Problems, .