skip instructionseTEACH presentation accessible player instructions

This eTEACH player requires that you have Flash 8 or above installed. If you do not, download the player from Adobe.

The next major heading marks the start of the presentation. Each next lower level heading thereafter marks the beginning of a slide. An audio control button that plays the audio track for the slide follows the contents and notes for each slide in the presentation. Pressing this button after the audio playback toggles pausing and resuming the playback. Before moving off the play audio button, complete listening to the audio track for the slide or pause the audio. Control + Shift + L increases volume. Control + Shift + Q decreases volume.

There is a table of contents for the presentation following the presentation. The table of contents can be used to access sections of the presentation in random order. Type Control + Shift + C to go to the table of contents.

When links to external resources are present in the presentation, a list of these resource links follows the table of contents. When following a link to a resource, you should remember which slide you were on. When you return to the main page, your screen-reader may not return you to that slide. You can use the table of contents or just click through the headings to return to the correct slide.

This presentation contains resources. Click here to proceed immediately to the resource list. A link to resources follows each slide.

If the presentation contains one or more quizzes, a button to take you to each quiz follows the slide at which the quiz is to occur. Each question in the quiz begins with a level three heading. The answer choices will be presented in a list. If your instructor has supplied a hint for the questions, it will follow the answers and is formatted as an anchor. The correct answer to the question follows the list of answers and the hint (if included). The correct answer is also formatted as an anchor.

Chapter 2 - Part 1 - PPT - Mano & Kime - 2nd Ed

Slide 1 Lecture 25 Algorithmic State Machines

Lecture 25 Algorithmic State Machines

Slide 2 Overview

Overview Datapath and Control Algorithmic State Machines (ASM) ASM chart Timing considerations ASM chart example Binary multiplier

Slide 3 Datapath and Control

Datapath and Control Datapath - performs data transfer and processing operations Control Unit - Determines the enabling and sequencing of the operations The control unit receives: External control inputs Status signals The control unit sends: Control signals Control outputs Control inputs Data inputs Data outputs Datapath Control outputs Control signals Status signals Control unit Describe properties of the state of the datapath

Slide 4 Control Unit Types

Control Unit Types Two distinct classes: Programmable Non-programmable (hard-wired) A programmable control unit has: A program counter (PC) or other sequencing register with contents that points to the next instruction to be executed An external ROM or RAM array for storing instructions and control information Decision logic for determining the sequence of operations and logic to interpret the instructions A non-programmable control unit does not fetch or sequence instructions from a memory We ll focus on hard-wired control in this lecture

Slide 5 Algorithmic State Machines

Algorithmic State Machines A flowchart is a way of showing actions and control flow in an algorithm. An Algorithmic State Machine (ASM) is simply a flowchart-like way to specify state diagrams for sequential logic and, optionally, actions performed in a datapath. While flowcharts typically do not specify time , an ASM explicitly specifies a sequence of actions and their timing relationships. IDLE AVAIL START R← R + 1 R ← 0 Q0 0 1 MUL0 MUL1 ASM BLOCK Entry Exit Exit Exit

Slide 6 State Box

A rectangle with: The symbolic name for the state marked outside the upper left top Containing register transfer operations and outputs activated within or while leaving the state An optional state code, if assigned, outside the upper right top (Symbolic Name) IDLE (Register transfers or outputs) R ← 0 RUN (Optional state code) 0000 State Box

Slide 7 Scalar Decision Box

A diamond with: One input path (entry point). One input condition, placed in the center of the box, that is tested. A TRUE exit path taken if the condition is true (logic 1). A FALSE exit path taken if the condition is false (logic 0). (Input) START (True Condition) (False Condition) 0 1 Scalar Decision Box

Slide 8 Vector Decision Box

Vector Decision Box A hexagon with: One Input Path (entry point). A vector of input conditions, placed in the center of the box, that is tested. Up to 2n output paths. The path taken has a binary vector value that matches the vector input condition (Vector of Input Conditions) (Binary Vector Values) 00 01 (Binary Vector Values) 10 Z, Q0

