vhdl or with n inputs
hi
yes u can surely use generic statement in order to make a n- i/p gate.
Below i am putting the Code for a simple N- i/p AND gate.
But i wud suggest u to please go and read some relevent Books like J. Bhasker and Perry for the basiocs as the question u hav asked is a simple basic Question.
library ieee;
use ieee.std_logic_1164.all;
entity gen_and is
generic( N: integer:=2);
port ( a,b : in std_logic;
c : out std_logic);
end entity;
Architecture arch1 of gen_and is
begin
c<=a and b;
end arch1;
entity gen is
end entity;
Architecture arch of gen is
signal ip,op: std_logic;
component
gen_and is
generic( N: integer:=2);
port ( a,b : in std_logic;
c : out std_logic);
end component;
begin
A1: gen_and generic map( 4) port map (ip,op);
end ARCH;