Professional Documents
Culture Documents
Structurial Digital System Design UNIT 5
Structurial Digital System Design UNIT 5
Structurial Digital System Design UNIT 5
And now, let's do some design. In this chapter we present several detailed
examples of digital design, from the small, yet important, to the substantial
project. The goals are two: to illustrate good design methodology and to introduce
important design problems and their treatment. There is repetition of some
aspects of design, particularly the use of ASM charts, yet each example has
fresh material. We will indulge in some excursions into interesting topics as
they occur in the context of design. We hope that in this way the concepts will
be more meaningful to you than they would be as separate, isolated subjects.
Examples 1 and 2 illustrate some basic design issues related to human
interaction with a digital device. In examples 3 and 4 we develop circuits to
support the conversion of information from a serial bit stream to a sequence of
bytes and vice versa, common operations in data communications (in Chapter
11 we use these circuits as a part of a larger microcomputer-based project). The
traffic-light controller and combination lock examples, 5 and 6, provide more
practice in design. In example 7, a Black Jack Dealer, we bring together several
design problems and techniques (this example reappears in a different design
mode in Chapter 10).
203
human reactions. When a machine operator presses a button to initiate some
action, the digital device must detect this signal and perform the appropriate
steps. In the typical case, the machine completes the actions in a flash, and is
back interrogating the pushbutton signal again long before the operator can
release the button. We must develop a scheme so that the machine processes
a particular button depression only once. A circuit for this is called a single
pulser; it delivers a pulse only a single clock cycle long when a button is pressed.
If we have such a circuit, our digital machine may test the single-pulser output
instead of dealing directly with the pushbutton signal and may thereby detect
only one event as long as the button is down.
We will study this problem and its solution in several ways. First, we
develop the most fundamental solution.
Algorithmic Solution of the Single Pulser
will require one flip-flop to record the state, and one two-input multiplexer to
develop the next-state input to the flip-flop. In systems with more states, the
state flip-flops hold an encoding of the current state and, in order to obtain logic
variables for each individual state, we must decode the state code. However,
in our present design, the output of one flip-flop has two distinct states, and this
is sufficient to produce signals for the two states WAIT and FIND directly, without
decoding.
Look at Fig. 6-1. Formally, the flip-flop output is a state variable A, A
o representing the FIND state and A = 1 the WAIT state. Thus
WAIT = A
FIND = A
So we may just call the flip-flop output WAIT, and then we have
FIND = WAIT
What are the two inputs to the next-state multiplexer? If the system is in
state 0 (FIND), the condition for a true input to the flip-flop is the same as for
moving next into state 1, namely, PE.SYNC. If the present state is 1 (WAIT),
a true flip-flop input for the next state again requires that the next state be 1.
The condition from the ASM chart is again PE.SYNC. Here is a multiplexer
whose inputs are all the same! We can eliminate the mux from the state generator
and run the signal PE.SYNC directly into the flip-flop input. Now, our complete
circuit consists of the synchronizing flip-flop PE.SYNC, the state flip-flop WAIT,
and the logic to form PE.PULSE. Figure 6-2 is the single-pulser circuit.
CLOCK.H
PB.PULSE.H
Although the foregoing derivation is our most fundamental solution of the single-
pulser problem, there is another approach that illustrates an important connection
between the architecture and the algorithm in digital design. Suppose we reason
as follows. Our architecture consists of a synchronizing flip-flop for PB*, with
output PB.SYNC, and another D flip-flop whose function is to delay the PB.SYNC
signal by one clock time. The second flip-flop has input PB.SYNC and output
PB.DELAYED. Then our single-pulser output signal PB.PULSEshould be true
only when PB.SYNC is true and PB.DELAYED is still false. As soon as
PB.DELAYED becomes true, we must stop asserting PB.PULSE. Can we formalize
these thoughts with an ASM? Of course; Fig. 6-3 is a one-state solution. This
ASM requires no flip-flops for state generation, since there is only one state.
The equation for PB.PULSE is
PB.PULSE = PB.SYNC·PB.DELAYED
The implementation looks identical to our original circuit in Fig. 6-2 except for
a trivial change in the names in the interior of the circuit.
Implications. This is an interesting phenomenon. We first had a two-
state system with minimal architecture (one flip-flop), and now we have a one-
F
PB.SYNC
Having developed a circuit for producing a single pulse from a long input signal,
we may package the circuit in a black box and treat it as one of our design
building blocks. The single-pulser black box has an input PB* from an asynchronous
source, and produces a one-clock-cycle true output PB.PULSE when the input
becomes true. Whenever we need this type of behavior, we may mentally plug
in our black box, and when we build our circuit, we use hardware similar to
Fig. 6-2 in the box. It would be nice if the single-pulser box were available in
a single chip, but it is not. However, we still treat the single-pulser operation
as a building block in our work.
Generalizing the Single Pulser
(a) Design a hazard-free system clock that runs in two modes, automatic and
manual. The automatic mode is a fixed-frequency mode derived from a
continuously running clock or oscillator. (Chapter 12 shows ways of fab-
There are two inputs, from a debounced mode switch and from a debounced
pushbutton. We may formalize the variables in the problem. Let the mode
switch output be MAN, and let MAN = T in the manual mode and MAN = F
in the automatic mode. Let the manual pushbutton's output be PB, and let
PB = T when the button is down and PB = F when the button is up. Let the
clock output be eLK. Since we are dealing with a clock for synchronous edge-
triggered systems, it is natural to let eLK = T be the high voltage level and
eLK = F be the low voltage level, although this choice is not essential to the
design.
In digesting the problem, we uncover a crucial point: the clock output must
be free of hazards. In Chapter 4, you learned about the catastrophies that will
occur when clocks deliver spurious edges. The most general way to avoid
hazards is to avoid gates on the lines that must be hazard-free. How can we
build something without gates? Commercial flip-flops are designed to have hazard-
free outputs, and using a flip-flop output is the most convenient way to avoid
gates. We will produce the clock output eLK directly from a flip-flop.
Now we are ready to derive an ASM chart for our system clock circuit.
eLK
L
Time_
In the manual mode, the ASM moves to whichever state reflects the PB position.
F Up
MAN "T PB
F Auto
Manual
" T Down
® I
I CLK=T
T Down
F/ / F Figure 6-5 An ASM of a system
MAN" T PB >-i;-
Auto / Manual
" clock.
The ASM formulation clearly demonstrates that the automatic mode overrides
the pushbutton and that, whenever we switch from the automatic to the manual
mode, the last automatic clock phase exists for its full duration, without any
shortening.
But the inputs MAN and PB in the ASM are asynchronous to the ASM
clock. In Chapter 5, you were told to avoid such signals in the ASM, since they
introduce many dangers, and even when they are not dangerous, it is usually
difficult to establish that their use is safe. Must we synchronize these signals
to protect our ASM from harm? In this case, we can quickly demonstrate that
we do not need to. Figure 6-5 is a two-state ASM with no conditional outputs.
The machine is always either in one state or in the other. When the mode switch
is changed from automatic to manual, the ASM either detects the change during
the present ASM state, or it doesn't. If it does, at the next state transition it
moves into the manual mode; if the ASM misses the change, it remains in the
automatic mode for one more clock cycle before entering manual mode. In
either event, in this simple ASM there is nothing to go wrong as a result of the
asynchronous nature of the MAN signal. A similar argument applies to PB.
Let's use the multiplexer controller method for implementing the state generator.
One flip-flop will encode the two states in our ASM. The purpose of the design
is to produce the system clock output eLK. We have already decided to produce
the system clock signal eLK as the output of a flip-flop. According to the ASM,
eLK is true in state HI and false in state LO. In Fig. 6-5, we chose to represent
LO by 0 and HI by 1. This is the same behavior as the eLK output: false in
LO and true in HI. In this case, we get our desired eLK output from the same
flip-flop used in the state generator. Very convenient.
Present Next
state state Conditions
LO LO 0 MAN·PB
HI 1 MAN + MAN·PB = MAN + PB
HI LO 0 MAN + MAN·PB = MAN + PB
HI 1 MAN·PB
Both voltage signal forms will be available for the debounced switch and pushbutton
variables. In Fig. 6-6, we show a multiplexer controller for our clock machine.
This completes our solution to the design problem.
Critique
All three individual gates in Fig. 6-6 come from a single 74LSOO Quad Two-
Input Nand Gate chip, since a spare Nand gate will implement the voltage
inversion conveniently. Our solution costs one chip for gates, one chip for the
two-input multiplexer, and one chip for the flip-flop. To be sure, there are unused
components in these packages, but for a fundamental module such as a system
clock you probably don't want to share the chips with other parts of the system.
In the unshared mode, the cost is three chips; sharing with other circuits, the
cost is i + i + ! = H chips.
Advantages of using the mux controller are its simplicity of construction
(synthesis) and its ability to display the original ASM structure in the circuit
(analysis). The mux method seldom takes more chips than alternative solutions.
In this simple case, using a JK flip-flop for the state generator can yield a solution
requiring one flip-flop and two OR gates-a cost of two unshared chips or one
shared chip. We have not taught you this JK method because it results in obscure
circuits that bear little detectable relation to the original design and because any
PB.L<>--<l
PB.H - - - L _ . . /
P--a
OSCILLATOR.H
Bit stream
Receiver
sampling points t t t t t t t t
Receiver
bit clock
Figure 6-7 Deriving a receiver bit
Time ____ clock from the data stream.
Our design problem is to produce a clock signal for use by a serial data receiver.
How can we create a clock for such a bit stream? What information do
we have?
DATA.SYNC EB OLD.DATA
Now we may write our ASM to embody the analysis in the preceding
paragraphs. Figure 6-8 is the one-state ASM for the receiver bit clock. Before
implementing this ASM, however, we should ask a question. We should be
suspicious of a clock circuit that has two different ways of creating one of the
clock edges. Can the BIT.CLOCK output have any undesirable short clock
phases? In the ASM, a data transition will preempt all other events. What if
a data transition occurs when the ASM count is at 14 or 15, at 0 or I?
Transitions at 14 are okay, since BIT.CLOCK has been true since the 7-
count. A transition at 14 makes the T ~ F edge come slightly early, but that
is necessary to keep BIT.CLOCK synchronized with the incoming bit stream.
It is for exactly this purpose that we selected an ASM clock with a considerably
T F---BITCLOCK
O---COUNT
T
COUNT: 7 T---BITCLOCK
F
COUNT(+j 1
---COUNT
Then
(COUNT=15) = COUNT(TC)
(COUNT=7) = C3-C2-CI-CO
Look at the equation BIT.CLK(SET). Our intuition tells us that if the count
is 7, then it certainly is not 15, and so we should be able to toss out the term
(COUNT=15) from the equation. We may confirm our intuition by expanding
the meaning of the two terms
In the second step we use De Morgan's Law [Eq. (1-6)], and in the third Eq.
(1-5), A-A = F.
Now we may draft circuit diagrams. Figures 6-9 and 6-10 show the ar-
chitecture and the control signals. We have assumed that on the data line T =
H, although the choice does not affect the result.
Now we have a serial bit clock. In the next example, we will use this
clock in a circuit for a data receiver that converts a serial stream of bits into a
sequence of bytes.
DATA.SYNC.H
DATA-.H - - - I D Q 1--------4 D OLD.DATA.H
'LS74 'LS74
H H
DATA.TRANS.H ~I--_ _
(COUNT'=7).L ~ B1T.CLK(SET).H
DATA.TRANS.H _ _---.l~
COUNT(CLRJ.L
(COUNT=15).H
BIT.CLK(CLRJ.L
COUN1YCNT).H
Figure 6-10 Control signals for a se-
COUN1YTC).H -----(COUNT= 15).H rial bit clock.
(a) How do we find the serial bits in the incoming voltage waveform on the
serial-in line?
(b) How do we locate byte boundaries among the stream of bits?
The devices at the two ends of the serial line will be set to an agreed-on nominal
rate of incoming serial bits; in our example it is 9600 bits per second. With this
information, we may use the serial bit clock produced in Design Example 3 to
signal the S ~ P converter when to accept a bit.
Locating byte boundaries requires that the incoming serial bit stream have
some special characteristic that our system can recognize. In our protocol, we
assume that a special 9-bit pattern, SYNC, will periodically arrive in the serial
input stream. Our S ~ P converter must detect this SYNC pattern and use it
to establish the byte boundaries. We will defer to the byte receiver the decision
as to when to seek out this SYNC pattern. With this division of responsibilities,
we can add an input signal RESET to the S ~ P converter. Whenever the byte
receiver asserts this signal, the S ~ P converter will suspend normal byte
transfers until it locates a SYNC pattern among the incoming bits, at which time
it will resume placing bytes into the byte buffer and toggling READIT.
Design. The architecture will have a 9-bit buffer register to hold a byte
from the byte supplier, and a 9-bit shift register to hold a byte while it is being
disassembled and shipped out bit by bit over the serial-out line. Also, there will
be a controlled flip-flop FILLIT to tell the byte supplier when to deliver another
byte.
The basic timing element for parallel-to-serial conversion is the serial bit
time, so a clock operating at the P ~ S bit rate (9600 Hz) is a natural system
clock for our synchronous design. (To assist in debugging, we would probably
use the system clock of Design Example 2, which has both automatic and manual
modes; the automatic clock frequency would be fixed at 9600 Hz.)
There are two approaches to the design of the control algorithm. We could
draw a nine-state ASM chart that produces a serial bit for SO in each state.
This ASM could load a byte from the buffer into the shift register in one state
and shift the byte one position to the right in each of the other eight states.
Alternatively, we can view the ASM as having a single state, with the
architecture containing a binary counter capable of counting from 0 through 8,
to distinguish the nine activities per byte. Let's adopt this latter view and add
a counter to our architecture. The ASM in Fig. 6-11 is then self-explaining;
Fig. 6-12 shows the supporting architecture.
9 9
PSBYTE
Byte
buffer SHIFTER(SHIFT)
PSBYTE(LOAD)
register
SHIFTER( LOAD)
PSB YTE( CLOCK) To serial
PSCLK
out line SO
(Derived from
byte supplier)
FlLLl7YTOGGLE) ~
Fli
FlLLlT
tl p (To byte
op I' )
PSCLK supp ler
COUNT(CLR)
COUNT(CNT) Counter
4 Counter (COUNT",S)
PSCLK compare
COUNT(CNT) = (COUNT~8)
SHIFTER(LOAD) = (COUNT~8)
SHIFTER(SHIFT) = (COUNT~8)
FILLIT(TOGGLE) = (COUNT~8)
Implementation. Once in state RUN, the ASM remains there until a reset
signal causes a precipitous transfer to state START. The state generator for this
two-state machine is a JK flip-flop with output R UN. The reset signal must
perform a direct (asynchronous) clear function on the flip-flop, and is thus labeled
RESET*.
In Fig. 6-13, we have labeled each conditional output oval. These labels
are not state names, but just represent positions within the parent state. For
the conditional output term CD
in state START, we will create a logic variable
START.]; similarly, the notations CD
and @ in state RUN will result in variables
R UN.] and R UN.2. Conditional output labels are excellent aids in the systematic
implementation of complex ASM charts.
From the S ~ P ASM chart in Fig. 6-13, we derive the following equations:
START.] START-SYNCBYTE
RUN.] RUN-(CQUNT?:!8)
RUN.2 RUN-(CQUNT?:!8)
START RUN
RUN(SET) START.]
SYNC
byte SYNCBYTE
detector
RESET-
RESET(SET)
Flip
RESE1YCLR)
flop
RESET(CLOCK)
(Derived from
byte receiver) START
State
SYNCBYTE RUN
generator
(COUNT,;?-S)
READlT(TOGGLE) READlT
(To byte
receiver)
SPCLK
COUNT(CLR)
COUN1YCNT) 4
Count (COUNT,;?-S)
~ompare
SPCLK
R UN(DIRECT.CLEAR) RESET*
SHIFTER( SHIFT) T
COUNT(CLR) START.] + RUN.]
COUNT(CNT) RUN.2
BUFFER(LOAD) START.] + RUN.]
READIT(TOGGLE) START.] + RUN.]
Here are some suggestions for chips to implement the S ~ P converter.
The 9-bit buffer register may be two 74LS378 Hex Enabled D-Register chips.
Critique
:0
I
I
Figure 6-15 The location of the
I
I traffic signal and the sensors in Design
Farm road Example 5.
Preliminary Considerations
The highway traffic is given priority, but not to the extent that the farm-road
traffic can be stalled indefinitely. Since the default condition is a green light on
the highway, we do not need any sensors in the highway lanes. To keep the
example uncluttered, we will assume that the outputs of the sensors are combined
external to our design to produce the single signal CARS, and that this signal
satisfactorily indicates the presence of cars desiring to enter or cross the highway.
We might ask what signals the traffic lights must receive to activate their three
colors, but we defer such inquiries because we would like our solution to be
independent of any particular brand of traffic signal until we are ready to specify
one.
The control of the traffic signals involves four intervals: the minimum time
the highway light will be green, the maximum time the farm-road light will be
green, the duration of the highway's yellow signal, and the duration of the farm-
road's yellow signal. For simplicity, we assume that the first two intervals are
the same and that both yellow-light intervals are the same. To generate signals
representing these two intervals, we plan to have a timer, driven by a (high-
speed) master clock and initiated by a starting signal START. TIMER. Whenever
the timer is started, two output signals, THOLD and TYEL, are negated. If the
timer is not interrupted, the two signals will be asserted after their respective
intervals have elapsed; the signals will remain asserted until the timer is restarted
with START. TIMER. The same timing unit and the same enabling signal will
suffice for both timings, since the two intervals do not overlap.
Our preliminary architecture is shown in Fig. 6-16.
The control of the traffic signals breaks naturally into four events, which will
result in four ASM states:
State HG: Highway light green (and farm-road light red).
START.
{ GRN}
TIMER
Farm road
FL YEL
'light
RED
CLOCK
parameters to describe the condition of a traffic signal are, of course, the colors
of the signal. We derive
HL.GRN = HG FL.GRN = FG
HL.YEL = HY FL.YEL = FY
HL.RED = FG + FY FL.RED = HG + HY
The signal for starting the timer unit is
START.TIMER =
HG·THOLD·CARS + HY·TYEL + FG·(THOLD + CARS) + FY·TYEL
Let's use the multiplexer method to implement the state generator. In this
State B A
HG o o
HY o 1
FY 1 o
FG 1
For such a simple ASM, we could write down the state generator by·
inspection. Nevertheless, in almost every design we find it useful to tabulate
the conditions for changes in state. Table 6-1 shows the next-state conditions
for our traffic light controller. Figure 6-18 shows the state generator.
HG o HG 00 THOLD-CARS
HY 01 THOLD-CARS
HY HY 01 TYEL
FG 11 TYEL
FY 2 FY 10 TYEL
HG 00 TYEL
FG 3 FG 11 THOLD-CARS
FY 10 THOLD + CARS
F
TYEL
D Q B
TYEL
T
B A
THOLD-CARS
T
D Q A
F
THOLD-CARS
The ASM's outputs that are to control the traffic signals are expressed in terms
of the active color of the lights. Now suppose we select a particular traffic signal
and, reading the instructions, find that each signal is controlled by a 2-bit code
that specifies which of the three colors is active. In Fig. 6-19 we show this
particular choice of a traffic light, adopting T = H for the code. Now we may
derive logic equations that express the bits of the manufacturer's code in terms
of our traffic-light variables:
HLl = HL.YEL
HLO = HL.RED
FLl = FL.YEL
FLO = HL.RED
Now that the behavior of the particular traffic signal has been expressed in our
nomenclature, there remains only to plug in the particular expressions for each
light's colors to complete the implementation. Using the ASM output equations,
we get
HLl = HY
HLO = FG + FY
FLl = FY
FLO = HG+HY
HLl HLO HL
HLl
Highway 0 0 GRN
HL
light 0 YEL
HLO
0 RED
FLl FLO FL
FLl
Farm road 0 0 GRN
light
FL
FLO I 0 YEL Figure 6-19 A particular traffic light
0 RED for Design Example 5.
Build a 3-bit serial combination lock that lights a light when the correct combination
is entered.
We do not have to tell the thief how many bits to enter, and someone
trying to use our lock might therefore try 5, 6, or more digits. We can add this
feature with a Try pushbutton to test the combination already entered. If Try
is pressed any time except when the machine has processed 3 correct bits, we
should terminate the operation in an error state.
Developing the Algorithm
Figure 6-20 is a possible ASM for our lock problem. The essence of this chart
is to test each fixed bit of the combination in. a separate state and end up in
either a correct state or an error state. Some states loop back to themselves
while waiting on a human action. During the looping, these states must detect
any erroneous actions and also any attempt to reset the system. For example,
while the loop in state BIT 1. OK waits for the READ signal, it must provide loop
exits for an erroneous TR Y signal and for a RESET signal. (Why is this important?)
State BIT3.0K, which paves the way for a success, loops on TR Y, and must
recognize a READ signal as an error.
This is a fairly boring ASM chart. The only interesting part is the state
assignment. Since so many paths lead to an error state, we give state BAD a
state assignment of 000. The multiplexer controller uses gates to evaluate those
paths that lead to state assignments containing 1'so By making the largest number
of paths lead to a state with all O's, we can sometimes simplify the mUltiplexer
inputs.
This ASM chart has two objectionable features:
(a) The combination is built into the chart by the bit tests. Altering the bit
pattern of the combination requires a tedious reexamination of the ASM
chart and modification of the gate structure of the control mux system.
Changing the number of bits in the combination is a major undertaking-
distinctly poor design.
(b) Tests of the reset signal appear in every state and clutter up the ASM
chart.
Let's rework the algorithm to try a more elegant approach.
The reset tests in Fig. 6-20 are correct but unpleasing. A reset is often a
cataclysmic action that is intended to throw the system into a known state,
regardless of the present state and independent of the ASM's clocking. Although
our intended reset action is not quite this dramatic, the result is much the same.
Any time the operator hits Reset, the machine should go to the initial state and
start the lock algorithm anew. Nothing needs to be saved in the ASM. In this
problem, we may make one of our few standard uses of asynchronous signals:
treat the reset as an asynchronous event that will blast the ASM into the initial
state. By doing this, we can remove the synchronous tests of RESET and replace
them with a master asynchronous entry to the initial state by means of the signal
RESET*.
If we intend to reset the state flip-flops asynchronously, we must choose
a state assignment that lets the initial state conform to the results of the reset.
Usually, we assign 000 to the destination of the asynchronous reset.
and
we could compare the current value of the toggle switch with a reference value
supplied by the architecture and not by the ASM chart itself. If we call this
reference value for a particular bit REF, then the ASM chart would contain
Now, by altering the reference bits we may change the lock's combination easily.
Next, we will put the bit test in a loop. The number of bits in the combination
will determine when the loop terminates. Clearly, a 3-bit lock is not very safe,
since the probability of opening it in one try is 2 - 3 = i. It would be much nicer
to have a 10-bit lock, which would reduce the probability to 1/1024. Our mod-
ification will easily support such a change.
The new ASM, incorporating the proposed changes, is shown in Fig.
6-21. This is a much better algorithm. By coincidence, it has the same number
of states as before, yet it is able to handle a combination of M bits as easily as
three. Furthermore, we have regularized the branch out of the bit test-branching
occurs only when the input BIT is not equal to the reference bit. This systematic
feature allows us to embed the test inside a loop.
We have to pay something for the increased power of this algorithm:
(a) We now need a loop counter.
(b) We now need a table of reference bits-in other words, the combination.
Can we find hardware for this algorithm? The counter is no problem, since
it is one of our standard building blocks. For example, the 74LS163 Four-Bit
Programmable Binary Counter is able to support clearing, loading, and counting,
and can handle lock combinations with up to 16 serial bits. The combination
lookup table could be in a ROM (read only memory), a PLA (programmable
logic array), or a multiplexer. (Remember the discussions of building blocks in
Chapters 3 and 4.) The multiplexer is the cheapest solution for short tables.
We use CNT as the table index to find the current bit. For a combination of
10011110, the table lookup suggests an eight-input multiplexer:
;>----REF(CNT)
---14
0----1
0----1
1---1
CNT
Asynchronous
RESET.
8 000
'itate variables:
CBA
8 T
F
READ
T
F
BIT = REF(CNT)
T
F
8 T
T
READ
F
Architecture
Normally, the operator of a digital system will follow the progress of the work
by observing status responses such as lights or motor noises; the operator can
thus determine when to perform various actions. In our combination lock, we
wish the machine to be quiet, yielding no information except lighting an Open
light following a successful Try. If the machine's clock is faster than human
reactions, we may avoid "handshakes" between the operator and the machine,
since the machine will always be ready to process the operator's input.
The clock speed of our lock machine may be as slow as 0.2 sec or 5 Hz.
If we are driving our machine with batteries, for instance in a car, we would
use an oscillator of perhaps 100 Hz for our clock. (We discuss this technology
in Chapter 12.)
Our ASM chart tests the TRY and READ signals, which originate from
debounced pushbutton signals TRY* and READ*. We will pass these signals
through a single pulser to achieve synchronization and to assure that only a
single ASM action results from the push of a button. The single-pulser outputs
are TR Y and READ.
The bit-entry switch for the serial combination may be a plain toggle switch
BIT. (Why does it not need to be debounced or synchronized or single-pulsed?)
The specifications call for a Reset pushbutton with the output RESET*. The
sole output of the machine is a light, Open, so we include a black box in the
architecture to drive the lamp.
Buried within our hardware, inaccessible to the operator, will be a binary
counter with output CNT to control the loop count. A 74LS163 Four-Bit Pro-
grammable Binary Counter will do nicely; CNTwill then consist of 4 bits, CNT3-
CNTO. The architecture will also contain a multiplexer, with an output REF(CNT),
of sufficient size to provide an indexed table lookup for the bits of the combination.
For our illustration, let's use an 8-input mux such as the 74LS151. We do not
really need to commit ourselves to particular chips this early. All we need at
this point is a knowledge of what operations will be easily possible with each
building block.
Last, we may include a black box with output (CNT==M) and inputs CNT
and M to determine when the loop count CNT has reached the terminal value
mT3H~
CNT2.H (CNT:M) L
CNT1.H .
CNTO.H
There are few outputs in our ASM, and the equations are simple:
CNT(CLR) = INIT
CNT(COUNT) = INCR
OPEN = OK
All the ASM test inputs are available in the architecture except for
(BIT=REF(CNT)). How do we determine if one arbitrary logic signal is equal
to another? In Chapter 3, we introduced the logic function COINCIDENCE,
which produces truth if and only if its two inputs are the same. We may express
the bit test as
(BIT=REF(CNT)) = BIT 0 REF(CNT)
Now for the state generator. We use the multiplexer controller method
and the state assignment given in Fig. 6-21. The destination of the ASM asyn-
chronous reset has state assignment 000 to allow easy use of an asynchronous
clear input on the state generator flip-flop assembly. Table 6-2 contains the
state transitions required by our ASM. The six states require a 3-bit code. A
4-bit D register with asynchronous clear, such as the 74LS175, and three 8-input
mUltiplexers, for example the 74LS151, will support the structure.
To provide the three state signals INIT, INCR, and OK required by the
ASM output equations, we may use a 74LS42 Four-Line-to-Ten-Line Decoder.
This one-chip solution is more convenient than constructing the three signals
from gates.
REFfCNT).H
CNTfCLR).L
3
H
CNTfCOUNT).H ~~==~~==========~
O~CN~~-H~~----------------~
CLK.H
CET
Figure 6-23 is the state generator's structure. Figure 6-24 shows imple-
mentations of a few of the mux inputs. You should draft the rest.