8 - Seq Programmable ASM
8 - Seq Programmable ASM
▪ Since the combinational PLD consists of only gates, it is necessary to include external flip‐flops when they are
used in the design.
▪ In this way, the device can be programmed to perform a variety of sequential‐circuit functions.
▪ There are several types of sequential programmable devices available commercially, but the internal logic of
these devices is too complex to be shown here.
▪ Therefore, we will describe three major types without going into their detailed construction:
▪ The sequential PLD is sometimes referred to as a simple PLD to differentiate it from the complex PLD.
▪ The SPLD includes flip‐flops, in addition to the AND–OR array, within the integrated circuit chip.
▪ The circuit outputs can be taken from the OR gates or from the outputs of the flip‐flops (D or the JK type).
Additional programmable connections are available to include the flip‐flop outputs in the product terms formed
with the AND array.
Sequential (or simple) programmable logic device (SPLD)
▪ The configuration mostly used in an SPLD is the combinational PAL together with D flip‐flops.
▪ A PAL that includes flip‐flops is referred to as a registered PAL, to signify that the device contains
flip‐flops in addition to the AND–OR array.
▪ Each section of an SPLD is called a macrocell, which is a circuit that contains a sum‐of‐products
combinational logic function and an optional flip‐flop.
▪ We will assume an AND–OR sum‐of‐products function, but in practice, it can be any one of the
two‐level implementations presented in Section 3.7.
Sequential (or simple) programmable logic device (SPLD)
▪ The configuration mostly used in an SPLD is the combinational PAL together with D flip‐flops.
▪ A PAL that includes flip‐flops is referred to as a registered PAL, to signify that the device contains
flip‐flops in addition to the AND–OR array.
▪ Each section of an SPLD is called a macrocell, which is a circuit that contains a sum‐of‐products
combinational logic function and an optional flip‐flop.
▪ We will assume an AND–OR sum‐of‐products function, but in practice, it can be any one of the
two‐level implementations presented in Section 3.7.
SELF-STUDY ASSIGNMENT
▪ The behavior of many digital systems depends on the history of their inputs, and the conditions that determine their
future actions depend on the results of previous actions. Such systems are said to have “memory.”
▪ A digital system is a sequential logic system constructed with flip‐flops and gates.
▪ To specify a large digital system with a state table is very difficult, because the number of states would be enormous.
▪ To overcome this difficulty, digital systems are designed via a modular approach.
▪ The system is partitioned into subsystems, each of which performs some function.
▪ The modules are constructed from digital devices such as registers, decoders, multiplexers, arithmetic elements, and
control logic.
▪ The various modules are interconnected with datapaths and control signals to form a digital system.
▪ In this chapter, we will introduce a design methodology for describing and designing large, complex digital systems.
▪ The modules of a digital system are best defined by a set of registers and the operations that are performed on the
binary information stored in them. Examples of register operations are shift, count, clear, and load .
▪ A register is a connected group of flip‐flops that stores binary information and has the capability of performing one or
more elementary operations.
▪ The information flow and processing performed on the data stored in the registers are referred to as register transfer
operations.
A digital system is represented at the register transfer level (RTL) when it is specified by the following three
components:
The type of operations most often encountered in digital systems can be classified into four categories:
1. Transfer operations, which transfer (i.e., copy) data from one register to another.
2. Arithmetic operations, which perform arithmetic (e.g., multiplication) on data in registers.
3. Logic operations, which perform bit manipulation (e.g., logical OR) of non-numeric data in registers.
4. Shift operations, which shift data between registers.
Register Transfer Level Notations
A = 1010 and B = 0000,
Self Study
Binary information in Digital Systems:
Data
Control
Or
✓ One exit path is taken if the condition is true and another if false
✓ The conditional box in unique to ASM chart
✓ The operations within the state and conditional boxes are executed
with a common clock pulse while the system is in state T1.
✓ The same clock pulse also transfers the system controller to one of
the next states.
A3 = 0, A4 = 0
T1
A3 = 1, A4 = 0
A3 = 0, A4 = 1
A3 = 1, A4 = 1
T2
T0
✓ The requirements of design of the datapath are
specified inside the state and conditional boxes
T0 0 0 0 X X 0 0 1 0 0
T0 0 0 1 X X 0 1 1 0 0
T1 0 1 X 0 X 0 1 0 1 0
T1 0 1 X 1 0 0 1 0 1 0
T1 0 1 X 1 1 1 1 0 1 0
T2 1 1 X X X 0 0 0 0 1
State Table:
T0 0 0 0 X X 0 0 1 0 0
T0 0 0 1 X X 0 1 1 0 0
T1 0 1 X 0 X 0 1 0 1 0
T1 0 1 X 1 0 0 1 0 1 0
T1 0 1 X 1 1 1 1 0 1 0 Design Using D FFs.
T2 1 1 X X X 0 0 0 0 1
Flip-flop Inputs
DG1 = T1A3A4
Output Functions
T0 = G0’
T1 = G1’G0
T2 = G1
Flip-flop Inputs
DG1 = T1A3A4
DG0 = T0S +T1
Output Functions
T0 = G0’
T1 = G1’G0
T2 = G1
▪ This section introduces a second design example.
▪ then shows how to use an ASMD chart to design its datapath and its
controller.
▪ Let us multiply the two binary numbers 10111 and 10011: ▪ If the multiplier bit is 1, the multiplicand is copied
down; otherwise, 0’s are copied down.
d ▪ Finally, the numbers are added and their sum forms the
product.
▪ First, we note that, in the context of synthesizing a sequential machine, the add‐and‐shift algorithm for binary
multiplication can be executed in a single clock cycle or over multiple clock cycles.
▪ A choice to form the product in the time span of a single clock cycle will synthesize the circuit of a parallel multiplier
like the one discussed in Section 4.7.
▪ On the other hand, an RTL model of the algorithm adds shifted copies of the multiplicand to an accumulated partial
product.
▪ The values of the multiplier, multiplicand, and partial product are stored in registers, and the operations of shifting and
adding their contents are executed under the control of a state machine.
▪ Among the many possibilities for distributing the effort of multiplication over multiple clock cycles, we will consider
that in which only one partial product is formed and accumulated in a single cycle of the clock. (
▪ Instead of providing digital circuits to store and add simultaneously as many binary numbers as there are 1’s in
the multiplier, it is less expensive to provide only the hardware needed to sum two binary numbers and
accumulate the partial products in a register.
▪ Second, instead of shifting the multiplicand to the left, the partial product being formed is shifted to the right.
This leaves the partial product and the multiplicand in the required relative positions.
▪ Third, when the corresponding bit of the multiplier is 0, there is no need to add all 0’s to the partial product, since
doing so will not alter its resulting value.
▪ A block diagram for the sequential binary multiplier is
shown in Fig. 8.14 (a), and the register configuration of the
datapath is shown in Fig. 8.14 (b).
▪ The control logic also receives a signal, Zero, from a circuit that
checks counter P for zero.
▪ Q[0] and Zero are status inputs for the control unit.
▪ Note, again, that the state of the control is not an interface signal
between the control unit and the datapath.
▪ Only the signals needed to control the datapath are included in the
interface.
▪ Then, (1) control goes to state S_add, (2) register A and carry flip‐flop C are cleared
to 0, (3) registers B and Q are loaded with the multiplicand and the multiplier,
respectively, and (4) the sequence counter P is set to a binary number n, equal to the
number of bits in the multiplier.
▪ In state S_add, the multiplier bit in Q[0] is checked, and if it is equal to 1, the
multiplicand in B is added to the partial product in A . The carry from the addition is
transferred to C . The partial product in A and C is left unchanged if Q[0] = 0.
▪ Registers C, A, and Q are combined into one composite register CAQ, denoted by the
concatenation { C, A, Q }, and its contents are shifted once to the right to obtain a
new partial product.
▪ This shift operation is symbolized in the flowchart with the Verilog logical right‐shift
operator, >>. It is equivalent to the following statement in register transfer notation:
▪ In terms of individual register symbols, the shift operation can be described by the
following register operations:
▪ Both registers A and Q are shifted right. The leftmost bit of A, designated by An-1 ,
receives the carry from C . The leftmost bit of Q, Qn-1 , receives the bit from the
rightmost position of A in A0 , and C is reset to 0.
▪ In essence, this is a long shift of the composite register CAQ with 0 inserted into
the serial input, which is at C .
▪ The value in counter P is checked after the formation of each partial product. If the
contents of P are different from zero, status bit Zero is set equal to 0 and the
process is repeated to form a new partial product.
▪ The process stops when the counter reaches 0 and the controller’s status input Zero
is equal to 1.
▪ Note that the partial product formed in A is shifted into Q one bit at a time and
eventually replaces the multiplier.
▪ The final product is available in A and Q, with A holding the most significant bits
and Q the least significant bits of the product.
Table 8.5 to clarifies the multiplication process. The procedure follows the steps
outlined in the ASMD chart.
▪ The type of registers needed for the data processor subsystem can be derived
from the register operations listed in the ASMD chart.
▪ Register A is a shift register with parallel load to accept the sum from the
adder and must have a synchronous clear capability to reset the register to 0.
▪ The C flip‐flop must be designed to accept the input carry and have a
synchronous clear.
▪ The control logic is a finite state machine; its Mealy‐ and Moore‐type outputs
control the operations of the datapath.
▪ The inputs to the control unit are the primary (external) inputs and the internal
status signals fed back from the datapath to the controller.
▪ The design of the system can be synthesized from an RTL description derived from
the ASMD chart.
▪ Alternatively, a manual design must derive the logic governing the inputs to the
flip‐flops holding the state of the controller.
▪ The information needed to form the state diagram of the controller is already
contained in the ASMD chart, since the rectangular blocks that designate state
boxes are the states of the sequential circuit.
▪ The diamond‐shaped blocks that designate decision boxes determine the logical
conditions for the next state transition in the state diagram and assertions of the
conditional outputs.
✓ The register transfer operations for each of the three states are listed in Fig. 8.16 (b)
and are taken from the corresponding state and conditional boxes in the ASMD chart.
✓ Establishing the state transitions is the initial focus, so the outputs of the controller
are not shown.
▪ We must execute two steps when implementing the control logic: (1) establish the
required sequence of states, and (2) provide signals to control the register
operations.
▪ The sequence of states is specified in the ASMD chart or the state diagram.
▪ The signals for controlling the operations in the registers are specified in the
register transfer statements annotated on the ASMD chart or listed in tabular
format.
▪ For the multiplier, these signals are Load_regs (for parallel loading the registers in
the datapath unit), Decr_P (for decrementing the counter), Add_regs (for adding the
multiplicand and the partial product), and Shift_regs (for shifting register CAQ ).
▪ The block diagram of the control unit is shown in Fig. 8.14 (a).
▪ The inputs to the controller are Start, Q[0], and Zero, and the outputs are Ready,
Load_regs, Decr_P, Add_regs, and Shift_regs, as specified in the ASMD chart.
▪ We note that Q[0] affects only the output of the controller, not its state transitions.
The machine transitions from S_add to S_shift unconditionally.
▪ An important step in the design is the assignment of coded binary values to the
states
▪ Indeed, one‐hot encoding uses more flip‐flops than other types of coding, but it
usually leads to simpler decoding logic for the next state and the output of the
machine.
▪ Because the decoding logic does not become more complex as states are added to
the machine, the speed at which the machine can operate is not limited by the time
required to decode the state.
▪ Since the controller is a sequential circuit, it can be designed manually by the sequential logic procedure outlined in
Chapter 5 .
▪ However, in most cases this method is difficult to carry out manually because of the large number of states and
inputs that a typical control circuit may have.
▪ As a consequence, it is necessary to use specialized methods for control logic design that may be considered as
variations of the classical sequential logic method.
▪ The method will be presented for a small circuit, but it applies to larger circuits as well.
▪ Of course, the need for these methods is eliminated if one has software that automatically synthesizes the circuit
from an HDL description.
Thank You