# VHDL/VHDL Mcq Data Objects and Types Sample Test,Sample questions

1.x <= a.b

2. x <= a OR b

3.x <= a + b

4. x <= a && b

## Question: ``` If we are using conv_integer(p) function, then which of the following cannot be the type of parameter â€˜pâ€™? ```

1.STD_LOGIC VECTOR

2.STD_ULOGIC

3.INTEGER

4.SIGNED

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

1.Left to right

2.Right to left

3.Alphabetically

4.In a random manner

1.16

2.9

3.64

4.27

1.Variable

2.Identifier

3.Name

4.Literal

## Question: ``` What is the correct method to declare a SIGNED type signal â€˜xâ€™? ```

1.SIGNAL x : IN SIGNED

2.SIGNAL x : IN SIGNED

3.SIGNAL x : IN SIGNED (7 DOWNTO 0)

4.SIGNAL x : IN SIGNED_VECTOR (7 DOWNTO 0)

1.12

2.5

3. -5

4.14

1.12

2.5

3. -5

4.14

## Question: ``` Which of the following is a wrong declaration for a new data type? ```

1.TYPE my_logic IS RANGE 0 to 100;

2.TYPE my_logic IS (â€˜0â€™, â€˜1â€™, â€˜2â€™);

3.TYPE my_logic IS ARRAY (0 TO 3) OF BIT;

4.TYPE my_logic IS <0 TO 20 >

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

1. y <= aâ€™+bâ€™ and z <= (a.b)â€™

2. y <= (a+b)â€™ and z <= aâ€™+bâ€™

3.y <= aâ€™+b and z <= aâ€™+bâ€™

4.y <= a+bâ€™ and z <= a.b

## Question: ```. 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; â€¦```

1. y = 0100 and z = 0000

2. y = 0000 and z = 0000

3.y = 0111 and z = 1110

4.y = 0110 and z = 0110

## Question: ```A SUBTYPE can be defined as _________ ```

1.A TYPE under a TYPE (nested)

2.A type of INTEGER datatype

3.A TYPE with some constraint

4.A TYPE without any constraint

## Question: `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?`

1.y <= â€œ1001â€

2.y := â€œ1001â€

3.y <= â€˜1â€™, â€˜0â€™, â€˜0â€™, â€˜1â€™

4.y => â€œ1001â€

## Question: ```ABS operator is used to _________ ```

1.Shift the operand

2.Gives absolute value for the operand

3.Give the result as nearest integer

4.To synthesize the result

1.Pointers

2.Arrays

3.Structures

4.Files

## Question: ```How the keyword â€œTYPEâ€ is used? ```

1.TYPE datatype_name IS type_from_predefined_datatypes;

2.TYPE datatype_name IS datatype_range;

3.TYPE datatype_range IS datatype_name;

4.USE TYPE datatype_range IS datatype_name;

## Question: ```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; â€¦```

1.y = 0000 and z = 0000

2.y = 1001 and z = 0000

3.y = 1110 and z = 0111

4.y = 0111 and z = 1110

## Question: ```In the function conv_unsigned(p, b), what does p and b refers to? ```

1.p is the data object to be converted and b is the base of that data object

2.p is the data object to be converted amd b is the bits needed in converted variable

3.p is the parameter to be converted and b is the bits of same parameter

4.p is the type of data to be converted and b is the type of data into which p should be converted

## Question: ```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;```

1.Type mismatch

2.Syntax problem

3.No declaration

4.Canâ€™t compile

1.Array

2.File

3.Structure

4.Pointer

1.array4

2.array3

3.array2

4.array1

1.Line 1

2. Line 4

3. Line 5

4. Line 6

1.a <= 1.8

2.a <= 1.0 E10

3.a <= 1.0 E-10

4.a <=1.0 ns

## Question: ```SIGNED and UNSIGNED data types are defined in which package? ```

1.std_logic_1164 package

2.std_logic package

3.std_logic_arith package

4.standard package

## Question: ```SLL operation is equivalent to which of the following operations? ```

1.Multiplication by any natural number

2.Multiplication by 2

3.Division by 2

4.Exponential operation

## Question: ```The correct syntax for any logical shift operator like SLL and SRL is_____ ```

1.bit_vector_operand <OPERATOR> integer_operand

