This set of VHDL Multiple Choice Questions & Answers (MCQs) on “Signal Kind Attributes”.
1. What is the basic use of signal kind attributes?
a) To check any event on signals
b) To check if a function is called
c) To check if a signal is IN or OUT mode
d) To check a clock signal
Answer: a
Clarification: Signal kind attributes can provide information about any signals. These attributes can be used to report whether a signal has changed its value, what was the last value and after what time the signal changed, etc.
2. Which of the following returns the Boolean type always?
a) ‘LAST_VALUE
b) ‘LAST_EVENT
c) ‘EVENT
d) ‘STABLE
Answer: c
Clarification: ‘EVENT is an attribute which returns a Boolean value always. It returns true if any transition has taken place on the given signal during the current delta. Otherwise, it returns false. It always takes a signal as its object and detects any change on the value.
3. Signal kind attributes can’t have variables as their objects.
a) True
b) False
Answer: a
Clarification: Signal kind attributes are called so because they provide information about any signal. Unlike value kind and function kind in which variables can be used objects with attributes, it is not possible to use any data object with signal kind attributes except signals.
4. Refer to the statement given below, it is used for detecting _________
IF (clk’EVENT and clk = ‘0’)
a) Rising edge of the clock signal
b) Falling edge of the clock signal
c) Clock signal frequency
d) Time period of clock signal
Answer: b
Clarification: As described earlier, ‘EVENT will detect any change on the clock signal. This attribute is here used in conjunction with a condition that clock signal should be zero. So, the statement is used to detect the trailing or falling edge of the clock signal.
5. s’ACTIVE will return true if _________
a) Any transition from 0 to 1 on signal s during the current delta
b) Any transition from 1 to 0 on signal s during the current delta
c) Any change has occurred on the signal s during last 2 delta’s
d) Any change has occurred on the signal s during the current delta
Answer: d
Clarification: s’ACTIVE is an attribute which always returns the Boolean value always. It returns true if the signal is active during the current delta. It means the value will be true if any change has occurred on the signal during the current delta. Otherwise, it returns false.
6. Attribute s‘LAST_EVENT has a return value of ______ type.
a) BOOLEAN
b) TIME
c) INTEGER
d) Same as signal s type
Answer: b
Clarification: s’LAST_EVENT is an attribute which returns the time elapsed since the previous event occurred on the signals. This attribute is very useful for implementing timing checks like pulse width check, hold check etc.
7. What is the type of value returned by the s’DELAYED(time) attribute?
a) TIME
b) BOOLEAN
c) INTEGER
d) Same as signal s
Answer: d
Clarification: s’DELAYED attribute is used to create a delayed version of same signal, delayed by an amount specified in the argument. It creates the signal delayed by ‘time’ value. So, the return type will be same as that of signals.
8. Which of the following statement is correct to check the violation of hold time?
a) IF(clk’DELAYED(hold_time)’EVENT) THEN
b) IF(clk’DELAYED(hold_time) = ‘1’) THEN
c) IF(clk’DELAYED(hold_time) = ‘0’) THEN
d) IF(clk’DELAYED(hold_time) = ‘1’ AND clk’DELAYED(hold_time)’EVENT) THEN
Answer: d
Clarification: The signal is created by ‘DELAYED attribute which is delayed by hold time and then it must be used in conjunction with the ‘EVENT attribute to check any event on the signal generated. By doing this, one may check the hold time.
9. The attribute s’TRANSACTION creates a signal of type ______
a) BOOLEAN
b) BIT
c) INTEGER
d) Same as signal s
Answer: b
Clarification: s’TRANSACTION creates a signal of time BIT that toggles its value for every transaction of the signal it is attachted to. Whenever there is some change in signal s, the value of BIT signal is toogled either from 1 to 0 or from 0 to 1.
10. What is the use of s’TRANSACTION attribute?
a) Check the continuity
b) Check the hold time
c) Interrupt handling by using WAIT
d) Create a square wave
Answer: c
Clarification: The ‘TRANSACTION attribute is generally used with the WAIT statement to handle the interrupts. Without ‘TRANSACTION attribute, the WAIT statement is sensitive to the events only, but with ‘TRANSACTION it can be activated on every transaction on the BIT signal output of attribute.
.