VHDL Questions and Answers – Assert Statement

This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Assert Statement”.

1. Assert statement is a _____________ statement.
a) Concurrent and synthesizable
b) Sequential and synthesizable
c) Concurrent and Non-synthesizable
d) Sequential and Non-synthesizable
View Answer

Answer: d
Explanation: Assert statement is a sequential statement which can appear inside a process, function or procedure. Also, this statement is a non-synthesizable statement which is used to report some textual string to the designer.

2. What is the use of assert statement in VHDL?
a) To print any string
b) To check the consistency and generate a message
c) Cause execution of sequential statements to wait
d) To check if a condition can stop the execution
View Answer

Answer: b
Explanation: ASSERT statement is used to check the consistency of the program. It checks a condition and generates a message which is printed on the screen depending on the status of the condition whether it is true or false.

3. What is the correct syntax for using ASSERT statement?
a) ASSERT condition [REPORT string] [SEVERITY name];
b) Condition [REPORT string] [SEVERITY name] ASSERT;
c) Condition [SEVERITY name] [REPORT string] ASSERT;
d) ASSERT condition [SEVERITY name] [REPORT string];
View Answer

Answer: a
Explanation: The ASSERT statement is declared by using a Boolean condition before which a keyword ASSERT is used. After the condition, a keyword called REPORT is used and the string is specified which the user wants to display. The string to be displayed is followed by the severity of the error and its name.
advertisement
advertisement

4. The assert statement displays a message when the condition is FALSE.
a) True
b) False
View Answer

Answer: a
Explanation: The assert statement does nothing if the condition specified is true. If it is false, only then the message which is specified by the user is displayed on the screen. It is basically used for the status check of the program whether it is running correctly or not.

5. What is the use of REPORT statement?
a) To check the consistency
b) To make the statement wait
c) To print any string or output the string
d) To report the failure
View Answer

Answer: c
Explanation: The REPORT statement is used to output any message to the screen. It is generally used in conjunction with the ASSERT statement where ASSERT checks the consistency and REPORT outputs the message specified by a user.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. How many types of severity levels are there for the ASSERT statement?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: d
Explanation: There are four severity levels in the assert statement. There can be four names of SEVERITY which are NOTE, WARNING, ERROR and FAILURE. Depending on these severity levels, the simulator is instructed to halt.

7. Which of the following is the default severity name for ASSERT?
a) NOTE
b) WARNING
c) ERROR
d) FAILURE
View Answer

Answer: c
Explanation: The default severity level is ERROR. This means if we haven’t specified any severity level then it will be considered as ERROR severity.
advertisement

8. By using which of the following severity level, the simulator can be halted?
a) NOTE
b) WARNING
c) ERROR
d) FAILURE
View Answer

Answer: d
Explanation: In general, the simulator will generate a list of assert failures or the number of assert statements in which the condition was found to be false and shows at the end of the simulation. But, in the case of FAILURE severity, the simulator can stop working or it can come to a halt.

9. What kind of circuit may be described by using the following statement?

advertisement
ASSERT NOT (s=1and r =1) REPORT ‘’INVALID! S and R both can’t be 1SEVERITY ERROR

a) Flip flop
b) Multiplexer
c) Decoder
d) Counter
View Answer

Answer: a
Explanation: This can be a code for SR flip flop. Because the inputs S and R can’t be high at the same time in case of SR flip flop. It is invalid. ASSERT statement is used to show the same. When the condition is false then the message will be printed.

10. An ASSERT statement can’t be used as a concurrent statement.
a) True
b) False
View Answer

Answer: b
Explanation: An ASSERT statement can be used outside a process. But, in that case it will behave as a postponed or passive process. In case of concurrent assertion, the simulator will monitor the condition continuously.

11. NOTE severity level can be used to __________
a) Stop the execution
b) Show the unusual situation
c) Pass a message from simulation
d) To give a warning to simulator
View Answer

Answer: c
Explanation: The NOTE level has the lowest severity level which can be sued at the time of any small condition violation. This can be used to pass a message from the simulator.

12. Where should one use WARNING severity level?
a) To stop the execution
b) To alert the user about unexpected conditions
c) To pass the message from simulation
d) To give a warning about wrong conditions
View Answer

Answer: b
Explanation: WARNING has the second lowest severity level and can be used in any unusual but not fatal situation. In the situations, where the simulation can be continued but the results cannot be predicted. For example, if any file is not opened as expected, in that case one may use a WARNING.

13. The use of ERROR severity is _________
a) To alert about unpredictable results
b) To pass information to the simulator
c) To Stop the execution
d) Where the simulation is not feasible
View Answer

Answer: d
Explanation: In many cases, the simulation is not feasible or works completely incorrectly, there we can use the ERROR level severity. For example, when both inputs of SR flip flop are high, then the ERROR severity will be a good fit.

14. Where should we use FAILURE severity?
a) To identify a fatal error
b) To alert the user about simulation where the results are not correct
c) To ignore the error
d) To show the failure of simulation
View Answer

Answer: a
Explanation: FAILURE is the top most severity and must be used where the assertion violation is a fatal error and it must be stopped at once. So, most catastrophic conditions must be shown by failure. For example, if the code of operation is illegal and can affect the whole design, then its better to halt the simulation.

Sanfoundry Global Education & Learning Series – VHDL.

To practice all areas of VHDL, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.