Slide 9 Conditional Output Box

Conditional Output Box An oval with: One input path from a decision box or decision boxes. One output path Register transfers or outputs that occur only if the conditional path to the box is taken. Transfers and outputs in a state box are Moore type - dependent only on state Transfers and outputs in a conditional output box are Mealy type - dependent on both state and inputs (Register transfers or outputs) R ← 0 RUN From Decision Box(es)

Slide 10 Connecting Boxes Together

By connecting boxes together, we begin to see the power of expression. What are the: Inputs? Outputs? Conditional Outputs? Transfers? Conditional Transfers? Connecting Boxes Together IDLE R← 0 START 0 1 PC ← 0 AVAIL INIT

Slide 11 ASM Blocks

ASM Blocks One state box along with all decision and conditional output boxes connected to it is called an ASM Block. The ASM Block includes all items on the path from the current state to the same or other states. IDLE AVAIL START R← R + 1 R ← 0 Q0 0 1 MUL0 MUL1 ASM BLOCK Entry Exit Exit Exit

Slide 12 ASM Timing

ASM Timing Outputs appear while in the state Register transfers occur at the clock while exiting the state - New values occur in the next state! Clock cycle 1 Clock cycle 2 Clock cycle 3 Clock START Q 1 AVAIL IDLE MUL 1 0034 0000 State A Q 0

Slide 13 Multiplier Example

Multiplier Example Example: (101 x 011) Base 2 Note that the partial product summation for n digits, base 2 numbers requires adding up to n digits (with carries) in a column. Note also n x m digit multiply generates up to an m + n digit result (same as decimal). Partial products are: 101 x 0, 101 x 1, and 101 x 1

Slide 14 Example (1 0 1) x (0 1 1) Again

Example (1 0 1) x (0 1 1) Again Reorganizing example to follow hardware algorithm: Clear C || A Multipler0 = 1 => Add B Addition Shift Right (Zero-fill C) Multipler1 = 1 => Add B Addition Shift Right Multipler2 = 0 => No Add, Shift Right

Slide 15 Multiplier Example: Block Diagram

Multiplier Example: Block Diagram C out n n n 2 1 Counter P Zero detect Control unit G (Go) log 2 n Q o Z Parallel adder Multiplicand Register B Shift register A 0 C Shift register Q Multiplier Product OUT IN Control signals n n n 4

Slide 16 Multiplier Example: Operation

Multiplier Example: Operation The multiplicand (top operand) is loaded into register B. The multiplier (bottom operand) is loaded into register Q. Register C||A is initialized to 0 when G becomes 1. The partial products are summed iteratively in register C||A||Q. Each multiplier bit, beginning with the LSB, is processed (if bit is 1, use adder to add B to partial product; if bit is 0, do nothing) C||A||Q is shifted right using the shift register Partial product bits fill vacant locations in Q as multiplier is shifted out If overflow during addition, the outgoing carry is recovered from C during the right shift Steps 5 and 6 are repeated until Counter P = 0 as detected by Zero detect. Counter P is initialized in step 4 to n 1, n = number of bits in multiplier

Slide 17 Multiplier Example: ASM Chart

Multiplier Example: ASM Chart 0 1 G IDLE MUL0 0 1 Z MUL1 0 1 0 C ← 0, A ← P ← n 1 A ← A + B, C ← C out P ← P 1 C ← 0, C || A || Q ← sr C || A || Q, Q 0

Slide 18 Multiplier Example: ASM Chart (continued)

Multiplier Example: ASM Chart (continued) Three states are employed using a combined Mealy - Moore output model: IDLE - state in which: input G is used as the condition for starting the multiplication, and C, A, and P are initialized MUL0 - state in which conditional addition is performed based on the value of Q0. MUL1 - state in which: right shift is performed to capture the partial product and position the next bit of the multiplier in Q0 the terminal count of 0 for down counter P is used to sense completion or continuation of the multiply.

