Professional Documents
Culture Documents
HDL Lecture4
HDL Lecture4
Chapter 4
Design
Examples
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-1
Digital Systems Design Using VHDL Roth/John
Introduction
In any design:
State the problem.
Obtain clear design specifications.
Define basic building blocks necessary to accomplish what is
specified, e.g., adders, shift registers, counters, etc.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-2
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-4
Digital Systems Design Using VHDL Roth/John
BCD Adder
In BCD representation:
A to F are not used. As 6 out of 16 representations
possible with 4 binary bits are skipped, a BCD number
will take more bits than the binary representation.
When BCD numbers are added:
Each sum digit should be adjusted to skip the six
unused codes.
Example: if 6 is added with 8, the sum is 14 in
decimal form. A binary adder would yield 1110, but
the lowest digit of the BCD sum should read 4. In
order to obtain the correct BCD digit, 6 should be
added to the sum whenever it is greater than 9.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-5
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-6
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-7
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-8
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-9
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-10
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-11
Digital Systems Design Using VHDL Roth/John
Controller
FSM with 2 states: initialization S0 and counting S1.
State graph:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-12
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-13
Digital Systems Design Using VHDL Roth/John
Since there are only two states for this circuit, it can be
implemented using one flip-flop.
Equation for single pulse, SP = S0∙SYNCPRESS
Single pulser and synchronizer circuit:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-14
Digital Systems Design Using VHDL Roth/John
Array Multiplier
Array multiplier: a parallel multiplier that generates the
partial products in a parallel fashion. Partial products are
added as soon as they are available.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-15
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-16
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-17
Digital Systems Design Using VHDL Roth/John
Keypad Scanner
Design for scanner for keypad will include:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-18
Digital Systems Design Using VHDL Roth/John
Block diagram:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-19
Digital Systems Design Using VHDL Roth/John
Scanner procedure:
Apply logic 1’s to columns C0, C1, and C2 and wait. If any key
is pressed, a 1 will appear on R0, R1, R2, or R3. Apply a 1 to
column C0 only. If any of the Ri’s is 1, a valid key is
detected. If R0 is received, one knows that switch 1 was
pressed.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-20
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-21
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-22
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-23
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-24
Digital Systems Design Using VHDL Roth/John
VHDL Code:
Equations for decoder, K, and V are implemented by
concurrent statements. The process implements the next
state equations for the keyscan and debounce flip-flops.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-25
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-26
Digital Systems Design Using VHDL Roth/John
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-27
Digital Systems Design Using VHDL Roth/John
Test Bench:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-28
Digital Systems Design Using VHDL Roth/John
Test process:
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
4-29