This set of VHDL Multiple Choice Questions & Answers (MCQs) focuses on “Implementing Logic Functions with VHDL”.

1. Which of the following represents the correct order?**a) Given function, optimized function, implementation**

b) Optimized function, implementation, given function

c) Implementation, optimized function, given function

d) Given function, implementation, optimized function

2. Which of the following will reduce the cost of implementation?

a) Implementing with only one modeling style

b) Implementing with dataflow modeling**c) Optimization**

d) Generating Net list first

3. Which of the following is not a method of optimization of logic function?

a) Tabular method

b) By using Boolean laws

c) K-map**d) Rectangular method**

4. Which of the following k-map represents the following given function?

y = AB + AB’C + A’BC

5. Which of the following is equivalent to the Boolean expression A + AB?**a) A**

b) B

c) AB

d) A + B

6. Which of the following assignment statement is not generally used in the implementation of Boolean functions?

a) Concurrent assignment**b) Sequential assignment**

c) Conditional assignment

d) Selected assignment

7. Which of the following are prime implicants of the following Boolean function?

Y= AB + BC'D’ + BCD'

a) A, B, C, D**b) AB, BC’D’, BCD’**

c) AB, BD’

d) AB, CD

8. How many logical operations are required to implement a Boolean function XY + X?**a) 0**

b) 1

c) 2

d) 3

9. Look the code given below. Which of the following option is implemented by the VHDL code?

ARCHITECTUREmy_funcOFmy_logicISBEGINy <= a AND (b XNOR c);

END my_func;

a) B’C’ + BC

b) AB’ + A’B

c) AB’C’**d) ABC + AB’C’**

10. What is the VHDL code for the logical function AB’C + ABC + BC?

a)

ARCHITECTUREmy_logicOFmy_logicISBEGINy <= (a AND b AND c) AND (b AND c);ENDARCHITECTURE;

**b)**

ARCHITECTURE my_logic OF my_logic IS BEGIN y <= (a AND c) OR (b AND c); END ARCHITECTURE;

c)

ARCHITECTUREmy_logicOFmy_logicISBEGINy <= (a AND c) AND (b OR c);ENDARCHITECTURE;

d)

ARCHITECTUREmy_logicOFmy_logicISBEGINy <= (a AND b AND c) OR (b AND c);ENDARCHITECTURE;

11. What do you use to perform basic logic functions in VHDL while creating concurrent code?**a) Operators**

b) If statement

c) PROCESS

d) GENERATE

12. In the implementation of following function by using NAND keyword only, can be done in _____ operations.

X = A'B + AB'

a) 2

b) 3**c) 4**

d) 5

13. The maximum number of parameters in port map() function while implementing logic function using gates only, is equal to ____________

a) Number of inputs

b) Number of outputs**c) Number of inputs + number of outputs**

d) Infinite

14. Which of the following is not representing a nibble?

a) x<= “0101”**b) x<= STD_LOGIC_VECTOR (0 TO 4)**

c) x<= STD_LOGIC_VECTOR(3 DOWNTO 0)

d) x<= BIT_VECTOR (1 TO 4)

15. In designing logic functions in VHDL, we can use arithmetic operators.**a) True**

b) False

16. A “Multiplication by 2” logic is to be designed by using the VHDL code, which of the following operator can be used to implement the same?

a) SRL

b) SRA

c) SLA**d) SLL**

17. What kind of logic is represented by the given code?

ARCHITECTUREmy_funcOFmy_logicISBEGINy <= x SRL 2;ENDmy_func;

a) Divide by 2**b) Divide by 4**

c) Multiply by 2

d) Multiply by 4

18. What information is not provided by the given logic’s output?

ARCHITECTUREmy_funcOFmy_logicISBEGINy <= x SRL 2;ENDmy_func;

a) Result of the operation

b) Operands used**c) Remainder of the operation**

d) Everything about the operation will be determined

19. A user wants to implement a logic by using VHDL. In which he has inputs from two sensors which are smoke sensor and water level detector. If any input is high, he has to turn on the respective alarm. Which of the following is representing the correct code for the given logic?**a)**

ARCHITECTURE alarm_control OF my_home IS BEGIN PROCESS(smoke_sensor, water_sensor) BEGIN IF(smoke_sensor = ‘1’) THEN fire_alarm = ‘1’; ELSE fire_alarm = ‘0’; END IF; IF(water_sensor = ‘1’) THEN water_alarm = ‘1’; ELSE water_alarm = ‘0’; END IF; END PROCESS; END alarm_control;

b)

ARCHITECTUREalarm_controlOFmy_homeISBEGINPROCESS(smoke_sensor, water_sensor)BEGINIF(smoke_sensor = ‘1’)THENfire_alarm = ‘1’;ELSEfire_alarm = ‘0’;ENDIF;IF(water_sensor = ‘1’)THENwater_alarm = ‘0’;ELSEwater_alarm = ‘1’;ENDIF;ENDPROCESS;ENDalarm_control;

c)

ARCHITECTUREalarm_controlOFmy_homeISBEGINPROCESS(smoke_sensor, water_sensor)BEGINIF(smoke_sensor = ‘1’)THENfire_alarm = ‘0’;ELSEfire_alarm = ‘1’;ENDIF;IF(water_sensor = ‘1’)THENwater_alarm = ‘1’;ELSEwater_alarm = ‘0’;ENDIF;ENDPROCESS;ENDalarm_control;

d)

ARCHITECTUREalarm_controlOFmy_homeISBEGINPROCESS(smoke_sensor, water_sensor)BEGINIF(smoke_sensor = ‘0’)THENfire_alarm = ‘1’;ELSEfire_alarm = ‘0’;ENDIF;IF(water_sensor = ‘0’)THENwater_alarm = ‘1’;ELSEwater_alarm = ‘0’;ENDIF;ENDPROCESS;ENDalarm_control;

20. Optimized implementation of Boolean functions reduces the cost of implementation.**a) True**

b) False