Teaching Top-Down Design Using VHDL and CPLD
Teaching Top-Down Design Using VHDL and CPLD
Morris Chang
Computer Engineering Program
Department of Computer Science
st
Illinois Institute of Technology, 10 west 31 street
Chicago, IL 60616
Internet: [email protected]
with mstate select A simple VHDL design (not optimized one) for the
state <= “00001” when j, 4-bit round-up system is described in the next figure.
“00010” when k, This design takes similar approach as the digital
“00100” when l,
“01000” when m, comparator described earlier. A one-bit round-up system
“10000” when n; (i.e. the roundup entity) is designed first. Then, a
END statemach; structural architecture, which takes advantage of VHDL
construct — generate and constant, is implemented (i.e.
This VHDL code has two processes; one for the
rndup_n entity). A 4-bit design using a Boolean
registers and one for the combinatorial logic. The state
expression is also included for comparison. Apparently, it
encoding is decoded and connected to output ports for
would be much difficult and error prone to design a 32-
testing purpose.
bit case by using the Boolean expression approach.
System level partition Leading0_in
Bit_in leading0_in : all the leading bits
Any1_out are “0s”
Leading0_out
Partition a complex design into small components Set1_out One-bit Any1_in any1_in: at least one of the
allows students to focus on higher level of abstraction round-up trailing bits is “1”
Set1_in
set1_out: the current bit is
and hierarchy in design description which have become requesting the next
bit_out
desirable to digital systems designers. For instance, an 8- higher order bit to set its
bit ripple adder can be implemented by a cascade of 8 b_in(3) b_in(2) b_in(1)b_in(0)
bit_out to “1”
full-adder stages. The VHDL generate statement can
instantiate small components (e.g. 1-bit full adder) in an
iterative fashion. In addition, using the VHDL constant
declaration this 8-bit adder can be modified easily to a n-
b_out(3) b_out(1)
b_out(2) b_out(0)
b_out(4)
b_out(3) = b_in(3)•b_in(2)’•b_in(1)’•b_in(0)’
+ b_in(3)’•b_in(2)•( b_in(1) + b_in(0))
b_out(4) = b_in(3)•(b_in(2) + b_in(1) + b_in(0))