250+ TOP MCQs on Signal Assignment – 2 and Answers

This set of VHDL test on “Signal Assignment – 2”.

1. The selected concurrent statement is equivalent to ________ sequential statement.
a) If else
b) Loop
c) Wait
d) Case
Answer: d
Clarification: Selected concurrent assignment statement is used when the target signal has to choose one value out of n(say) values. This is similar to the case statement used in the process. It uses the keyword ‘SELECT’ to select one value.

2. Those statement which are placed under ________ are concurrent.
a) Process
b) Function
c) Architecture
d) Procedure
Answer: c
Clarification: VHDL code, in general, is a concurrent code. Only statements placed under Process, Function or Procedure are executed sequentially. All other statements are concurrent statements.

3. In case of concurrent assignment, order of statements doesn’t matter.
a) True
b) False
Answer: a
Clarification: Since execution of a concurrent statement is parallel and an assignment statement has to be executed whenever the signal associated with it changes its value. Therefore, there is no restriction on the order of the statements.

4. Which of the following can’t be implemented with concurrent statements only?
a) Multiplexer
b) Decoder
c) Adder
d) Counter
Answer: d
Clarification: In general, we use concurrent code to build combinational circuits and the reason is that order of statements is not a problem. So, we can’t use purely concurrent code to obtain sequential logic circuits due to use of clock and processes. Hence, counter can’t be designed by using concurrent code only.

5. Variable assignment statement executes in ______ time.
a) Immediately(zero)
b) After delay specified
c) After one clock cycle
d) After two clock cycles
Answer: a
Clarification: When a variable is assigned a value, the assignment executes in zero simulation time. In other words, it changes the value of variable immediately. Also, the delay mechanism is used in the signal assignment but not in variable assignment. Variable assignment doesn’t use any delay mechanism.

6. In the signal assignment statement, which delay is used?

a) Transport delay
b) Inertial delay
c) Delta delay
d) Wire delay
Answer: b
Clarification: Inertial delay is the default delay in VHDL in which only last value is persisted ignoring all other delays. In the case of inertial delay, there is no need of specifying anything like we need to write TRANSPORT to specify the transport delay.

7. Inertial delay in Signal assignment is useful to ___________
a) Specify wire delay
b) Accumulate delay
c) Ignore input glitches
d) No use
Answer: c
Clarification: Inertial delay assignment takes only last assignment statement into consideration ignoring all the preceding assignments. So, any intermediate change will be ignored. Therefore, It is useful in ignoring input glitches.

8. Which of the following statement is a zero delay statement?
a) y <= x AFTER 10 ns
b) y <= TRANSPORT x AFTER 10 ns
c) y <= x
d) y := x AFTER 10 ns
Answer: d
Clarification: Signal assignment always have some amount of delay either inertial or transport. If there is no delay specified in signal assignment, even then the delta delay is used to assign value. Only variable assignment is executed immediately also the delay is ignored. Therefore, option d is zero delay statement.

9. Which of the following statement can’t be used to assign values in behavioral modeling of OR Gate?
a) Simple concurrent assignment
b) Sequential assignment
c) Conditional concurrent assignment
d) Selected concurrent assignment
Answer: d
Clarification: In the behavioral modeling, various output values are described w.r.t different combination of input values. A conditional concurrent assignment and selected concurrent assignment can add some condition for assigning values. Same can be done with sequential statements. By using simple concurrent statements, it is not possible to realize or gate.

10. Which of the following is not an assignment statement?
a) <=
b) :=
c) =>
d) :>
Answer: d
Clarification: There are three assignment statements in VHDL. <= is a signal assignment statement, := is used for variable assignment and => is used at the time of mapping the components and is used with ‘OTHERS’. These are 3 type of assignment operators.

11. OTHERS keyword is used with which kind of assignment?
a) Concurrent
b) Sequential
c) Selected
d) Conditional
Answer: c
Clarification: Selected concurrent assignment statement is used when you have to choose one value out of n values. In that case WHEN and OTHERS keywords are used. OTHERS is similar to the ELSE statement which will be selected when all the conditions are false.

12. The following code represents which of the logic gates?

WITH ab SELECT 
y <= 1 WHEN11;0	WHEN OTHERS;

a) And gate
b) Or gate
c) Not gate
d) Nand gate
Answer: a
Clarification: Here, the selected signal assignment is used in which the output is getting the value 1 when both the inputs are 1. Otherwise, the output is 0. This is clearly the case of 2 inputs AND gate.

