Top Banner
ELCT 501: Digital System Design Lecture 8: System Design Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering
24

ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Mar 31, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

ELCT 501:

Digital System Design

Lecture 8: System Design

Dr. Mohamed Abd El Ghany,

Department of Electronics and Electrical Engineering

Page 2: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Algorithmic State Machine (ASM)

2Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

For large machines, the designers often use

a different form of representation, called the

algorithmic state machine chart.

An ASM chart is a type of flowchart that can

be used to represent the state transitions

and generated outputs for an FSM.

Page 3: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Elements used in ASM Charts

3Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Output

signals or

actions

(Moore type)

Condition

expression

Conditional outputs or

actions (Mealy type)

State name

0 (false) 1 (true)

State box Decision box

Conditional output box

Page 4: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

From FSM to ASM chart

4Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

A

Reset

w0

1B

w0

1

Z

C

w0 1

Page 5: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

From FSM to ASM chart

5Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

A

Reset

w0

1B

w0 1

z

Page 6: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Design Example

6Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Design A Bit-Counting Circuit to count the

number of bits in a register

B = 0;

While A ≠ 0 do

if a0 = 1 then

B= B+1;

end if;

Right-shift A;

End while;

Pseudo-

code for

the bit

counter

Page 7: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

ASM chart for the

pseudo-code

7Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

B = 0;

While A ≠ 0 do

if a0 = 1 then

B= B+1;

end if;

Right-shift A;

End while;

B <- 0

S1

Reset

s0

1

S2

A=0?

0

1

Shift right A

Load A

a00

B<-B+1

Done

s

1

1

0

S3

Page 8: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Datapath for the ASM chart

8Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Shift register

Data

Counter

Clock

L

E

w

L

E

0

log2nn

log2n

LB

EB

0

LA

EA

A

n

B

a0z

Page 9: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

ASM chart for the

control circuit

9Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

LB

S1

Reset

s0

1

S2

z

0

1

EA

a00

EB

Done

s

1

1

0

S3

Page 10: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the bit-

counting circuit

10Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 1

Page 11: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the bit-

counting circuit

11Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 2

Page 12: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the bit-

counting circuit

12Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 3

Page 13: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the bit-

counting circuit

13Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 4

Page 14: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Design Example

14Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Design a shift-and-add multiplier

Decimal

13

x 11

-----------

13

13

-----------

143Manual

method

Binary

1101

x 1011

--------------

1101

1101

0000

1101

---------------

10001111

Page 15: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Design Example

15Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Design a shift-and-add multiplier

P = 0;

For i =0 to n-1 do

if bi = 1 then

P= P+A;

end if;

Left-shift A;

End For;

Pseudo-

code

Binary

1101

x 1011

--------------

1101

1101

0000

1101

---------------

10001111

Page 16: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

ASM chart for the

multiplier

16Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

P <- 0

S1

Reset

s0

1

S2

B=0?

0

1

Shift left A,

Shift right B

Load A

Load B

b00

P<-P+A

Done

s

1

1

0

S3

Binary

1101

x 1011

--------------

1101

1101

0000

1101

---------------

10001111

Page 17: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Datapath circuit for the multiplier

17Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Shift- left

register

Data A

Clock

L

E

n

LA

EA

B

n

b0z

Shift-right

register

Data B

L

E

n

LB

EB

n

0

+

2nA

sum 2n 2n

0

1 0Psel

registerEEP

2n

P

2nDataP

Page 18: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

ASM chart for the

multiplier control circuit

18Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Psel=0, EP

S1

Reset

s0

1

S2

z

0

1

Psel=1,

EA, EB

b00

EP

Done

s

1

1

0

S3

Page 19: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the

multiplier circuit

19Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 1

Page 20: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the

multiplier circuit

20Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 2

Page 21: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the

multiplier circuit

21Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 3

Page 22: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

VHDL for the

multiplier circuit

22Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Part 4

Page 23: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Clock Synchronization

23Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Clock

enable

circuit

clock

Dat

a D Q

Q’E

Clock Skew: If the circuit of clock enable is used,

then the flip-flops without the enable

input will observe changes in the

clock signal slightly earlier than the

flip-flops that have the enable input.

This situation , in which the clock

signal arrives at different times at

different flip-flops, is known as clock

skew.

Similar problems arise in a chip in

which the clock signal is distributed

to different flip-flops by wires whose

lengths vary appreciably.

Page 24: ELCT 501: Digital System Design - German …eee.guc.edu.eg/Courses/Electronics/ELCT501 Digital System...Elements used in ASM Charts Dr. Mohamed Abd el Ghany 3 Department of Electronics

Clock Synchronization

24Dr. Mohamed Abd el Ghany

Department of Electronics and Electrical Engineering

ELCT 501: Digital System

Design

Clock Skew: For proper operation of

synchronous sequential

circuits, it is essential to

minimize the clock skew as

much as possible.

The clock signal is

distributed to the flip-flops

such that the length of wire

between each flip-flop and

clock source is the same.

An H tree clock

distribution network