Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
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);
The code you posted is not an n-input AND gate buddy, actually it is just a 2-input AND.
You define a generic parameter N but you don't use it, so what's the point?
What I am asking is below...
By the way, I have the two books as hardcopy that you've mentioned, thank you for your advice
i1--------|
i2--------|
i3--------|
.---------| AND ----> F
.---------|
.---------|
in--------|
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.