two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e....

118
QUIZ Ch. 2 1 two’s

Transcript of two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e....

Page 1: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ Ch. 2

1

two’s

Page 2: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ Ch. 2

2

Page 3: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ Ch. 2

3

Page 4: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Chapter 3

REVIEW of Boolean Algebra

and Digital Logic

Page 5: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

5

Name the Boolean functions and draw the gates:

QUIZ: Boolean Algebra

Page 6: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

6

Page 7: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

7

Draw the truth table for the Boolean function:

QUIZ: Boolean Algebra

Page 8: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

8

Draw the truth table for the Boolean function:

QUIZ: Boolean Algebra

Page 9: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

9

Draw the truth table for the Boolean function:

QUIZ: Boolean Algebra

Page 10: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

10

Draw the truth table for the Boolean function:

QUIZ: Boolean Algebra

Page 11: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

11

Complete the Boolean identities:

QUIZ: Boolean Algebra

Page 12: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

12

Complete the Boolean identities:

QUIZ: Boolean Algebra

Page 13: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

13

Complete the Boolean identities:

QUIZ: Boolean Algebra

(

Page 14: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

14

Complete the Boolean identities:

QUIZ: Boolean Algebra

Page 15: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

15

Complete the Boolean identities:

QUIZ: Boolean Algebra

Page 16: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

16

Complete the Boolean identities:

QUIZ: Boolean Algebra

Page 17: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

17

Use Boolean identities to simplify:

QUIZ: Boolean Algebra

Page 18: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

18

Use Boolean identities to simplify:

QUIZ: Boolean Algebra

Page 19: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

19

• Sometimes it is more economical to build a

circuit using the complement of a function (and

complementing its result) than it is to implement

the function directly.

• DeMorgan’s law provides an easy way of finding

the complement of a Boolean function.

• Recall DeMorgan’s law states:

3.2 Boolean Algebra

Page 20: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

20

• DeMorgan’s law can be extended to any number of

variables.

• Replace each variable by its complement and

change all ANDs to ORs and all ORs to ANDs.

• Thus, we find the the complement of:

is:

3.2 Boolean Algebra

Page 21: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

21

• Through our exercises in simplifying Boolean

expressions, we see that there are numerous

ways of stating the same Boolean expression.

– These “synonymous” forms are logically equivalent.

– Logically equivalent expressions have identical truth

tables.

• In order to eliminate as much confusion as

possible, designers express Boolean functions in

standardized or canonical form.

3.2 Boolean Algebra

Page 22: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

22

• There are two canonical forms for Boolean

expressions: sum-of-products and product-of-sums.

– Recall the Boolean product is the AND operation and the

Boolean sum is the OR operation.

• In the sum-of-products form, ANDed variables are

ORed together.

– For example:

• In the product-of-sums form, ORed variables are

ANDed together:

– For example:

SOP and POS

Page 23: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

23

Write the SOP (sum-of-products) form and

the gate diagram:

QUIZ: Boolean Algebra

Page 24: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

24

Write the SOP (sum-of-products) form and

the gate diagram:

QUIZ: Boolean Algebra

Page 25: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

25

• We have looked at Boolean functions in abstract

terms.

• In this section, we see that Boolean functions are

implemented in digital computer circuits called gates.

• A gate is an electronic device that produces a result

based on two or more input values.

– In reality, gates consist of one to six transistors, but digital

designers think of them as a single unit.

– Integrated circuits contain collections of gates suited to a

particular purpose.

3.3 Logic Gates

Page 26: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

26

• The three simplest gates are the AND, OR, and NOT

gates.

• They correspond directly to their respective Boolean

operations, as you can see by their truth tables.

3.3 Logic Gates

Page 27: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

27

• Another very useful gate is the exclusive OR

(XOR) gate.

• The output of the XOR operation is true only when

the values of the inputs differ.

Note the special symbol

for the XOR operation.

3.3 Logic Gates

Page 28: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

28

Use DeMorgan to prove that the circuit below

implements the XOR gate:

Image source: Wikipedia →XOR gate

Page 29: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

29

• NAND and NOR

are two very

important gates.

Their symbols and

truth tables are

shown at the right.

3.3 Logic Gates

Page 30: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

30

• NAND and NOR

are known as

universal gates

because they are

inexpensive to

manufacture and

any Boolean

function can be

constructed using

only NAND or only

NOR gates.

3.3 Logic Gates

Page 31: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

31

Gates can have multiple inputs and multiple

outputs.

• E.g., a second output can be provided for

the complement of the operation.

3.3 Logic Gates

Page 32: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

32

• The main thing to remember is that combinations

of gates implement Boolean functions.

• The circuit below implements the Boolean

function:

We simplify our Boolean expressions so

that we can create simpler circuits.

3.3 Logic Gates

Page 33: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

3.4 Integrated Circuits (IC)

33

Problem: Design a circuit using the SSI IC 7400

(Quad NAND) Small Scale Integrated

Page 34: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Integrated Circuits (IC)

34

Problem: Design a circuit using the SSI IC 7400

Page 35: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

35

3.5 Combinational Circuits

• We have designed a circuit that implements the

Boolean function:

• This circuit is an example of a combinational logic

circuit.

• Combinational logic circuits produce a specified

output (almost) at the instant when input values

are applied.

– In a later section, we will explore circuits where this is

not the case.

Page 36: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

36

• Combinational logic circuits

give us many useful devices.

• One of the simplest is the

half adder, which finds the

sum of two bits.

• We can gain some insight as

to the construction of a half

adder by looking at its truth

table, shown at the right.

Combinational Circuits

Page 37: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

37

• As we see, the sum can be

found using the XOR

operation and the carry

using the AND operation.

Combinational Circuits

Page 38: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

38

• We can change our half

adder into to a full adder

by including gates for

processing the carry bit.

• The truth table for a full

adder is shown at the

right.

Combinational Circuits

Page 39: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

39

• How can we change the

half adder shown below

to make it a full adder?

Combinational Circuits

Page 40: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

40

• Here’s our completed full adder.

Combinational Circuits

Page 41: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

41

• Just as we combined half adders to make a full

adder, full adders can connected in series.

• The carry bit “ripples” from one adder to the next;

hence, this configuration is called a ripple-carry

adder.

Today’s systems employ more efficient adders.

Combinational Circuits

Page 42: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Read and take notes: pp.137-158

(stop before Example 3.1.3 – Decoder)

End-of-chapter Exercises 1, 2, 3, 4, 22

42

Page 43: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

43

Find the SOP expression and the truth table

for the following circuit:

QUIZ: Boolean Algebra

Page 44: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Design the Full Adder directly, based on the truth table,

using SOP. Compare to the previous design.

QUIZ: Combinational Circuits

Page 45: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Minimize the FA using K-maps.

Use the following layout for each output:

QUIZ: Combinational Circuits

XY CI

Page 46: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

FA solution

Page 47: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

FA solution

Which implementation is best?

(Trick question!)

Page 48: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

48

• Among other things, they are useful in selecting a

memory location according to a binary value placed

on the address lines of a memory bus.

• Address decoders with n inputs can select any of 2n

locations.

3.5 Combinational Circuits

Decoders

Page 49: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

49

2-to-4 decoder implementation. Each AND gate

generates a minterm!

If x = 0 and y = 1,

which output line

is enabled?

Decoders

Page 50: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

50

Draw the gate diagram for a 3-to-8 decoder,

with inputs x, y, z.

QUIZ: Decoders

Page 51: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

51

We’re designing a computer with 64 KB of RAM.

How many address bits are needed?

Typical decoder application:

memory addressing circuit

Page 52: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

52

We’re designing a computer with 64 KB of RAM.

From cost analysis, it turns out that the cheapest

solution uses 8-KB RAM chips.

How many chips are needed?

How many address bits does each chip accept?

How many address bits are needed to distinguish

among the chips?

Typical decoder application:

memory addressing circuit

Page 53: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

53

We’re designing a computer with 64 KB of RAM.

We implement it with 8 RAM chips, having 8KB each.

The 3 MSB are used to distinguish among the chips.

Write in hex the address range for each of the chips.

Typical decoder application:

memory addressing circuit

Page 54: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

54

Typical decoder application:

memory addressing circuit

Page 55: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

55

• A multiplexer is the opposite

of a decoder.

• It selects a single output

from several inputs.

• The particular input chosen

for output is determined by

the value of the multiplexer’s

control lines.

• To be able to select among n

inputs, log2n control lines are

needed.

3.5 Combinational Circuits

Multiplexers

Page 56: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

56

Implementation of a 4-to-1 multiplexer.

Each input is validated by a minterm!

If S0 = 1 and S1 = 0,

which input is

transferred to the

output?

3.5 Combinational Circuits

Page 57: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

57

This shifter

moves the bits

of a nibble one

position to the

left or right.

If S = 0, in which

direction do the

input bits shift?

3.5 Combinational Circuits

Shifters

Page 58: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

58

Draw the block

diagram of this

shifter.

QUIZ: Shifters

Page 59: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

59

2-bit ALU

Page 60: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

60

2-bit ALU

Which combination

f1f0 makes the ALU

add?

Hint: Addition

needs Carry.

Page 61: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Individual work for next time

• Read pages 157-162 , and 199-208 (“Focus

on K-maps”)

• Solve in notebook:

– Ex. 48, 49 on p.195

– Ex. 1, 2 on p.209

61

Page 62: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

62

3.6 Sequential Circuits

• Combinational logic circuits are perfect for

situations when we require the immediate

application of a Boolean function to a set of inputs.

• There are other times, however, when we need a

circuit to change its value with consideration to its

current state as well as its inputs.

– These circuits have to “remember” their current state; they

have memory

• Sequential logic circuits provide this functionality.

Page 63: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

63

To retain their state values, sequential circuits rely

on feedback.

• Example:

– If Q is 0 it will always be 0, if it is 1, it will always be 1.

Why?

3.6 Sequential Circuits

Page 64: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

64

In asynchronous sequential circuits (a.k.a. latches),

state changes occur whenever the inputs change.

In synchronous sequential circuits (a.k.a. flip-flops),

state changes are controlled by clocks.

• A “clock” is a special circuit that sends electrical

pulses through a circuit.

• Clocks produce “square” electrical waveforms:

3.6 Sequential Circuits

Page 65: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

65

• Synchronously: on the rising edge/falling edge,

a.k.a. edge-triggered

• Asynchronously: when the clock pulse is at its

highest/lowest voltage, a.k.a. level-triggered

Sequential Circuits can change state:

Page 66: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

66

You can see how feedback works by examining the

most basic sequential logic components, the SR

latch and flip-flop.

– The “SR” stands for set/reset.

3.6 Sequential Circuits

Page 67: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

67

The behavior of an SR latch is described by a

characteristic table:

• Q(t) means the value of the output at time t

• Q(t+1) is the value of Q after the next clock

pulse.

SR latch

Page 68: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ: Analyzing sequential circuits

What exactly does “undefined” mean here?

68

Page 69: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

69

• To draw a truth table,

note that the SR flip-flop

actually has three inputs:

S, R, and its current

output, Q.

• Notice the two undefined

values. When both S and

R are 1, the SR flip-flop is

unstable (well, it’s a little

more complicated … see

Digital)

SR latch

Page 70: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ: Analyzing sequential circuits

Derive the characteristic table for this circuit

70

Page 71: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

71

Clocked SR latch

Changes can

occur only on the

positive level of

CLK!

Text calls it

flip-flop

Page 72: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

72

SKIP JK flip-flop

Page 73: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

73

The D flip-flop is the fundamental circuit of

computer memory

D flip-flop

Page 74: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ: Problem 55/196

74

Page 75: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

75

• The behavior of sequential circuits can be

expressed using characteristic tables or finite state

machines (FSMs). – FSMs consist of a set of nodes that hold the states of the

machine and a set of arcs that connect the states.

• Moore and Mealy machines are two types of FSMs

that are equivalent. – They differ only in how they express the outputs of the

machine.

• Moore machines place outputs on each node, while

Mealy machines present their outputs on the

transitions.

3.6 Sequential Circuits

Page 76: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

76

Moore machine

Page 77: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

77

Mealy machine

Page 78: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

78

Moore vs. Mealy

Moore and Mealy machines are equivalent, i.e. they can be

used to implement circuits with the same behavior, but …

• Moore may need more states than Mealy

• Mealy may need more combinational logic than Moore

Page 79: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ

Draw the FSM diagram for a Moore machine

that:

• Has one input and one output

• Turns its output to 1 if and only if at the

previous 3 clock “ticks” the input has been

1 0 1

79

Page 80: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ: Draw the characteristic table and the FSM

diagram for this circuit.

What function does it perform?

Page 81: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

We can trade off flip-flops (memory) for (combinational)

logic: here is the same 4-state counter in the “walking ring”

implementation

Page 82: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ: If using ICs from the 7400 family, which

implementation requires fewer units?

7400 - quad inverter

7486 - quad XOR

7474 - double D w/positive and negative outputs Q

74174 - hex D w/positive outputs Q

74175 - quad D w/positive and negative outputs Q

Page 83: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

83

• It is difficult to express the complexities of actual

implementations using only Moore and Mealy

machines. – For one thing, they do not address the intricacies of

timing very well.

– Secondly, it is often the case that an interaction of

numerous signals is required to advance a machine from

one state to the next.

• For these reasons, Christopher Clare invented the

algorithmic state machine (ASM).

The next slide illustrates the components of an ASM.

Algorithmic State Machines

Page 84: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

84

Algorithmic State Machines

Page 85: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

85

ASM for a microwave oven (Moore or Mealy?).

Algorithmic State Machines

EoL

Page 86: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Individual work for next time

• Read pages 162-178

• Solve in notebook:

– Ex. 52 p.19

86

Page 87: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

QUIZ

Draw the FSM diagram for a Moore machine

that:

• Has two inputs (x, y) and one output (z).

• Turns its output to 1 if and only if at the

previous 2 clock “ticks” the inputs have

been identical.

87

Page 88: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

88

Important Sequential

Circuits

Page 89: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

4-bit register with D flip-flops

Real-life registers also have CLEAR

and ENABLE/WRITE inputs

They can also SHIFT or ROTATE their

bits (Left or Right)

Page 90: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

4-bit binary counters (Use the D version, not the JK given in text!)

Source: http://teahlab.com/4-bit_counter_modulo-16_D_flipflop/

But note that the JK circuit needs less combinational logic!

Page 91: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Source: http://teahlab.com/4-bit_counter_modulo-16_D_flipflop/

QUIZ: Assume the counter is in state ‘7’ right

before the positive edge of CLK. Write the states of all

signals in the diagram.

Then write the states

of all signals after the

positive edge.

handout

Page 92: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Source: http://teahlab.com/4-bit_counter_modulo-16_D_flipflop/

QUIZ: Assume the counter is in state ‘7’ right

before the positive edge of CLK. Write the states of all

signals in the diagram.

Then write the states

of all signals after the

positive edge.

handout

Page 93: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

93

Small Memory Circuit: four 3-bit words

?

Page 94: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

94

QUIZ: Write the integer 6 in Word 1

handout

Page 95: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

95

QUIZ: Write the integer 6 in Word 1

handout

Page 96: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

96

Convolutional coding is performed on a string of bits

arriving in real-time (e.g. digital video, digital

telephony, satellite links, reading tape and disk)

The output bit is a function of the current and

previous input bits, therefore we need memory,

i.e. sequential circuits

Convolutional Coders and Decoders

Do you recognize

this combinational

circuit?

Do you recognize

this sequential

circuit?

Page 97: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

97

Back to digital analysis: What is the output Q of this circuit?

Page 98: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Conclusion:

• The flip-flops are driven at half the frequency (i.e.

double the period) of the original CLOCK

• Two bits are output for every one bit input:

– A C from the top AND gate

– A B C from the bottom AND gate

Called (2,1)

convolutional

code

Page 99: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

99

• It is a particular (2,1) convolutional code

• It is used to convert the (weak, noisy) analog

signal from the head of a magnetic disk or tape

drive into a digital signal.

• You can find more details on PRML at the end of

Chapter 2 (Section 2A.6 - p.134).

Partial Response Maximum Likelihood

PRML

Page 100: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Fig. 3.34 + explanations on p.180

→ Read and understand the operation of the PRML

encoder!

100

Initially all FFs

store 0s (RESET)

First bit Second bit Third bit

Page 101: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Fig. 3.34 – Why are there two zeros at the beginning?

101

This is the beginning

Page 102: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

102

Continue the

analysis in Fig. 3.34

Page 103: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

103

PRML encoder characteristic table

Page 104: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

PRML encoder FSM

Moore or Mealy?

Page 105: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

105

F(1101 0010)=11 01 01 00 10 11 11 10

Starting in state 0,

the encoder receives

the bits shown (from

left to right):

PRML encoding example

Page 106: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

106

F(0100 1111) =

Use the FSM diagram

to encode:

0100 1111

(starting in state 0)

QUIZ: PRML encoding

Page 107: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

107

Decoding is achieved by inverting the inputs and

outputs of the encoder Mealy machine:

PRML decoding

Page 108: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

108

F(11 01 01 00 10 11 11 10) = 1101 0010

We can see from the

decoder FSM that, if no

errors have occurred,

the decoded sequence

matches the one

encoded in the previous

example:

PRML decoding

Page 109: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

109

F(11 01 01 10 10 11 11 10) = 110? ????

What if there are

errors?

Example:

PRML decoding

What is the state of the decoder

when this pair of bits arrives?

F(11 01 01 00 10 11 11 10) = 1101 0010

Page 110: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

110

F(1101 0010) = 11 01 01 00 10 11 11 10

The fact that there is a

limited set of possible

state transitions in the

encoding process is

crucial to the error

correcting capabilities of

PRML.

We can see from the FSM

that, starting in state 0, we

have

PRML encoding example

Page 111: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

111

F(11 01 01 10 10 11 11 10) = 110? ????

Conclusion: The error

is detected … but this is

not enough!

The decoder has to

be able to recover and

keep churning out the

bits!

PRML decoding

F(11 01 01 00 10 11 11 10) = 1101 0010

Page 112: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

112

F(11 01 01 10 10 11 11 10) = 110? ????

Solution:

Minimize the total error of the

sequence of bits that starts w/the error!

PRML decoding

F(11 01 01 00 10 11 11 10) = 1101 0010

“PR”

“ML”

Page 113: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

113

F(11 01 01 10 10 11 11 10) = 110? ????

Solution:

Minimize the total error of the

sequence of bits that starts w/the error!

PRML decoding

F(11 01 01 00 10 11 11 10) = 1101 0010

“PR”

“ML”

How long a sequence?

Page 114: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

114

How long a sequence?

From an error-correction standpoint, the longer

the better …

… but longer sequences mean:

• longer decoding delay

• heavier computational load (CPU cycles and

memory)

In this example we use a sequence of 4 pairs

PRML decoding

Page 115: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

115

F(00 10 11 11) = 1001

A more intuitive way of

understanding the

decoding process is

through a lattice,

famously known as

trellis diagram.

This is the trellis diagram

for the correct sequence

starting in state 1

Decoding PRML with Trellis diagrams

F(10 10 11 11) = ????

Page 116: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

116

This is the diagram for

the incorrect sequence

starting in state 1

In the circles we have

the accumulated

(Hamming) errors

The path of least error

outputs 1001, thus 1001 is

the string of maximum

likelihood (ML).

F(00 10 11 11) = 1001

F(10 10 11 11) = 1001

Decoding PRML with Trellis diagrams

Page 117: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

117

F(11 11 01 00 10 11 11 10) = 1??? ????

Draw the trellis

diagram and work the

ML sequence for the

error below.

(We still start from

state 0 and use a

sequence length of four

pairs)

QUIZ: Trellis decoding

Page 118: two’s - Tarleton State University...Moore vs. Mealy Moore and Mealy machines are equivalent, i.e. they can be used to implement circuits with the same behavior, but … • Moore

Homework for Ch.3

End of chapter exercises

6, 23, 37, 43, 58, 65

Due next Tuesday at the beginning of class