Slide 19 Multiplier Example: Control Signal Table

Multiplier Example: Control Signal Table Control Signals for Binary Multiplier Bloc k Dia g ram Mod u l e Mi cr oo pe ra ti on Contr o l Si gn al N a me Contr o l Exp r e ssi on Register A : A ← 0 I nitia liz e G A ← A + B Load MUL0 · Q C || A || Q sr C || A || Q Shift_dec M UL1 Register B : B ← IN Load_B LO ADB F lip-F lop C : C ← 0 C lea r _C IDLE · G + MUL1 C ← C ou t Load Register Q : Q ← IN Load_Q LO ADQ C || A || Q ← sr C || A || Q Shift_dec Cou n ter P : P ← n 1 I nitia liz e P ← P 1 Shift_dec IDLE · ←

Slide 20 Multiplier Example: Control Table (continued)

Signals are defined on a register basis LOADQ and LOADB are external signals controlled from the system using the multiplier and will not be considered a part of this design Note that many of the control signals are reused for different registers. These control signals are the outputs of the control unit With the outputs represented by the table, they can be removed from the ASM giving an ASM that represents only the sequencing (next state) behavior Multiplier Example: Control Table (continued)

Slide 21 Multiplier Example - Sequencing Part of ASM

Multiplier Example - Sequencing Part of ASM 0 1 IDLE MUL0 0 1 01 MUL1 10 00 G Z

Slide 22 One Flip-Flop per State

This method uses one flip-flop per state and a simple set of transformation rules to implement the circuit. The design starts with the ASM chart, and replaces State Boxes with flip-flops, Scalar Decision Boxes with a demultiplexer with 2 outputs, Vector Decision Boxes with a (partial) demultiplexer Junctions with an OR gate, and Conditional Outputs with AND gates. Each is discussed detail below. Figure 8-11 is the end result. One Flip-Flop per State

Slide 23 State Box Transformation Rules

State Box Transformation Rules Each state box transforms to a D Flip-Flop Entry point is connected to the input. Exit point is connected to the Q output.

Slide 24 Scalar Decision Box Transformation Rules

Scalar Decision Box Transformation Rules Each Decision box transforms to a Demultiplexer Entry points are "Enable" inputs. The Condition is the "Select" input. Decoded Outputs are the Exit points.

Slide 25 Vector Decision Box Transformation Rules

Vector Decision Box Transformation Rules Each Decision box transforms to a Demultiplexer Entry point is Enable inputs. The Conditions are the Select inputs. Demultiplexer Outputs are the Exit points. (Vector of Input Conditions) (Binary Vector Values) 00 01 (Binary Vector Values) 10 X1, X0 X1 Entry Exit 0 Exit 1 X0 DEMUX EN A1 A0 D0 D2 D1 D3 Exit2 Exit 3

Slide 26 Junction Transformation Rules

Junction Transformation Rules Where two or more entry points join, connect the entry variables to an OR gate The Exit is the output of the OR gate

Slide 27 Conditional Output Box Rules

Conditional Output Box Rules Entry point is Enable input. The Condition is the "Select" input. Demultiplexer Outputs are the Exit points. The Control OUTPUT is the same signal as the exit value.

Slide 28 Multiplier Example: Flip-flop per State Design Logic Diagram

Multiplier Example: Flip-flop per State Design Logic Diagram D C IDLE D C MUL0 D C MUL1 Initialize Clear _C Load Shift_dec Clock Z Q 0 4 1 G 2 5 4 5 1 1 5 DEMUX D 0 D 1 A 0 EN 2 DEMUX D 1 D 0 A 0 EN START

Slide 29 Summary

Summary Datapath and Control Algorithmic State Machines (ASM) ASM chart Timing considerations ASM chart examples Binary multiplier

End of slides

Table of Contents

The object immediately following this sentence is the media player.


You need to upgrade your Flash Player.
Please download and install the latest Flash Player.
If you have the latest Flash Player and are still seeing this message, proceed.