VHDL for tests, .

250+ TOP MCQs on Functions and Subprograms – 1 and Answers

This set of VHDL Multiple Choice Questions & Answers (MCQs) on “Functions and Subprograms – 1”.

1. Functions and subprograms are both same.
a) True
b) False
Answer: b
Clarification: A subprogram consists of procedures and functions. Both of them are collectively called subprograms. So, subprogram is not same as a function but a function is a part of subprogram in case of VHDL.

2. A function is a ________ code.
a) Concurrent
b) Sequential
c) Concurrent as well as sequential
d) Process oriented
Answer: b
Clarification: A function is a section of sequential code. From the construction point of view, functions are very similar to the process. They employ all the sequential statements like IF, CASE etc.

3. Which of the following sequential statement can’t be used in a function?
a) WAIT
b) IF
c) CASE
d) LOOP
Answer: a
Clarification: A function can contain any kind of sequential statement may it be IF statement, CASE statement, LOOP statement, NEXT, EXIT or NULL. The only exception is the WAIT statement. One can’t use a WAIT statement inside a function.

4. What is the correct syntax for declaration of a function?
a)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     declaration_part;
     BEGIN
     sequential_statements;
     END FUNCTION;

b)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     BEGIN 
     declaration_part;
     sequential_statements;
     RETURN expression;
     END FUNCTION;

c)

    FUNCTION function_name (parameter_list) RETURN return_type IS
     BEGIN
     declaration_part;
     sequential_statements;
     RETURN expression;
     END function_name;

d)

     FUNCTION function_name (parameter_list) RETURN return_type IS
     declaration_part;
     BEGIN
     sequential_statements;
     RETURN expression;
     END function_name;

View Answer

Answer: d
Clarification: The function is defined in the way shown in option d. The keyword FUNCTION is followed by the name of function which in turn is followed by the list of parameters in a parenthesis. After the list of parameters the return type of a function is specified followed by the declaration part of the function in which local variables can be declared. The declaration part and statement part is separated by keyword BEGIN. Then there is the RETURN statement and the function definition is end by END and function name.

 
 

5. The function is called from the ________
a) Function itself
b) Library
c) Main code
d) Package
Answer: c
Clarification: The function which is once declared is always called from the main code. Whenever a function call occurs, the control is passed to the space where the function is defined. Then, the function is executed till a RETURN statement comes, which returns the control to main code.

6. The parameters used at the time of function call are called _________
a) Formal parameters
b) Actual parameters
c) Real parameters
d) Complex parameters
Answer: b
Clarification: The parameters which are specified at the time of function call are called the Actual parameters whereas the parameters used at the time of function definition are called formal parameters. The values from actual parameters are copied to the formal parameters in the same order as specified.

7. Functions are always invoked as a(n) _________
a) Constant
b) Variable
c) Signal
d) Expression
Answer: d
Clarification: Any function having a return type is always invoked as an expression. The expression is solved in the function definition and the result is specified by the return statement which can be taken as the result of the expression itself.

8. How many return arguments can be there in the function?
a) 1
b) 2
c) 3
d) 4
Answer: a
Clarification: It is very important thing to note that one function can return at most one value. The expression which is used in the return statement must result in the same type as that of return type specified in the definition. The value from the return expression is then returned to the main code.

9. Which of the following can’t be the parameter of function?

SIGNAL a, b : IN STD_LOGIC
VARIABLE c : INTEGER
CONSTANT d : INTEGER

a) a
b) b
c) c
d) d
Answer: c
Clarification: The parameter of a function can either be a signal or a constant. The variable can’t be used as a parameter of a function. Any of the data types which are synthesizable are allowed to use as a type of signals or constants.

10. A function call can be a concurrent as well as a sequential statement.
a) True
b) False
Answer: a
Clarification: The function can be called in the concurrent part of the code and it can be called in the sequential part of the code. It is not necessary that a function can be called inside a process only. However, it may be noted that the function itself contains only sequential statements.

250+ TOP MCQs on All Keywords in VHDL – 3 and Answers

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, .

250+ TOP MCQs on RTL Simulation and Answers

This set of VHDL Multiple Choice Questions & Answers (MCQs) on “RTL Simulation”.

