Docsity

Human Computer Interaction assigment 1, Assignments of Digital Electronics

Partial preview of the text

Download Human Computer Interaction assigment 1 and more Assignments Digital Electronics in PDF only on Docsity!

1

EECS 465: Digital Systems

Lecture Notes # 7

(A) Introduction to Sequential Circuits

(B) Latches and Flip-Flops

(C) Counter Design

SHANTANU DUTT

Department of Electrical and Computer Engineering

University of Illinois, Chicago

Phone: (312) 355-1314: e-mail: [email protected]

URL: http://www.eecs.uic.edu/~dutt

2

(A) Introduction to Sequential Circuits

  • Current o/p depends on the current i/p and past history of all i/ps

seen by the circuit.

Where the relevant past history should be representable by a finite

number of classes or states

No Red

Red Light

State

Reset

Encode as state=

Light = Red

O/P = 0

Light = Green

O/P = 1

Light = Not green

O/P = 0

Light = Not red

O/P = 0

Encode as

state = 1

State Transition Diagram

Design Problem: Output of the circuit is 1 only if it has seen a red

light in the past and currently light is green.

4

Components to store bits ( latches or flip flops )

Problem: can’t store

new data

Cascade of inverter

0

I/P 1/0 O/P

A

A

LD

LD

LD

LD

Will conduct when

A=1, and open when

A=

(B) Latches and Flip-Flops

5

Another storage element:

  1. Cross coupled NOR gates ( R-S latch )

R=

0

Q

1

S=

0

Q

Q

R

Q

S

Q

(Set)

(Reset)

NOR gates ( R-S latch )

Property of a NOR gate

A=

B

B

ABB

When one I/P of NOR is 0, it acts like an inverter.

When one I/P is 1, then O/P=0.

Different I/P conditions for R-S latch:

i) R=S=0, current I/P is stored indefinitely

( becomes cascade of inverters)

Hold

7

Cross-coupled NOR

R

Q

S

Q

Cross-coupled NAND

R

S

Q

Q

Hold State R=S=

Hold State R=S=

Q

Q

R=1, S=

R=0, S=

Forbidden I/Ps

From R, S = 1, 1 transit to R=0, S=

then Q, transit to 1, 0 ( correctly )

From R, S = 1, 1 transit to R=1, S=

then Q, correctly transit to 0, 1

Q

Q

Two implementations for R-S latch:

8

  1. The D-Latch

R-S

Latch

D

S

R

R 1

S 1

Q

enb

Q

Clocked Latch

(level-sensitive clock latch)

— see terminology defined

later.

D=1, S=1, R=

Q=1,

D=0, S=0, R=

Q=0,

enb=0 R 1

,S

1

=0 (hold state)

Q  0

Q  1

enb=

enb=

10

Latch classification with respect to response to “control signal”

Terminology: Note that the terminology below applies to all types of latches:

R-S, D, J-K, T, etc., though the examples are given for the R-S latch.

i) Transparent Latch: O/P responds to latch I/Ps without any enable or clock signal.

R Q

S

Q

Clock:

Fixed frequency alternating 1 and 0 signal

ii) Clocked or Level-Sensitive Latch:

Q

Q

S

Clock

or

enb

R O/P responds to I/Ps only when enb or

clock is at a pre-determined level (high

or low — In this example, it is High)

R

S

Q

Q

Symbol:

R

S

Q

Q

CLK

(high enable)

Symbol: or

R

S

Q

Q

CLK (low enable)

11

iii) Edge-Triggered Flip-Flop (FF) or simply Flip-Flop

O/P will respond to I/Ps only at either:

(a) the positive or rising edge of the enb/clock signal (positive

edge-triggered FF), or

(b) the negative or falling edge of the enb/clock signal (negative

edge-triggered FF).

Clock:

O/P response

period for a

positive

edge-

triggered

FF.

O/P response

period for a

negative

edge-triggered

FF

O/P response

period for a

HIGH-enable/clock

level-sensitive

latch

O/P resp. period for

a low-enable/clock

level sensitive latch

Symbol:

R

S

Q

Q

CLK

Symbol:

R

S

Q

Q

CLK

13

Solutions to Race Condition Problem with Level Sensitive Latches

Solution 1: Master-Slave FF:

Master-Slave J-K is a solution to race-condition problem: Any change in Q,

during CLK=0 is not propagated to P, and hence back to Q, during the

same CLK=0. Any change to Q, will occur in next CLK=0 period.

J

K

Q

Q

(O/P responds when CLK goes

From 1 to 0)

J-K

M-S

Master-Slave J-K works similar

to a J-K latch: E.g. Let

J=1, K=1, CLK=

Q=1, =0  =1 , P=

When CLK=

Q=0, =

Q

Q

Q

R-S

Latch

CLK

K

J

Q

R

S

R-S

Q m

m

Q R

S

s

Q

Q s

1

0

1

0

P

P

1

0

1

0

Master R-S is level sensitive. Slave R-S is level sensitive.

Q

Q

P (^) Q

Q

P

14

Solution 2: Edge-Triggered FF:

Q

Q

R

S

D

Clk=

D

D

0

0

Holds D when

clock goes low

Holds when

clock goes low

D

Q =D

QD

R

S

D

Clk=

D

D

D

Assume D=

D=1=S

Q=1,

D  0  R

Q  0

CLK

Q

Q

R

S

D

Clk=

D

D

0

0

Q responds to

internal S signal;

responds to

internal R signal.

Q

When CLK is 1 D I/P is

internally sampled but

does not appear at the O/P.

O/P is held (changing D does not

cause any change in internal

signals in the FF or in its output)

O/P appears (Q=D)

D

D

D

D

16

Similarly: Characteristic Equations of

2) J-K, Q

= Q + J.

3) D-FF, Q

= D

  1. Toggle FF/Latch Q

= T + Q

or T-FF / Latch

K

Q

Q

T

Whenever I/P T is high,

the FF will toggle, i.e., Q

=.

When T=0, Q

=Q.

Q

Of course, these characteristic equations come into play only

when the FF/Latch is enabled.

Q

Q

T

Symbol:

17

Excitation Table

— Reversed Truth Table

— What the inputs to FFs should be for given output

transitions (Q  Q

)

Q Q

R S J K T D

0 0 x 0 0 x 0 0

0 1 0 1 1 x 1 1

1 0 1 0 x 1 1 0

1 1 0 x x 0 0 1

19

Example 2: D  J-K

Excitation Table for D

Q Q

D

0  0 0

0  1 1

1  0 0

1  1 1

J K Q Q

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 0

Q

Q

D J

K

CLK

TT for J-K

JK

Q

0

1

00 01 11 10

0 0 1 1

1 0 0 1

Function is

Q

Q

D

CLK

J

K

Q

Q

J-K FF/Latch

DJQKQ

J Q

K Q

Logic

should work like a J-K

20

(C) Counter Design

  • A counter is a special case of an FSM that cycles through its states

on receiving triggering clock pluses.

  • It does not have any external data I/Ps.

A

B

C

D

Reset E

000

001

010

011

100

FFs

Logic

Counter O/P

Next State

bits

n n

CLK

  • The states need to be encoded by binary bits.

No external I/Ps