lecture 5 - jyväskylän yliopistousers.jyu.fi/~loberg/fyse420slides/fyse420lecture5.pdf · lecture...

26
FYSE420 DIGITAL ELECTRONICS Lecture 5 1

Upload: others

Post on 19-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

FYSE420 DIGITAL ELECTRONICS

Lecture 5

1

Page 2: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

DIGITAL LOGIC

CIRCUIT ANALYSIS

& DESIGN Nelson, Nagle, Irvin, Carrol

ISBN 0-13-463894-8

DIGITAL DESIGN Morris Mano

Fourth edition

ISBN 0-13-198924-3

Digital Design Principles and Practices

Fourth edition

Wakerly John F.

ISBN 0-13-186389-4

[1]

[2]

[3]

2

Page 3: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

State assignment

Circuit with m states Binary code contains n bits, where 2n ≥ m

Binary Code

Cray Code (unit distance code)

One-Hot (One Flip-Flop for each state)

Synchronous Sequential Logic Synthesis

3

Sequential logic has external reset input

Circuit enters to the starting state.

All flip-flops are reset or set to the 0 or 1 respectively.

©Loberg

Page 4: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

4

One Hot

One-Hot assignment are used mostly in register-rich field-programmable gate arrays.

Circuit with m states has m state variable flip-flops (D flip-flop).

Only one flip-flop is set in each time.

Synchronous Sequential Logic

State assignment Synthesis

©Loberg

Page 5: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

Simpler decoding logic (exitation functions) Faster sequential logic usually

a 000 000 00001

b 001 001 00010

c 010 011 00100

d 011 010 01000

e 100 110 10000

State Binary Gray One-hot

Possible binary state assignments

Large number of unused binary combinations

Synchronous Sequential Logic Synthesis State assignment

5

One Hot

©Loberg

Page 6: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

First state D flip-flop is set (1) and others reset (0).

Used with computer aided design softwares.

Synthesis State assignment

6

Synchronous Sequential Logic

One Hot

11

S3 S4

S2

S1

X1X2=10

00

01

11

01 00

00

Part of the state diagram

©Loberg

Page 7: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

An example of manually designed

One-Hot State Machine

State 3 (S3) D Flip-Flop

11

S3 S4

S2

S1

X1X2=10

00

01 11

01 00

00

Part of the state diagram

D Q

C

R

X1

X1

X2

X2

S2

X1

X2

S1

X1

X2

S4

X1

X2

S3

-1- tilassa poistuttaessa S3-tilalta

-0- tilassa poistuttaessa

S3-tilalta

-0- poistuttaessa tilalta S3

-1- saavuttaessa tilalle S3

Tilalta S3

poistumisfunktiot

Tilalle S3

saapumisfunktiot

Exitation function

Synthesis State assignment

7

Synchronous Sequential Logic

One Hot

©Loberg

Page 8: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

The first state register

First state S0 Power up

Reset

D Q

C

R

Exitation

function

Global reset

S0

Synthesis State assignment

An example of manually designed

One-Hot State Machine

8

Synchronous Sequential Logic

One Hot

©Loberg

Page 9: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

Circuit has one synchronous output : DTACK*

Circuit has one synchronized input : DR*

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1

State diagram of the circuit

Block diagram of the circuit

Variables for

Exitation

functions

a

b

c

d

DTACK*

Clock

DDTACK

Synthesis State assignment

An example of manually designed

One-Hot State Machine

9

Synchronous Sequential Logic

One Hot

©Loberg

Page 10: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1

State diagram of the circuit

a b,1 a,1

c,0 a,1

d,1 d,1

d,1 a,1

b

c

d

DR* 0 1

State table

b

c

d

a b c

X

b,d a,d

b,d

X

X a,d

x x

x x

Implication table

Four states : a, b, c and d

One-Hot Assignment :

a 1 0 0 0

b 0 1 0 0

c 0 0 1 0

d 0 0 0 1

State Qa Qb Qc Qd

Synthesis State assignment

An example of manually designed

One-Hot State Machine

