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
•   Synchronous Reset
•   Asynchronous Preset
•   Logic Functions - 1
•   Logic Functions - 2
•   Combinational Circuits - 1
•   Combinational Circuits - 2
•   ↓ VHDL Designing ↓
•   Shift Registers
•   Designing Counters
•   Moore Type FSM
•   Mealy Type FSM
•   Top Level System Design
•   RTL Simulation

Best Reference Books

VHDL Books
« Prev Page
Next Page »

VHDL Questions and Answers – LOOP Statement – 2

Posted on December 5, 2018 by Manish

This set of VHDL Multiple Choice Questions & Answers focuses on “LOOP Statement – 2”.

1. The correct syntax for using EXIT in a loop is ___________
a) EXIT loop_label WHEN condition;
b) EXIT WHEN condition loop_label;
c) loop_label WHEN condition EXIT
d) EXIT WHEN loop_label condition
View Answer

Answer: a
Explanation: EXIT is the keyword used for the execution of EXIT statement. This keyword is followed by the optional loop label which again is followed by keyword WHEN and the condition which should by true for ending the loop. If the loop label is absent, then the exit statement automatically applies tot the innermost enclosing loop.
advertisement

2. FOR loop uses a loop index, the type of loop index is _________
a) STD_LOGIC_VECTOR
b) BIT_VECTOR
c) INTEGER
d) REAL
View Answer

Answer: c
Explanation: The loop index is used as a counter which counts the number of iterations and this loop index is an INTEGER by default. This is because by using an integer, the counting can be done easily which is not possible with real numbers.

3. Where do we declare the loop index of a FOR LOOP?
a) Entity
b) Architecture
c) Library
d) It doesn’t have to be declared
View Answer

Answer: d
Explanation: The loop index doesn’t have to be declared because it is always an integer and can be directly used in a loop. So, it is locally declared for a loop. For example, FOR x in 1 TO 10 LOOP; Here ‘x’ is the loop index. Also, it can be reassigned a value within the loop.

4. A FOR loop is inside a WHILE loop. Inside the FOR loop, the EXIT statement is used in such a way that after 4 iterations, it will execute. After the execution of EXIT statement, the control will be passed ________
a) Outside the FOR loop
b) Outside the WHILE loop
c) At the next iteration of WHILE loop
d) At the next iteration of FOR loop
View Answer

Answer: a
Explanation: If the loop is nested inside another loop, then exit statement will end the innermost loop only. It will not end the execution of all the loops. It will start execution from the innermost statement containing END LOOP. So, the control will be passed to the statement next to the end of FOR loop.

5. A for loop is initiated as given below, in total how many iterations will be there for the FOR loop?

FOR i IN 0 TO 5 LOOP

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

Answer: d
Explanation: As told earlier, i is the loop index which is integer by default. So, the counting will start from 0 and then 1 and so on till 5. Therefore, the loop will execute 6 times. If one wants to execute it 5 times then either 0 to 4 or 1 to 5 should be used.
advertisement

6. All types of FOR loops are synthesizable.
a) True
b) False
View Answer

Answer: b
Explanation: The loop index in FOR loop must contain a static value only. It is not possible to synthesize the design if the loop range is not static or it is a variable. So, we can’t use a variable in the loop range line otherwise the loop will not be synthesizable.

7. What is the use of EXIT statement in a loop?
a) For skipping one execution
b) For repeating one statement in the loop
c) For ending the condition and creating infinite loop
d) For ending the loop
View Answer

Answer: d
Explanation: The exit statement completes the execution of an enclosing loop statement and passes the control to the statement after the exited loop. It will skip all the following iterations and starts execution after the statement containing END LOOP.

8. On what side of the assignment statement, one can use a loop index?
a) Left
b) Right
c) Left or Right
d) Loop index can’t be used in an assignment
View Answer

Answer: b
Explanation: The loop index can be used on the right side of the assignment only. It has read only access. It means that we can’t use index as an output signal. However, it is possible to use this variable as an index to some vector type.

9. A WHILE loop is more flexible than FOR loop.
a) True
b) False
View Answer

Answer: a
Explanation: Since we can’t use a signal or variable in the loop range statement, so the FOR loop always runs for a specified or constant number of times. Whereas a WHILE loop can be used to run a loop and we don’t need to know that how many times the loop must be executed.

10. The FOR loop is not synthesizable if it contains ______ statement.
a) WHEN
b) THEN
c) WAIT
d) IF
View Answer

Answer: c
Explanation: The FOR loop is not synthesizable for two conditions. One is That the loop variable must be static. Another condition for the loop to be synthesizable is that it must not contain any kind of WAIT statement.
advertisement

11. Which logic circuit is described in the following code?

LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
 
ENTITY system IS
GENERIC (l : INTEGER := 3);
PORT ( a, b : IN STD_LOGIC_VECTOR ( l DOWNTO 0);
              c     : IN STD_LOGIC;
              x     : OUT STD_LOGIC_VECTOR (l DOWNTO 0)
              y     : OUT STD_LOGIC);
END system;
ARCHITECTURE design OF system IS
BEGIN
PROCESS (a, b, c)
VARIABLE z : STD_LOGIC_VECTOR ( l DOWNTO 0);
BEGIN
z(0) := c;
FOR I IN 0 TO l LOOP
x(i) < = a(i) XOR b(i) XOR z(i);
z(i+1) <= (a(i) AND b(i)) OR (a(i) AND z(i)) OR (b(i) AND z(i));
END LOOP;
y <= z(l);
END PROCESS;
END design;

a) 4- bit full subtractor
b) 4- bit half subtractor
c) 4- bit half adder
d) 4-bit full adder
View Answer

Answer: d
Explanation: The design shown in the architecture is the design of 4 bit ripple carry full adder. A generic parameter ‘l’ is used to define the number of bits and for loop is used to describe the data flow of adder. The ‘x’ output is corresponding to the sum output of the adder with 4 bits. Similarly, y output corresponds to the output carry of the adder with one bit only.

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 – LOOP Statement – 1
» Next Page - VHDL Questions and Answers – Assert Statement

« VHDL Questions and Answers – LOOP Statement – 1
VHDL Questions and Answers – Assert Statement »
advertisement

Deep Dive @ Sanfoundry:

  1. Simple Java Programs
  2. C# Programming Examples on Data Structures
  3. C Programming Examples on Arrays
  4. C# Programming Examples on Exceptions
  5. Java Programming Examples on Data-Structures
  6. Ruby Programming Questions and Answers
  7. C Programming Examples on Data-Structures
  8. Java Programming Examples on Collections
  9. C Programming Examples on Stacks & Queues
  10. VHDL Questions and Answers
Manish Bhojasia
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & 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, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Facebook | Twitter

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.