|
Designing Hardware with Software
by James Antonakos
Start ý Levels
of Design ý The Interface ý The
Body ý Full_Adder
ý Half _Adder ý Identifiers,
Data Types, and Operators ý Examples ý
The Five-Input AND Gate ý The
2:4 Decoder ý Timing Examples ý Other
Methods ý Sources and PDF
THE FIVE-INPUT
AND GATE
By definition,
the logical operators in VHDL are limited to two inputs (with the
exception of the inverter). What do you do if we need a five input
AND gate? First, letýs specify the interface (see Listing 9).
|
entity AND5 is
port
(A,B,C,D,E : in bit;
F : out bit);
end AND5;
|
| Listing
9ýThis snippet of code shows the VHDL interface for the five-input
AND gate. |
Here you can see
the five inputs (A through E). How should they be reduced to a single
output? The first technique can be seen in Listing 10.
| Listing
10ýThis code
is used to implement a five-input AND gate using four two-input
AND gates. |
Take a moment
to sketch the schematic of the AND5 circuit. Does it look like it
will work? When you are finished, do the same for this architecture
body (see Listing 11).
| Listing
11ýAnother
way to design the five-input AND gate can be seen here. |
Can you think
of any advantages or disadvantages of one specification over the other?
Is there any reason why you should stay away from the following third
solution (see Listing 12)?
|
architecture LGATES of AND5 is
begin
F <= A and B and C and D
and E;
end LGATES;
|
| Listing
12ýHere is one more method of specifying the five-input AND gate. |
PREVIOUS NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |