logo
  • Home
  • Test & Rank
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Mining
  • Marine
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Jobs
  • Contact

VHDL Multiple Choice Questions | MCQs | Quiz

VHDL Interview Questions and Answers
Practice VHDL questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   EDA Tools
•   HDLs Needs
•   VHDL Common Terms
•   Entity & Its Declaration
•   Architecture
•   Data Objects & Types
•   User defined Data Types
•   Data Conversion
•   Operators - 1
•   Operators - 2
•   Behavioural Modelling
•   Behavioural Modelling Types
•   Generics
•   Block Statement
•   Structural Modelling - 1
•   Structural Modelling - 2
•   Structural Modelling - 3
•   VHDL Modelling Types
•   Signal Assignment - 1
•   Signal Assignment - 2
•   Process Statement - 1
•   Process Statement - 2
•   IF Statement
•   Case Statement - 1
•   Case Statement - 2
•   LOOP Statement - 1
•   LOOP Statement - 2
•   Assert Statement
•   WAIT Statements - 1
•   WAIT Statements - 2
•   WAIT Statements - 3
•   Signal vs Variables - 1
•   Signal vs Variables - 2
•   Package
•   Some Predefined Packages
•   Functions & Subprograms-1
•   Functions & Subprograms-2
•   Functions & Subprograms-3
•   Procedures - 1
•   Procedures - 2
•   Attributes
•   Value Kind Attributes
•   Function Kind Attributes
•   Signal Kind Attributes
•   Range Kind Attributes
•   Configurations
•   Overloading
•   Aliases Expressions
•   Generate Statement
•   VHDL Keywords - 1
•   VHDL Keywords - 2
•   VHDL Keywords - 3
•   Functions Flattening
•   ↓ Implementing Gates ↓
•   Different Modelling - 1
•   Different Modelling - 2
•   ↓ VHDL Implementation ↓
•   Sequential Circuits
•   Logic Functions - 1
•   Logic Functions - 2
•   Combinational Circuits - 1
•   Combinational Circuits - 2

Best Reference Books

VHDL Books
« Prev Page
Next Page »

VHDL Questions and Answers – Case Statement – 1

Posted on December 5, 2018 by Manish

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

1. What is the problem with IF statement?
a) Overlapping of conditions
b) No default value
c) The condition can be Boolean only
d) Restriction on number of ELSE statement
View Answer

Answer: a
Explanation: The IF statement has a priority according to which conditions are being tested. Whenever it is found to be true, all the following ELSIF statements are skipped and the END IF is executed. Sometimes, it is possible that two conditions may overlap which can cause change in output and we may not get the output as expected.
advertisement

2. In which of the following statements, all the branches are equal in priority?
a) IF
b) CASE
c) WAIT
d) LOOP
View Answer

Answer: b
Explanation: Only IF and CASE statements have branches. Among which IF statement has a priority scheduled which is IF, then ELSIF sequentially and ELSE at the lowest priority. Unlike the IF statement, CASE statement has no priority. All the branches are equal in priority and all the cases are covered. Due to this, it is obvious that there must not be any overlaps.

3. In case any of the condition is not covered by ‘cases’ in the case statement, which of the following keyword can be used to cover all those conditions?
a) ELSE
b) ELSIF
c) REMAINING
d) OTHERS
View Answer

Answer: d
Explanation: All the possible values, which a CASE expression can take, must be covered. For covering all the remaining values, which are not specified, the keyword OTHERS is used.

4. CASE is a sequential statement, which is similar to _________ concurrent statement.
a) Concurrent assignment
b) PORT MAP
c) WHEN
d) THEN
View Answer

Answer: c
Explanation: CASE is similar to a selected signal assignment where the keyword WHEN is used along with the assignment statement. In case of sequential code, CASE can be used for the same purpose. Both CASE and WHEN uses the keyword OTHERS to handle the remaining permutations.

5. Which of the following is correct syntax for CASE statement?
a)

    CASE expression IS
     WHEN choice_1 <=
     Sequential_statements;
     WHEN choice_2 <=
     Sequential_statements;
     ….
    WHEN OTHERS <=
    Sequential_statements;
    END CASE;