1. What does RTL in digital circuit design stand for?
a) Register transfer language
b) Register transfer logic
c) Register transfer level
d) Resistor-transistor logic
Answer: c
Clarification: RTL in digital circuit design stands for register transfer level, used in HDL. Register transfer language is a type of intermediate representation close to assembly language. Resistor-transistor logic is used in BJTs as switching devices. Register transfer logic is used in state machine designs.

2. RTL is a design abstraction of what kind of circuit?
a) Asynchronous digital circuit
b) Synchronous digital circuit
c) Asynchronous sequential circuit
d) Analog circuit
Answer: b
Clarification: RTL is a design abstraction that shapes a synchronous digital circuit with reference to digital signals that flow between hardware registers and the logical operations are carried out on those signals.

3. RTL is used in HDL to create what level of representations in the circuit?
a) High-level
b) Low-level
c) Mid-level
d) Same level
Answer: a
Clarification: RTL is used in HDL for creating HIGH-LEVEL of representations in the circuit, from which lower-level of representations can be derived. Designing at the RTL level is a representative practice in modern digital design.

4. RTL mainly on describing the flow of signals between ________
a) Logic gates
b) Registers
c) Clock
d) Inverter
Answer: b
Clarification: RTL on describing the flow of signals between registers. There is a regularly repeated path of logic from the output of the register to its input, that is the reason it is called register transfer level.

5. Which flip-flop is usually used in the implementation of the registers?
a) D flip-flop
b) S-R flip-flop
c) T flip-flop
d) J-K flip-flop
Answer: a
Clarification: Registers are generally implemented as D flip-flops because connection for the shift register is the simplest with D flip-flop, as there is a single data input in it. The flip-flop also stores the output of whatever logic is applied to its data input as long as the clock input is high.

6. Which of the following tool performs logic optimization?
a) Simulation tool
b) Synthesis tool
c) Routing tool
d) RTL compiler
Answer: b
Clarification: Synthesis tool performs logic optimization in RTL by converting high-level description of the design circuit into an optimized gate level representation by the use of basic logic gates like and, or, nor, etc.

7. RTL is a combination of both combinational and sequential circuits.
a) True
b) False
Answer: a
Clarification: RTL is a combination of both combinational and sequential circuits. Combinational logic performs all the logical operations in the circuit and it typically consists of basic logic gates and registers make synchronized sequential logic.

8. Setup time is the time required for input data to settle after the triggering edge of the clock.
a) True
b) False
Answer: b
Clarification: The time required for an input data to settle BEFORE the triggering edge of the clock is called the setup time. It is measured with respect to active clock pulse edge only.

9. Hold time is the time needed for the data to ________ after the edge of the clock is triggered.
a) Decrease
b) Increase
c) Remain constant
d) Negate
Answer: c
Clarification: Hold time is the time needed for the data to remain constant after the edge of the clock is triggered. Data must remain stable, if the incorrect data is latched then, it leads to hold violation.

10. Simulator enters in which phase after the initialization phase?
a) Execution phase
b) Compilation phase
c) Elaboration phase
d) Simulation phase
Answer: a
Clarification: Simulator enters in execution phase after the initialization phase, the actual simulation of the behaviour of the design takes place in the execution phase. Each simulation process in the active queue is taken out and executed until it suspends.

11. Conversion of RTL description to Boolean _______ description is a function of the translation procedure in the synthesis process.
a) Optimized
b) Unoptimized
c) Translation
d) PLA format
Answer: b
Clarification: Conversion of RTL description to Boolean unoptimized description is a function of translation procedure in the synthesis process. The logic synthesis tool converts the description to an unoptimized, intermediate, internal representation.

250+ TOP MCQs on Architecture and Answers

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

1. What does the architecture of an entity define?
a) External interface
b) Internal functionality
c) Ports of the entity
d) Specifications
Answer: b
Clarification: Basically, entity describes the interface to the VHDL model and its architecture describes the internal view of that entity. It describes the functionality and contains the statements which describe the behavior of entity.

2. Which of the following is the correct syntax for architecture declaration and definition?
a)

ARCHITECTURE architecture_type OF entity_name IS
     Declarations_for_architecture;
     BEGIN
     Code;
     ….
    END architecture_name;

b)

ARCHITECTURE architecture_name OF entity_name IS
     BEGIN
     Declarations_for_architecture;
     Code;
     ….
    END architecture_name;

