250+ TOP MCQs on Function Kind Attributes and Answers

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

1. Which of the following is returned by the function kind attributes?
a) Value
b) Function
c) Signal
d) Array
Answer: a
Clarification: Function attributes return values to the designer about the types, arrays or signals used. The name doesn’t tell that the attribute will return some function. It returns the information related to the function.

2. You are given with the position number of a value within a type, which attribute will you use to find its value?
a) ‘POS(value)
b) ‘VAL(value)
c) ‘POSITION(value)
d) ‘VALUE(value)
Answer: b
Clarification: The ‘value’ specified as an argument to the attribute specifies the position number and there are only two attributes which are predefined in the VHDL among the four options given. In which ‘VAL(value) attribute is used to return the value from position number specified.

3. A value from a type is passed as an argument to the attribute to find its position number. Which attribute it should be?
a) ‘SUCC(value)
b) ‘PRED(value)
c) ‘VAL(value)
d) ‘POS(value)
Answer: d
Clarification: ‘POS(value) is an attribute used to return the position value within a type if the value is known. For example, if a value 63is defined on the first number and we write ‘POS(63), the value returned will be 1.

4. What is the function of ‘SUCC(value) attribute?
a) To return the value next to the value passed in argument of the attribute
b) To return the value previous to the value passed in argument of the attribute
c) To return the position of value next to the value passed in argument
d) To return the position of value next to the value passed in argument
Answer: a
Clarification: The attribute ‘SUCC(value) is used to return the next value defined in the type. The value written in the argument of the attribute will be taken as the reference and the next value from that is returned.

5. Which of the following describes the function of ‘PRED(value)?
a) To return the position of value next to the value passed in argument
b) To return the value next to the value passed in argument of the attribute
c) To return the value previous to the value passed in the argument
d) To return the position of value next to the value passed in argument
Answer: c
Clarification: ‘PRED(value) attribute is used to return the previous value to the value passed in argument. Here, PRED is a representation for preceding value. There is no attribute for returning the position of previous to the value passed as an argument.

6. Which of the following is equivalent to the ‘SUCC(value) attribute?
a) ‘PRED(value)
b) ‘LEFTOF(value)
c) ‘RIGHTOF(value)
d) ‘LEFT(value)
Answer: c
Clarification: ‘SUCC(value) attribute returns the value next to the value in the argument. Similarly, ‘RIGHTOF(value) returns the value in the type right to the value passed as a parameter to the attribute. Therefore, both are similar.

7. Which of the following is similar to ‘PRED(value) attribute?
a) ‘LEFTOF(value)
b) ‘RIGHTOF(value)
c) ‘RIGHT(value)
d) ‘LEFT(value)
Answer: a
Clarification: The value previous to the argument value is returned by the ‘PRED attribute. The same is done by ‘LEFTOF, it returns the value left to the argument which means the same as that of ‘PRED. However, LEFT is a value kind attribute used to return the leftmost value.

8. What would be the value of x and y in the example given below?

TYPE color IS (red, yellow, green, blue, purple, orange)
VARIABLE x,y : color;
x := color’SUCC(green);
y := color’VAL(4)

a) blue, green
b) blue, blue
c) 4, blue
d) blue, 4
Answer: b
Clarification: Since ‘SUCC attribute returns the succeeding value of the argument. In the argument, value green is used so the succeeding value is blue. Therefore, x will be blue. Also, ‘VAL will return the value at 4th position which is blue.

9. What would be the value of x and y?

TYPE color IS (red, green, blue, yellow, purple, orange, black)
VARIABLE x : INTEGER;
VARIABLE y : color;
x <= color'POS(green);
y <= color'LEFTOF(green);

a) red, green
b) green, red
c) red, 2
d) 2, red
Answer: d
Clarification: Since x is an integer type and is assigned the value returned by ‘POS attribute. The value returned will be the position of green value which is 2. Another variable y can take any value within type color. The value in the left of green is red.

10. Identify the value of variable x from the lines given below.

SUBTYPE delay_time IS TIME RANGE 10 ns to 50 ns;
VARIABLE x := delay_time'BASE

a) ns
b) time
c) 10 ns
d) 50 ns
Answer: b
Clarification: ‘BASE is an attribute that is available for all predefined and enumerated data types. It gives the base type of object. Here, the subtype is defined with the base type TIME. So, x will contain TIME.

250+ TOP MCQs on Implementing Logic Functions with VHDL – 1 and Answers

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

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
Answer: a
Clarification: First of all we are given with a logic function that is first optimized before implementing it. The optimization is first done by using a suitable method and then it is implemented in the VHDL.

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
Answer: c
Clarification: Optimization is the technique to get the minimal form for a given logic function. By implementing this minimal function, the cost of implementation is reduced significantly.

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
Answer: d
Clarification: There are various methods available for optimization of logic functions like K-map, Boolean reduction, tabular method and cubical method. There is no such method called rectangular method to optimize the logic function.

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

a) 2018/01/vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4a”>vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4a
b) 2018/01/vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4b”>vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4b
c)2018/01/vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4c”>vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4c
d) 2018/01/vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4d”>vhdl-questions-answers-implementing-logic-functions-vhdl-1-q4d
Answer: d
Clarification: In the logic function there are three terms, AB’C representing 101 and A’BC representing 011. Third term is AB which will corresponds to two 1’s which are ABC and ABC’ corresponding to 111 and 110.

5. Which of the following is equivalent to the Boolean expression A + AB?
a) A
b) B
c) AB
d) A + B
Answer: a
Clarification: This expression can bide minimized by using simple Boolean laws. In the given expression, let us take A common. This becomes A (1 + B), According to sum laws of Boolean expressions, 1 + B must be equal to 1. So, it becomes A.1 which is equivalent to A.

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
Answer: b
Clarification: Generally, these kind of optimized Boolean function doesn’t need any sequential processing and therefore, no sequential assignment is required. All the functions can be implemented with concurrent code only.

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

a) A, B, C, D
b) AB, BC’D’, BCD’
c) AB, BD’
d) AB, CD
Answer: b
Clarification: Prime implicants of a function are the terms in the given function without any minimization. In this case the prime implicants are AB, BC’D’, BCD’.

8. How many logical operations are required to implement a Boolean function XY + X?
a) 0
b) 1
c) 2
d) 3
Answer: a
Clarification: The given function XY + X is first optimized to reduce the cost of implementation. So, the optimized function will be equal to X. As XY + X = X (Y + 1) = X. To implement this no logical operation is needed. It just needs an assignment statement and no operation.

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’
Answer: d
Clarification: The given function is a AND (b XNOR c). So, It is Y = A.(B EXNOR C) = AB’C’ + ABC. So, option ABC + AB’C’ is the correct function which is implemented by the code.

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;

View Answer

Answer: b
Clarification: As per the process the function will be implemented after optimization. To optimize the function, AB’C + ABC + BC = AC(B + B’) + BC = AC + BC. So, the correct statement should be A AND C OR B AND C.