b)

advertisement
    CASE expression IS
     WHEN choice_1 =>
     Sequential_statements;
     WHEN choice_2 =>
     Sequential_statements;
     ….
    WHEN OTHERS =>
    Sequential_statements;
    END CASE;

c)

    CASE expression IS
     IF choice_1 <=
     Sequential_statements;
     ELSIF choice_2 <=
     Sequential_statements;
     ….
    ELSIF OTHERS <=
    Sequential_statements;
    END CASE;

d)

    CASE expression IS
     IF choice_1 =>
     Sequential_statements;
     ELSIF choice_2 =>
     Sequential_statements;
     ….
    ELSIF OTHERS =>
    Sequential_statements;
    END CASE;
View Answer
Answer: b
Explanation: The CASE statement is started with the keyword CASE followed by any identifier or expression and the IS. The expression is solved to get the value and the result of expression is matched with the choices and when it is matched, the corresponding sequential statements are executed. If the value doesn’t match any of the choices, then the statements under OTHERS are executed. It may be noted that the choices are followed by the operator => but not <=.
 
 

6. The expression used in a keyword must be of a Boolean type.
a) True
b) False
View Answer

Answer: b
Explanation: Unlike IF, it is not necessary that the expression used must give a Boolean value. It can be of any type. There is no such restriction on the type of expression used. It can be Integer, Character, Bit, Std_logic. There is no specific type of expression.
advertisement

7. What will be the value of Z in the following code?

ENTITY case_1 IS
Port (a, b, c, y : IN INTEGER range 0 TO 31
           z              : OUT INTEGER range 0 TO 31)
ARCHITECTURE example OF case_1 IS
BEGIN
y &lt;= 2;
a &lt;= 4;
b &lt;= 5;
c &lt;=6;
PROCESS(a, b, c, y)
BEGIN
CASE y+1 IS
WHEN 1 =&gt;
z &lt;= a;
WHEN 2 =&gt;
z &lt;= b;
WHEN 3 =&gt;
z &lt;= c;
WHEN OTHERS =&gt;
Z &lt;= 0;
END CASE;
END PROCESS;
END example;

a) 2
b) 4
c) 5
d) 6
View Answer

Answer: d
Explanation: First of all the expression is solved to get an integer, which is 3. Now, integer 3 is matched with the choices and the corresponding assignment will be executed. Therefore, c will be assigned to z since the choice 3 is matched with the outcome of the expression. In this way the z will get the value of c which is 6.

8. What should be the type of choices in the CASE statement?
a) Boolean
b) Integer
c) Same as expression
d) No restriction on the type
View Answer

Answer: c
Explanation: It is necessary that the type of choices in the CASE statement is same as the type of expression in the same. For example, any expression is of type integer, and then all the choices must be of the type integer.

9. It is possible to use range in the choice part of the CASE statement.
a) True
b) False
View Answer

Answer: a
Explanation: This is possible to use a discrete range in the choices. It is not necessary that the choice can be a single integer or character only, it can be a range too. This can be done by using TO keyword. For example, WHEN 1 TO 3 is valid in which if the expression gives the value anywhere between 1 to 3, then this part of the CASE will be executed.

Sanfoundry Global Education & Learning Series – VHDL.

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

« Prev Page - VHDL Questions and Answers – IF Statement
» Next Page - VHDL Questions and Answers – Case Statement – 2

« VHDL Questions and Answers – IF Statement
VHDL Questions and Answers – Case Statement – 2 »
advertisement

Deep Dive @ Sanfoundry:

  1. C Programming Examples on Strings
  2. C Programming Examples on Bitwise Operations
  3. Java Programming Examples on Classes
  4. Java Programming Examples on Multithreading
  5. C# Programming Examples on Functions
  6. Ruby Programming Questions and Answers
  7. C Programming Examples on Stacks & Queues
  8. Simple Java Programs
  9. Java Programming Examples on Exception Handling
  10. VHDL Questions and Answers
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
Terms
Privacy Policy
Jobs
Bangalore Training
Online Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry. All Rights Reserved.