|
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
EXAMPLES
Letýs take a look
at several examples of applying VHDL to digital design. The first
example involves a 2-bit greater-than comparator (see Figure 7). The
interface for the comparator can be seen in Listing 6.
 |
| Figure
7ýIn this 2-bit greater-than comparator, the output is high
if A > B. |
|
entity GTCOMP is
port
(A,B : in bit_vector(1 downto
0);
AGTB : out bit);
end GTCOMP;
|
| Listing
6ýThe interface for the comparator is shown here. |
One way to implement
the 2-bit greater-than comparator is to define several internal signals,
write equations for the output of each AND gate, and a final equation
for the OR gate. The design entity body for this method is shown in
Listing 7.
| Listing
7ýThis is one way to specify the comparator
design. |
Compare this implementation
style with another design entity body that does the same thing (see
Listing 8). It makes you wonder if thereýs any advantage to the first
architecture body, doesnýt it?
| Listing
8ýThis is a
second way of specifying the comparator design. |
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. |