10

Synchronous Sequential Logic

One Hot

©Loberg

Page 11: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1

One-Hot Assignment

a 1 0 0 0

b 0 1 0 0

c 0 0 1 0

d 0 0 0 1

State Qa Qb Qc Qd

a 1 0 0 0

a 1 0 0 0

b 0 1 0 0

b 0 1 0 0

c 0 0 1 0

c 0 0 1 0

d 0 0 0 1

d 0 0 0 1

State Qa Qb Qc Qd

b 0 1 0 0

a 1 0 0 0

c 0 0 1 0

a 1 0 0 0

d 0 0 0 1

d 0 0 0 1

d 0 0 0 1

a 1 0 0 0

State Qa Qb Qc Qd

Present time t Next time (t+1)

0

1

0

1

0

1

0

1

DR* DTACK*

1

1

0

1

1

1

1

1

(t+1)

State table

During a proper operation there is no unused state

variable combinations, only states: a, b, c and d.

*** DRbDRbDDTACK

Synthesis State assignment

An example of manually designed

One-Hot State Machine

11

Synchronous Sequential Logic

One Hot

©Loberg

Page 12: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0

0

1 0

1

D Q

C

R

Qb

a

DR*

D Q

C

R

Qb

DR*

DR*

a

DR*

Always at high (-1-)

Always at

low (-0-)

0

Simplified circuit

diagram

Exitation function of the

state flip-flop b

*DRaDb

Synthesis State assignment

An example of manually designed

One-Hot State Machine

12

Synchronous Sequential Logic

One Hot

©Loberg

Page 13: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1

Always -1-

D Q

C

R

Qc

DR*

DR* Always -0-

0

b DR*

D Q

C

R

Qc b DR*

Simplified circuit

diagram

Exitation function of the

state flip-flop c

*DRbDc

Synthesis State assignment

An example of manually designed

One-Hot State Machine

13

Synchronous Sequential Logic

One Hot

©Loberg

Page 14: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1

D Q

C

R

Qd c

DR*

DR*

c DR*

Exitation function of the

state flip-flop d

Simplified circuit

diagram

D Q

C

R

Qd c

DR*

cDRQD dd *

Synthesis State assignment

An example of manually designed

One-Hot State Machine

14

Synchronous Sequential Logic

One Hot

©Loberg

Page 15: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

a/1

b/1 d/1

c/0

DR*=1

0

1

0 0

1 0

1 D Q

C

R

Qa d

DR*

DR*

b DR*

Exitation function of the

state flip-flop a

*** DRbDRdDRQD aa

Synthesis State assignment

An example of manually designed

One-Hot State Machine

15

Synchronous Sequential Logic

One Hot

©Loberg

Page 16: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

Qa d b Qb a Qc

b

Qd

c

DR*

Clock

Reset*

DTACK*

P R R R R

Synthesis State assignment

An example of manually designed One-Hot State Machine

16

Synchronous Sequential Logic

One Hot

©Loberg

Page 17: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

An example of manual design of Registered-Output FSM

ER*

DR1*

DTACK*

DR* Parity error OK OK

Timing diagram of the

data transfer cycle.

D0-D7

Reg Parity

Parity bit

DR1*

ER*

DTACK*

D0-D7

FSM

Receiver

ADC

Sender

DR*

DTK*

Synthesis

17

Synchronous Sequential Logic

©Loberg

Page 18: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

Inputs: DR* (DR)

DTACK* (DT)

ER* (ER)

Outputs: DR1*

state

DR1*

DR,DT,ER

a

1

b

1 c

0

d

1

e

1

111

111

011 011

011

011

011

DR,DT,ER=111

001

001

101

010

010

State diagram

Wait until DR* = 1

and DTACK* = 1

Wait until

ER* = 1

An example of manual design of Registered-Output FSM

18

Synchronous Sequential Logic

Synthesis

©Loberg

Page 19: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

011 100 101 110 111 001 010 000

a

b

c

d

e

a,1

a,1

d,1

b,1

a,1 d,1

c,0

