Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use 3-input logic gates in vhdl?

Tags:

vhdl

I am just learning vhdl, and am trying to use a 3-input nand gate. The code I have is:

G => (A nand B nand C) after 3 ns;

but this does not compile.

like image 954
ndc5057 Avatar asked Nov 02 '11 16:11

ndc5057


People also ask

Can a logic gate take 3 inputs?

A three-input gate has eight possibilities (000, 001, 010, 011, 100, 101, 110, and 111) for input states. The number of possible input states is equal to two to the power of the number of inputs: This increase in the number of possible input states obviously allows for more complex gate behavior.

Can NOR gate take 3 inputs?

As with the OR function, the NOR function can also have any number of individual inputs and commercial available IC's are available in standard 2, 3, or 4 input types. If additional inputs are required, then the standard NOR gates can be cascaded together to provide more inputs for example.

Can NAND take 3 inputs?

As with the AND function seen previously, the NAND function can also have any number of individual inputs and commercial available NAND Gate IC's are available in standard 2, 3, or 4 input types.

How do you make multiple input gates?

Making Multi Input Gates Multi input gates can be made by joining gates of the same type with less inputs. The diagrams below shows how a three input AND gate and and a four input AND gate can be made out of two input AND gates.


1 Answers

I'm not an expert on VHDL but I think you have a couple of mistakes there - it should probably be:

G <= not (A and B and C) after 3 ns;

i.e. the assignment is in the wrong direction and I'm not sure that nand commutes in the way that you need it to for 3 inputs, hence the use of and for the inputs and then not to invert the output.

like image 171
Paul R Avatar answered Nov 02 '22 23:11

Paul R