2.integer_operand <OPERATOR> bit_vector_operand

3.std_logic_operand <OPERATOR> integer_operand

4. integer_operand <OPERATOR> std_logic_operand

## Question: ```The function conv_std_logic_vector(p,b) is used for_______ ```

1.Converting â€˜pâ€™ form STD_LOGIC_VECTOR to STD_LOGIC type

2.Converting any data type â€˜pâ€™ into STD_LOGIC_VECTOR with â€˜bâ€™ bits

3.Converting STD_LOGIC_VECTOR into â€˜pâ€™ type with â€˜bâ€™ bits

4.Converting STD_LOGIC into STD_LOGIC_VECTOR

## Question: ```The operator â€˜&â€™ is called the_____ operator. ```

1.Logical AND operator

2.Bitwise AND operator

4.Concatenation operator

## Question: ```The operators like =, /=, <, >, >= are called _________ ```

1.Arithmetic operators

2.Concatenation operators

3.Logical operators

4.Relational operators

1.Integer

2.Real

3.Physical

4.Imaginary

## Question: ```What is the â€œSLLâ€ operator? ```

1.Shift Logic Left

2. Shift Logically

3.Shift Left Logical

4.Shift Left

## Question: ```What is the â€œSLLâ€ operator? ```

1.Shift Logic Left

2.Shift Logically

3.Shift Left Logical

4.Shift Left

## Question: ```What is the difference between SIGNAL and VARIABLE? ```

1.The value of SIGNAL never varies whereas VARIABLE can change its value

2.SIGNAL can be used for input or output whereas VARIABLE acts as intermediate signals

3.SIGNAL depends upon VARIABLE for various operations

4.SIGNAL is global and VARIABLE is local to the process in which it is declared

## Question: ```What is the meaning of the base unit? ```

1.Smallest possible unit of any physical literal

2.SI unit of any physical literal

3.CGS unit for any physical literal

4. Fundamental building block of any design

1.Boolean

2.Integer

3.Numeric

4.Array

1.Numeric

2.Integer

3.Array

4.Bit

## Question: ```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);```

1.8- bit STD_LOGIC_VECTOR m+n

2.8- bit UNSIGNED m+n

3.4- bit STD_LOGIC m+n

4.Error

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

1.x= 2, y = 1 and z = -2

2.x = 2, y = -2 and z = 1

3.x = 2, y = -2 and z = 2

4. x = 2, y = 1 and z = 1

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

1.x = 2, y = -2 and z = -2

2.x = 2, y = 1 and z = -2

3.x= 2, y = -2 and z = 2

4.x = 2, y = -2 and z = 1

1.White

2.Red

3.Green

4.Blue

1.NATURAL

2.REAL

3.CHARACTER

4.STD_LOGIC

1.SRL

2.SLL

3.SLA

4.SRA

1.^

2.*

3./=

4.**

1.<=

2.:=

3.=>

4.=

1.VOLTAGE

2.TIME

3.CURRENT

4.DISTANCE

## Question: ```Which of the following is the correct syntax for declaring a SUBTYPE? ```

1.TYPE type_name IS type_range AND SUBTYPE subtype_name IS subtype_range

2.SUBTYPE subtype_name IS subtype_range TYPE type_name

3.SUBTYPE subtype_name TYPE type_name IS subtype_range

4.SUBTYPE subtype_name IS TYPE subtype_range

## Question: ```Which of the following is the correct syntax to convert INTEGER â€˜pâ€™ into SIGNED number of â€˜bâ€™ bits? ```

1.conv_integer_signed(p,b);

2.conv_signed_integer(p,b);

3.conv_signed(p,b);

4.conv_signed_p(b);

1.NAND

2.NOR

3.NOT

4.EXOR

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

1.x <= a + b; y <= a â€“ b;

2.x <= a OR b; y <= a AND b;

3.x <= a + b; y <= a OR b;

4.x <= a OR b; y <= a + b;

## Question: ```Which of the following package of IEEE contains most of the data conversion functions? ```

1.std_logic_1164

2.std

3.std_logic_arith

4.std_logic

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

1. y <= NOT a AND b

2. y <= NOT a OR NOT b

3.y <<= NOT a AND NOT b

4.y <<= NOT (a OR b)

1.â€“

2.*

3./

4.**

## More MCQS

##### Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!