Hardware Reference
In-Depth Information
Figure 5.21
Figure 5.22
states or a l ag or to convert the inputs into one-shot signals with one-clock-period
duration?
Exercise 5.12: Time Behavior of a String Detector
Consider the Moore-type state machine of i gure 5.14a, which detects the sequence
“
abc
” for the case of
a
≠
b
≠
c
, where
x
and
y
represent the input and output,
respectively.
a) Complete the timing diagram of i gure 5.22 for the given values of
x
. Note that a
little propagation delay was included between the clock transitions and the respective
changes in the present state; do the same for
y
.
b) Does the output go up immediately when the sequence “
abc
” occurs or only at the
next (positive) clock edge? Is this result as you expected? (Recall that Moore machines
are fully synchronous.)
Exercise 5.13: Generic Overlapping String Detector
We saw in section 5.4.9 a generic approach for the implementation of nonoverlapping
string detectors. In that case, if the sequence to be detected were “
aba
”, for example,
the response to the serial bit stream “
abababab
…” would be “00100010001…”, whereas
here, because overlaps must be allowed, it should be “0010101…”. Can you i nd a
generic solution (with or without a state machine) for this case?
Exercise 5.14: Keypad Encoder
Figure 5.23a shows a 12-key keypad for which we need to design an encoder (and
possibly also a debouncer—debouncers are discussed in chapter 8). The actual push-
button connections can be seen in i gure 5.23b, where
r
(3:0) and
c
(2:0) represent the
keypad's rows and columns, respectively. Note that because of the pull-up resistors,