c)

ARCHITECTURE architecture_type OF entity_name IS
     BEGIN
     Declarations_for_architecture;
     Code;
     ….
    END architecture_type;

d)

ARCHITECTURE architecture_name OF entity_name IS
     Declarations_for_architecture
     BEGIN
     Code;
     ….
     END architecture_name;

View Answer

Answer: d
Clarification: Architecture has two parts which are declarative part and the code part containing concurrent and sequential statements. Declaration part is optional but the code part is essential. The declaration of architecture is started with the keyword ARCHITECTURE followed by its name and then the name of entity. Then, the declaration part is used to declare and then BEGIN keyword is used to start the code part.

 
 

3. What does the declarative part of architecture contain?
a) Declaration of another entity
b) Declaration of libraries and packages
c) Declaration of local signals, constants or subprograms
d) Declaration of Architecture type
Answer: c
Clarification: Declarative part is the optional part of architecture definition. In this section, the local signals, constants, variables or subprograms are declared which are needed in the architecture. The scope of variables declared in this region is limited to the architecture only.

4. The statements in between the keyword BEGIN and END are called _______
a) Concurrent statements
b) Netlist
c) Declaration statement
d) Entity function
Answer: a
Clarification: The proper word for the statements between BEGIN and END is Concurrent statements since they are executed concurrently. The code in between BEGIN and END describes the functionality or structure of the entity. BEGIN keyword specifies the starting of code.

5. Which of the following is the correct architecture for a simple Nand gate?
a)

ARCHITECTURE my_arch OF nand_gate IS
    BEGIN
    x <= a NAND b;
    END my_arch;

b)

BEGIN
     ARCHITECTURE my_arch OF nand_gate IS
    x <= a NAND b;
    END behavioral;

c)

BEGIN
    ARCHITECTURE behavioral OF nand_gate IS
    x <= a NAND b;
    END my_arch;

d)

ARCHITECTURE nand OF nand_gate IS
    BEGIN
    x <= a NAND b;
    END nand;

View Answer

Answer: a
Clarification: For correct syntax, the word ARCHITECTURE must be followed by the name of architecture which may not contain the reserved words. After which BEGIN keyword is used to show the beginning of code section of the architecture and at last END keyword is used followed by name of architecture. Therefore, only option a is correct architecture of NAND gate explaining its functionality.

 
 

6. Which of the following can be the name of an architecture?
a) arch 1
b) 1arch
c) arch_1
d) architecture
Answer: c
Clarification: The name of architecture is its identifier and hence, it will follow the same rule as that of identifiers. It may contain alphanumeric characters and underscore character starting with alphabet always. Also, name can’t be same as any of the reserved word of VHDL.

7. An entity can’t be described by more than one architecture.
a) True
b) False
Answer: b
Clarification: It is false that an entity can’t have two or more architectures. An entity can be described by using more than one architecture. For an instance, one can define its behavior and another can explain its structure. However, the converse of the statement is not true, one architecture can describe only one entity.

8. Which of the following can’t be declared in the declaration part of the architecture?
a) Signals
b) Subprograms
c) Components
d) Libraries
Answer: d
Clarification: In the declaration part of architecture, the local data objects and subprograms are defined which can be used in the architecture only. However, a library contains packages which are generally used in every VHDL model and they are declared globally at the starting of VHDL code.

9. It is not possible to declare an entity after declaring its architecture.
a) True
b) False
Answer: a
Clarification: An entity is required first to describe its architecture. First of all, entity create an external interface of the system after which we can describe the internal view of entity. Until there is no entity, architecture declaration is not possible.

10. Which of the following statements execute faster?
a) Sequential statements
b) Concurrent statements
c) Declaration statements
d) Loop statements
Answer: b
Clarification: Concurrent statements execute faster than sequential statements. Sequential statements are those which are executed one after another whereas concurrent statements execute concurrently or simultaneously. Therefore, concurrent are faster.

250+ TOP MCQs on Process Statement – 1 and Answers

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

1. Process is a _______ statement.
a) Concurrent
b) Sequential
c) Delay
d) Both concurrent and sequential
Answer: a
Clarification: Process statement itself is a concurrent statement. Since, the architecture of an entity can contain only concurrent statements, so, process is a concurrent statement. Basically, Process itself is a concurrent statement which includes sequential statement. The statements enclosed in a process statement are executed sequentially.

