πŸ§ͺ VHDL MCQ Quiz Hub

VHDL Mcq – Data Objects and Types

Choose a topic to test your knowledge and improve your VHDL skills

SIGNED and UNSIGNED data types are defined in which package?





βœ… Correct Answer: 3

What is the correct method to declare a SIGNED type signal β€˜x’?





βœ… Correct Answer: 3

What will be the value of x in the following code? SIGNAL x : IN UNSIGNED (3 DOWNTO 0 ); x <= β€œ1101”;





βœ… Correct Answer: 4

What will be the value of x in the following code? SIGNAL x : IN UNSIGNED (3 DOWNTO 0 ); x <= β€œ1101”;





βœ… Correct Answer: 4

Which of the following option is completely legal, given that a and b are two UNSIGNED type signals?





βœ… Correct Answer: 1

If a and b are two STD_LOGIC_VECTOR input signals, then legal assignment for a and b is?





βœ… Correct Answer: 2

What do we call the data type used for representing distance, current, voltage, time, etc?





βœ… Correct Answer: 3

What is the meaning of the base unit?





βœ… Correct Answer: 1

Which of the following is only predefined physical literal in VHDL?





βœ… Correct Answer: 2

SIGNAL a : REAL; which of the following is illegal assignment for a?





βœ… Correct Answer: 4

RECORD in VHDL is similar to________ in C.





βœ… Correct Answer: 3

What is the difference between SIGNAL and VARIABLE?





βœ… Correct Answer: 4

Access types are similar to _________ in traditional programming languages.





βœ… Correct Answer: 1

How the keyword β€œTYPE” is used?





βœ… Correct Answer: 2

Which of the following is a wrong declaration for a new data type?





βœ… Correct Answer: 4

A SUBTYPE can be defined as _________





βœ… Correct Answer: 3

Which of the following is the correct syntax for declaring a SUBTYPE?





βœ… Correct Answer: 4

Which of the following can’t be the value of x? Refer to the VHDL code given below. TYPE color IS (red, green, blue, black, white, gray); SUBTYPE primary IS color RANGE red to blue; VARIABLE x: primary;





βœ… Correct Answer: 1

Look at the following declarations: TYPE array1 IS ARRAY ( 0 TO 3 ) OF BIT_VECTOR (3 DOWNTO 0 ); TYPE array 2 IS ARRAY ( 0 TO 3 ) OF array1; How many total bits can be stored in these arrays?





βœ… Correct Answer: 3

Refer to the four declarations below, which of the following is not a 2 dimensional array? TYPE array1 IS ARRAY ( 3 DOWNTO 0, 1 DOWNTO 0 ) OF STD_LOGIC; TYPE array2 IS ARRAY (3 DOWNTO 0 ) OF STD_LOGIC_VECTOR( 3 DOWNTO 0 ); TYPE array3 IS ARRAY (2 DOWNTO 0 ) OF array2; TYPE array4 IS ARRAY ( 0 TO 3, 3 DOWNTO 0 ) OF BIT;





βœ… Correct Answer: 2

Which of the following is a SUBTYPE of INTEGER?





βœ… Correct Answer: 1

Refer to the VHDL code given below, which of the following line has error? Line 1: SUBTYPE my_logic IS STD_LOGIC RANGE β€˜0’ TO β€˜1’; Line 2: SIGNAL a: BIT; Line 3: SIGNAL b: STD_LOGIC; Line 4: SIGNAL c: my_logic; Line 5: b<=a; Line 6: b<=c;





βœ… Correct Answer: 3

In the VHDL code given below, what will be the error at the time of compilation? TYPE my_int IS INTEGER RANGE -32 TO 32; TYPE other_int IS INTEGER RANGE 0 TO 100; SIGNAL x : my_int; SIGNAL y : other_int; y <= x + 2;





βœ… Correct Answer: 1

Which of the following package of IEEE contains most of the data conversion functions?





βœ… Correct Answer: 1

If we are using conv_integer(p) function, then which of the following cannot be the type of parameter β€˜p’?





βœ… Correct Answer: 1

In the function conv_unsigned(p, b), what does p and b refers to?





βœ… Correct Answer: 2

Which of the following is the correct syntax to convert INTEGER β€˜p’ into SIGNED number of β€˜b’ bits?





βœ… Correct Answer: 3

The function conv_std_logic_vector(p,b) is used for_______





βœ… Correct Answer: 2

What will be the value of y after the execution of the following VHDL code? Library ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; … SIGNAL m : UNSIGNED (3 DOWNTO 0); SIGNAL n : UNSIGNED (3 DOWNTO 0); SIGNAL y : STD_LOGIC_VECTOR (7 DOWNTO 0); y <=CONV_STD_LOGIC_VECTOR ((m+n), 8);





βœ… Correct Answer: 1

Which of the following is not an assignment operator?





βœ… Correct Answer: 4

A VARIABLE y is declared of STD_LOGIC_VECTOR type of 4 bits, if you want to assign 1001 to y, then what is the write assignment statement?





βœ… Correct Answer: 2

Which of the following logical operator has the highest precedence?





βœ… Correct Answer: 3

. In the following statements, y and z are equivalent to________ y <= NOT a AND b; z <= NOT (a AND b);





βœ… Correct Answer: 3

Which of the following VHDL statement is equivalent to NAND operation, if y, a and b are SIGNALS?





βœ… Correct Answer: 2

_____ operator is unary as well as binary operator. a)





βœ… Correct Answer: 1

The operator β€˜&’ is called the_____ operator.





βœ… Correct Answer: 4

What is the type of result of MOD operator?





βœ… Correct Answer: 2

The operators like =, /=, <, >, >= are called _________





βœ… Correct Answer: 4

What is the type of result for comparison operators?





βœ… Correct Answer: 1

ABS operator is used to _________





βœ… Correct Answer: 2

Which of the following is exponentiation operator?





βœ… Correct Answer: 4

SIGNAL x : STD_LOGIC; In this statement x is ______





βœ… Correct Answer: 2

What is the β€œSLL” operator?





βœ… Correct Answer: 3

What is the β€œSLL” operator?





βœ… Correct Answer: 3

The correct syntax for any logical shift operator like SLL and SRL is_____





βœ… Correct Answer: 1

In the following VHDL code, the values of y and z are _____ VARIABLE x : BIT_VECTOR(3 DOWNTO 0) := 1001; VARIABLE y : BIT_VECTOR(3 DOWNTO 0) := 0000; VARIABLE z : BIT_VECTOR(3 DOWNTO 0) := 0000; … y := x SRA 2; z := y SLA 2; …





βœ… Correct Answer: 3

SLL operation is equivalent to which of the following operations?





βœ… Correct Answer: 2

Which of the following is equivalent division by 2 operator?





βœ… Correct Answer: 1

. In the VHDL code given below, what will be the values of y and z? VARIABLE x : BIT_VECTOR(3 DOWNTO 0) := 1001; VARIABLE y : BIT_VECTOR(3 DOWNTO 0) := 0000; VARIABLE z : BIT_VECTOR(3 DOWNTO 0) := 0000; … y := x ROR 2; z := y ROL 2; …





βœ… Correct Answer: 4

In a statement containing two or more operators of same precedence, how the expression will be solved?





βœ… Correct Answer: 1

What will be the values of the following variables after MOD operations? x = 5 MOD 3; y = -5 MOD 3; z = 5 MOD -3;





βœ… Correct Answer: 2

What will be the values of following variables after REM operations? x = 5 REM 3; y = -5 REM 3; z = 5 REM -3;





βœ… Correct Answer: 3