Upload
ahmad-shdifat
View
364
Download
12
Embed Size (px)
Citation preview
7/31/2019 Verilog Basics 9 FSMD Basics and Example
1/26
1
Digital System Design
Verilog: FSMD Concepts and Example
Dr. Bassam Jamil
7/31/2019 Verilog Basics 9 FSMD Basics and Example
2/26
2
FSMD
FSMD is Finite State Machine (FSM) withdatapath
Datapath is computational blocks
Adders/Subtractors
Shifters/Rotators
Multipliers
Dividers
etc
7/31/2019 Verilog Basics 9 FSMD Basics and Example
3/26
3
FSDM
In the design process, start first with algorithm inhigh level language
Then convert the algorithm to FSDM
Sometimes, a behavioral model substitute FSDM\
Then Implement the design in Verilog
7/31/2019 Verilog Basics 9 FSMD Basics and Example
4/26
4444
Example
We will consider two implementations of GCD
Both are correct Just learn how different approaches lead to different
implementations.
First Implementation uses state diagrams
Second implementations start with behavioralmodel
Now to the FIRST IMPLEMTATION
7/31/2019 Verilog Basics 9 FSMD Basics and Example
5/26
5
Greatest Common Divisor (GCD)
Inputs :
ld : load m and n : numbers
Output
gcd: great common divisor result
done: operation is complete
7/31/2019 Verilog Basics 9 FSMD Basics and Example
6/26
6
GCD Example: FSM and Datapath
7/31/2019 Verilog Basics 9 FSMD Basics and Example
7/267
GCD Example: FSM and Datapath
7/31/2019 Verilog Basics 9 FSMD Basics and Example
8/268
CGD Example: I/O and State
7/31/2019 Verilog Basics 9 FSMD Basics and Example
9/269
GCD Example: Single-case Design
end
7/31/2019 Verilog Basics 9 FSMD Basics and Example
10/2610
GCD Design
SECOND IMPLEMETNATION
7/31/2019 Verilog Basics 9 FSMD Basics and Example
11/2611
GCD In C
7/31/2019 Verilog Basics 9 FSMD Basics and Example
12/2612
Behavioral Model for GCD
7/31/2019 Verilog Basics 9 FSMD Basics and Example
13/2613
Testing Behavioral Model
7/31/2019 Verilog Basics 9 FSMD Basics and Example
14/2614
Deriving RTL
7/31/2019 Verilog Basics 9 FSMD Basics and Example
15/2615
RTL Design- Step 1: Define Port Interface
7/31/2019 Verilog Basics 9 FSMD Basics and Example
16/2616
RTL Design- Step 2: Define DatapathFunctional Units
7/31/2019 Verilog Basics 9 FSMD Basics and Example
17/2617
RTL Design- Step 2: Define Control Unit
7/31/2019 Verilog Basics 9 FSMD Basics and Example
18/2618
Datapath Module Interface
7/31/2019 Verilog Basics 9 FSMD Basics and Example
19/2619
Connect The Modules
7/31/2019 Verilog Basics 9 FSMD Basics and Example
20/2620
Connect the Modules
7/31/2019 Verilog Basics 9 FSMD Basics and Example
21/2621
Control Block
7/31/2019 Verilog Basics 9 FSMD Basics and Example
22/26
22
Control Unit: FSM Implementation
7/31/2019 Verilog Basics 9 FSMD Basics and Example
23/26
23
FSM Implementation
7/31/2019 Verilog Basics 9 FSMD Basics and Example
24/26
24
FSM Implementation: Outputs
7/31/2019 Verilog Basics 9 FSMD Basics and Example
25/26
25
Testing: Design the Testbench
7/31/2019 Verilog Basics 9 FSMD Basics and Example
26/26
Testing: Checking the RTL