How to declare a 2 input OR gate in the structural modeling?

Danh Trịnh

New member
How to declare a 2 input OR gate in the structural modeling?
A.
Code:
    COMPONENT or IS
     PORT ( a, b : IN BIT;
                  x, y : OUT BIT);
    END COMPONENT;
B.
Code:
     COMPONENT or IS
     PORT ( a, b : IN BIT;
                  y : OUT BIT);
    END COMPONENT;
C.
Code:
    COMPONENT or_gate IS
     PORT ( a, b : IN BIT;
                  x,  y : OUT BIT);
    END COMPONENT;
D.
Code:
    COMPONENT or_gate IS
     PORT ( a, b : IN BIT;
                  y : OUT BIT);
    END COMPONENT;
 
Answer: d
Explanation: For a 2 input OR gate, there must be 2 inputs and only one output. Therefore, some options are legal. But, the name of component can’t be same as any reserved word of VHDL. Therefore, a name of component can’t be ‘or’.
 

Tìm kiếm

Back
Top