Implementing Logic Functions with VHDL

VHDL

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

a) 
b) 
c)
d) 

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?

ARCHITECTURE my_func OF my_logic IS
BEGIN
y <= 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)

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

b)

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

c)

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

d)

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

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?

ARCHITECTURE my_func OF my_logic IS
BEGIN
y <= x SRL 2;
END my_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?

ARCHITECTURE my_func OF my_logic IS
BEGIN
y <= x SRL 2;
END my_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)

 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 = ‘0’;
ELSE water_alarm = ‘1’;
END IF;
END PROCESS;
END alarm_control;

c)

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

d)

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

 

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

Leave a Reply

Your email address will not be published. Required fields are marked *