# Another important circuit that we have studied is the one-shot.

We can apply
the concept of a counter to implement a digital one-shot using HDL.
Recall from Chapter 5 that one-shots were devices that produce a pulse of
a predefined width every time the trigger input is activated. A nonretriggerable
one-shot ignores the trigger input as long as the pulse output is still
active. A retriggerable one-shot starts a pulse in response to a trigger and
restarts the internal pulse timer every time a subsequent trigger edge
occurs before the pulse is complete. The first example we investigate is a
nonretriggerable, HIGH-level-triggered digital one-shot. The one-shots
that we studied in Chapter 5 used a resistor and capacitor as the internal
pulse timing mechanism. In order to create a one-shot using HDL techniques,
we use a four-bit counter to determine the width of the pulse. The
inputs are a clock signal, trigger, clear, and pulse width value. The only
output is the pulse out, Q. The idea is quite simple. Whenever a trigger
is detected, make the pulse go HIGH and load a down-counter with a number
from the pulse width inputs. The larger this number, the longer it will
take to count down to zero.The advantage of this one-shot is that the pulse
width can be adjusted easily by changing the value loaded into the
counter. As you read the sections below, consider the following question:
“What makes this circuit nonretriggerable and what makes it leveltriggered?”
SECTION 7-24/HDL ONE-SHOTS 461
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ENTITY fig7_87 IS
PORT ( clk :IN BIT;
q :OUT BIT_VECTOR (3 DOWNTO 0));
END fig7_87;
ARCHITECTURE vhdl OF fig7_87 IS
SIGNAL ser_in :BIT;
BEGIN
PROCESS (clk)
VARIABLE ff :BIT_VECTOR (3 DOWNTO 0);
BEGIN
IF (ff(3 DOWNTO 1) = "000") THEN ser_in <= '1'; -- self-start
ELSE ser_in <= '0';
END IF;
IF (clk'EVENT AND clk = '1') THEN
ff(3 DOWNTO 0) := (ser_in & ff(3 DOWNTO 1)); -- shift right
END IF;
q <= ff;
END PROCESS;
END vhdl;

Which lines of Figure 7-85 ensure that the ring counter self-starts? 3. REVIEW QUESTIONS 1.FIGURE 7-87 VHDL four-bit ring counter. What does it mean for a ring counter to self-start? 2. Which lines of Figure 7-87 ensure that the ring counter self- .