e,1

c,0

c,0

d,1

d,1 e,1

DR,DT,ER

state

STATE,DR1*

X

X

X

X X

X x

b,d

b

c

d

e

a b c d

Implication table

State table

Compatible pairs : (a) (d) (b,c,e)

A B C

011 100 101 110 111 001 010 000

A

B

C

A,1

A,1 C,1

B,1

C,0 B,1 C,1

DR,DT,ER

state

STATE,DR1*

B,1

A,1

B,1

An example of manual design of Registered-Output FSM

19

Synchronous Sequential Logic

Synthesis

©Loberg

Page 20: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

State table

State assignment

A 00

B 01

C 11

State y1 y0

state 011 100 101 110 111 001 010 000

A

B

C

A,1

A,1 C,1

B,1

C,0 B,1 C,1

DR,DT,ER

STATE,DR1*

B,1

A,1

B,1

011 100 101 110 111 001 010 000

00

01

11

00,1

00,1 11,1

01,1

11,0 01,1 11,1

DR,DT,ER

y1y0

Y1Y0,DR1*

01,1

00,1

01,1

Transition table

An example of manual design of Registered-Output FSM

20

Synchronous Sequential Logic

Synthesis

©Loberg

Page 21: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

011 100 101 110 111 001 010 000

00

01

11

00,1

00,1 11,1

01,1

11,0 01,1 11,1

DR,DT,ER

y1y0

Y1Y0,DR1*

01,1

00,1

01,1

Transition table

K-maps of the Y0

DT,ER

y0,DR

00

00 01 11 10

01

11

10

y1=1

1

0

1 1

DT,ER

y0,DR

00

00 01 11 10

01

11

10

y1=0

1

0

1 0

1 1

DRDTY 0

An example of manual design of Registered-Output FSM

21

Synchronous Sequential Logic

Synthesis

©Loberg

Page 22: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

011 100 101 110 111 001 010 000

00

01

11

00,1

00,1 11,1

01,1

11,0 01,1 11,1

DR,DT,ER

y1y0

Y1Y0,DR1*

01,1

00,1

01,1

K-maps of the Y1

DT,ER

y0,DR

00

00 01 11 10

01

11

10

y1=1

1

0

0 1

DT,ER

y0,DR

00

00 01 11 10

01

11

10

y1=0

1

0

0 0

0 0

Transition table

An example of manual design of Registered-Output FSM

DTDRyERDRyY 10122

Synchronous Sequential Logic

Synthesis

©Loberg

Page 23: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

011 100 101 110 111 001 010 000

00

01

11

00,1

00,1 11,1

01,1

11,0 01,1 11,1

DR,DT,ER

y1y0

Y1Y0,DR1*

01,1

00,1

01,1

Transition table DT,ER

y0,DR

00

00 01 11 10

01

11

10

y1=1

1

1

1 0

y1=0

1

1

1 1

1 1

DT,ER

y0,DR

00

00 01 11 10

01

11

10

An example of manual design of Registered-Output FSM

1*1 yERDRDTDR 23

Synchronous Sequential Logic

Synthesis

©Loberg

Page 24: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

CLR

C

Q D

CLR C

Q D

CLR C

Q D

Y0

Y1

DR*

DTACK*

ER*

CLOCK

DR1*

RESET

Circuit diagram

An example of manual design Registered-Output FSM

Assumption: all control

inputs are

synchronized

24

Synchronous Sequential Logic

Synthesis

©Loberg

Page 25: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

clock

reset

DR*

DTACK*

ER*

DR1*

a b c e e e c d d a

Timing diagram of the

data transfer cycle.

An example of manual design of Registered-Output FSM

25

Synchronous Sequential Logic

Synthesis

©Loberg

Page 26: Lecture 5 - Jyväskylän yliopistousers.jyu.fi/~loberg/FYSE420slides/FYSE420LECTURE5.pdf · Lecture 5 1 . DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Nelson, Nagle, Irvin, Carrol ISBN

The End

26

Synchronous Sequential Logic

©Loberg