2. If there is more than one process in a VHDL code, How they are executed?
a) One after the other
b) Concurrently
c) According to sensitivity list
d) Sequentially
Answer: b
Clarification: All the processes in a design execute concurrently or in a parallel manner. However, at a given time, only one statement is executed within the process. More than one processes can execute in a parallel manner, but the same is not true for statements within a process.

3. A process has a declaration part.
a) True
b) False
Answer: a
Clarification: A process can have a declaration part followed by statement part. A process can have its local variables, constants, types or subtypes declared in it which will be visible to the process only. The local process variables can’t be used outside the process.

4. Local variables in a process can be declared __________
a) Anywhere within the process
b) After a sequential statement
c) Before the BEGIN keyword
d) After the BEGIN keyword
Answer: c
Clarification: BGIN keyword specifies the start of sequential statements. The process declaration part is an optional part and the variables must be defined before the BEGIN keyword. No declaration is allowed after the keyword BEGIN.

5. Which of the following is correct syntax for process declaration?
a)

     {Label :} PROCESS
     {process_declaration_part};
      sensitivity_list;
     BEGIN
     sequential_statements;
     END PROCESS {Label};

b)

     PROCESS {sensitivity_list}
     {process_declaration_part}
     BEGIN
     sequential_statements;
     END PROCESS {Label};

c)

     {Label :} PROCESS
     {process_declaration_part}
     BEGIN
     sensitivity_list;
     sequential_statements;
     END PROCESS;

d)

     {Label :} PROCESS {sensitivity_list}
     {process_declaration_part}
     BEGIN
     sequential_statements;
     END PROCESS {Label};

View Answer

Answer: d
Clarification: A process is declared by using an optional label followed by keyword process and the list of signals to which process is sensitive. After which, there is a declaration part for the process and a statements section. Both parts are separated by keyword BEGIN. THEN, the process is terminated by using keyword END followed by Process.

 
 

6. Sensitivity list of a process contains __________
a) Constants
b) Signals
c) Variables
d) Literals
Answer: b
Clarification: A process has its sensitivity list containing the names of signals to which the process is sensitive. It can contain any number of signals which will trigger the process of change of value of any of these signals. It may not contain constants or variables, only signals are valid.

7. Which of the following statement is used when there are no signals in the sensitive list?
a) WHEN
b) IF ELSE
c) WAIT
d) CASE
Answer: c
Clarification: A process can be sensitive to one or more signals. These signals are either specified in the sensitivity list of the process. If there is no sensitivity list, then the signals used in WAIT statements are the signals to which process is sensitive.

8. What is the effect of the sensitivity list on the process?
a) Process executes when any of the signal in sensitivity list changes
b) Process executes sequentially when sensitivity list is specified
c) If there is no sensitivity list, then the process will not execute
d) Helps in simulation
Answer: a
Clarification: The sensitivity list contains those signals which affect the execution of the process. Whenever one or more statements inside the sensitivity list changes, the execution starts. So, the process is executed again and again whenever any value change. It starts from BEGIN keyword and all statements are executed serially and then it waits for change in any value.

9. It is mandatory to use a label for any process.
a) True
b) False
Answer: b
Clarification: The use of label is optional. The purpose of using label is just to improve the readability of code. If it is used, then at the end of the process the same label should be written. For example, if label L1 is used to start the process then at the end, it must be- END PROCESS L1.

10. If no signal in the sensitivity list is changed, then how many times the process will be executed?
a) 3
b) 2
c) 1
d) 0
Answer: c
Clarification: The process is executed at least once, no matter if the signal changes or not. At the time when the simulation is initiated, the process is triggered. After this one time execution of process, it waits for change in state of signals in sensitivity list.

11. Which of the following statements can be seen as sequential equivalent to the selected concurrent assignment?
a) IF ELSE
b) WAIT
c) WHEN
d) CASE
Answer: d
Clarification: The selected assignment is a concurrent statement and therefore, can’t be used inside a process. CASE statement is a sequential statement which can be seen as an equivalent to the selected assignment which chooses one of the n different signals or variables.

12. A __________ can’t be declared inside a process.
a) Signal
b) Variable
c) Constants
d) Subprograms
Answer: a
Clarification: The process has a declaration part in which everything can be declared except a signal. The variables, constants, types, subprograms can be declared in the process and the scope for variables declared in the process is local to the process itself.