7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 1/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-1
Chapter 15: Design Examples
Department of Electronic Engineering National Taiwan University of Science and Technology
Prof. Ming-Bo Lin
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 2/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-2
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 3/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-3
Objectives
After completing this chapter, you will be able to:
Describe basic structures of µP systems
Understand the basic operations of bus structures
Understand the essential operations of data transfer
Understand the design principles of GPIOs
Understand the design principles of timers
Understand the design principles of UARTs Describe the design principles of CPUs
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 4/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-4
Syllabus
Objectives
Bus
A µ p system architecture
Bus structures
Bus arbitration
Data transfer
General-purpose input and output
Timers Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 5/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-5
A Basic µP System
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 6/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-6
Syllabus
Objectives
Bus
A µ p system architecture
Bus structures
Bus arbitration
Data transfer
General-purpose input and output
Timers Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 7/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-7
Bus Structures
Tristate bus
using tristate buffers
often called bus for short
Multiplexer-based bus
using multiplexers
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 8/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-8
A Tristate Bus
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 9/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-9
A Tristate Bus Example
// a tristate bus example
module tristate_bus (data, enable, qout);
parameter N = 2; // define bus widthinput enable;
input [N-1:0] data;
output [N-1:0] qout;
wire [N-1:0] qout;
// the body of tristate bus
assign qout = enable ? data : {N{1'bz}};
endmodule
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 10/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-10
A Bidirectional Bus Example
// a bidirectional bus example
module bidirectional_bus (data_to_bus, send, receive, data_from_bus, qout);
parameter N = 2; // define bus width
input send, receive;input [N-1:0] data_to_bus;
output [N-1:0] data_from_bus;
inout [N-1:0] qout; // bidirectional bus
wire [N-1:0] qout, data_from_bus;// the body of tristate bus
assign data_from_bus = receive ? qout : {N{1'bz}};
assign qout = send ? data_to_bus : {N{1'bz}};
endmodule
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 11/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-11
A Multiplexer-Based Bus
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 12/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-12
Syllabus
Objectives
Bus
A µ p system architecture
Bus structures
Bus arbitration
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 13/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-13
Daisy-Chain Arbitration
Types of bus arbitration schemes
daisy-chain arbitration
radial arbitration
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 14/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-14
Syllabus
Objectives
Bus
Data transfer
Synchronous transfer mode
Asynchronous transfer mode
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 15/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-15
Data Transfer Modes
Data transfer modes
synchronous mode
asynchronous mode
The actual data can be transferred in
parallel: a bundle of signals in parallel serial: a stream of bits
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 16/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-16
Synchronously Parallel Data Transfers
Each data transfer is synchronous with clock signal
Bus master
Bus slave
Two types
Single-clock bus cycle Multiple-clock bus cycle
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 17/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-17
Synchronously Parallel Data Transfers
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 18/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-18
Synchronously Serial Data Transfers
Explicitly clocking scheme
Implicitly clocking scheme
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 19/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-19
Synchronously Serial Data Transfers
Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 20/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-20
Syllabus
Objectives
Bus
Data transfer
Synchronous transfer mode
Asynchronous transfer mode
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 21/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-21
Asynchronous Data Transfers
Each data transfer occurs at random
Control approaches
strobe scheme
handshaking scheme
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 22/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-22
Strobe
Ch 15 D E l
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 23/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-23
Handshaking
Four events are proceeded in a cycle order
ready (request)
data valid
data acceptance
acknowledge
Ch t 15 D i E l
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 24/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-24
Handshaking
Two types
source-initiated transfer
destination-initiated transfer
Ch t 15 D i E l
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 25/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-25
Asynchronously Serial Data Transfers
Transmitter
Receiver
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 26/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-26
Asynchronously Serial Data Transfers
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 27/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-27
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 28/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-28
General-Purpose Input and Output Devices
The general-purpose input and output (GPIO)
input
output
bidirectional
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 29/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-29
General-Purpose Input and Output Devices
An example of 8-bit GPIO
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 30/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-30
Design Issues of GPIO Devices
Readback capability of PORT register
Group or individual bit control
Selection the value of DDR
Handshaking control
Readback capability of DDR
Input latch
Input/Output pull-up
Drive capability
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 31/69
Chapter 15: Design Examples
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-31
General-Purpose Input and Output Devices
The ith-bit of two GPIO examples
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 32/69
p g p
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-32
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers Interface
Basic operation modes
Advanced operation modes
Universal asynchronous receiver and transmitter
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 33/69
p g p
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-33
Timers
Important applications
time-delay creation
event counting
time measurement
period measurement
pulse-width measurement
time-of-day tracking
waveform generation
periodic interrupt generation
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 34/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-34
Timers
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 35/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-35
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers Interface
Basic operation modes
Universal asynchronous receiver and transmitter
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 36/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-36
Basic Timer Operations
Timers
What is a timer?
What is a counter?
What is a programmable counter?
What is a programmable timer?
Basic operation modes
terminal count (binary/BCD event counter)
rate generation (digital) monostable (or called one-shot)
square-wave generation
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 37/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-37
Terminal Count
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 38/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-38
Rate Generation
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 39/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-39
Retriggerable Monostable (One-Shot) Operation
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 40/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-40
Square-Wave Generation
(b) Block diagram of square-wave mode
(a) A waveform example of square-wave mode
clk
out
3 2 1 0(4)0(4)3 2 14
Latch register = 4
Latch
timer
Data buswr
rd
out
gate
clk
timer_loadgenerator
timer_enable
timer_load D
CK
Q
timer is 1
Shift plus LSB
out logic
latch_load
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 41/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-41
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
Interface
Basic transmitter structure
Basic receiver structure
Baud-rate generators
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 42/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-42
UARTs
Hardware model
the CPU interface
the I/O interface
Software model
receiver data register (RDR)
transmitter data register (TDR)
status register (SR)
control register (CR)
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 43/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-43
UARTs
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 44/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-44
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
Interface
Basic transmitter structure
Basic receiver structure Baud-rate generators
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 45/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-45
Design Issues of UARTs
Baud rate
Sampling clock frequency
Stop bits
Parity check
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 46/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-46
A Transmitter of UARTs
The transmitter
a transmitter shift data register (TSDR)
a TDR empty flag (TE) a transmitter control circuit
a TDR
parity generator
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 47/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-47
A Transmitter of UARTs
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 48/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-48
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
Interface
Basic transmitter structure
Basic receiver structure Baud-rate generators
A simple CPU design
Chapter 15: Design Examples
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 49/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-49
A Receiver of UARTs
The receiver
a RDR
a receiver shift data register (RSDR)
a status register
a receiver control circuit
Chapter 15: Design Examples
A i f A
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 50/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-50
A Receiver of UARTs
Chapter 15: Design Examples
S ll b
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 51/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-51
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
Interface
Basic transmitter structure
Basic receiver structure Baud-rate generators
A simple CPU design
Chapter 15: Design Examples
B d R t G t
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 52/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-52
Baud-Rate Generators
The baud-rate generator
provides TxC and RxC
Design approaches
Multiplexer-based approach
Timer-based approach
Others
Chapter 15: Design Examples
B d R t G t
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 53/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-53
Baud-Rate Generators
Chapter 15: Design Examples
S ll b
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 54/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-54
Syllabus
Objectives
Bus
Data transfer
General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
Programming model Datapath design
Control unit design
Chapter 15: Design Examples
CPU Basic Operations
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 55/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-55
CPU Basic Operations
Chapter 15: Design Examples
The Software Model of CPU
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 56/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-56
The Software Model of CPU
The programming model
Instruction formats
Addressing modes
Instruction set
Chapter 15: Design Examples
The Programming Mode
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 57/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-57
The Programming Mode
Chapter 15: Design Examples
Instruction Formats
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 58/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-58
Instruction Formats
Two major parts
Opcode
Operand
Chapter 15: Design Examples
Addressing Modes
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 59/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-59
Addressing Modes
The ways that operands are fetched
register
indexed register indirect
immediate
Chapter 15: Design Examples
The Instruction Set
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 60/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-60
The Instruction Set
Double-operand instruction set
Chapter 15: Design Examples
The Instruction Set
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 61/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-61
The Instruction Set
Single-operand instruction set
Chapter 15: Design Examples
The Instruction Set
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 62/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-62
The Instruction Set
Jump instruction set
Chapter 15: Design Examples
Syllabus
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 63/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-63
Syllabus
Objectives
Bus
Data transfer General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
Programming model
Datapath design
Control unit design
Chapter 15: Design Examples
A Datapath Design
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 64/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-64
A Datapath Design
Chapter 15: Design Examples
ALU Functions
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 65/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-65
ALU Functions
Chapter 15: Design Examples
Syllabus
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 66/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-66
y
Objectives
Bus
Data transfer General-purpose input and output
Timers
Universal asynchronous receiver and transmitter
A simple CPU design
Programming model
Datapath design
Control unit design
Chapter 15: Design Examples
A Control Unit
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 67/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-67
The decoder-based approach
Chapter 15: Design Examples
A Control Unit
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 68/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-68
A better approach
Chapter 15: Design Examples
A Control Unit
7/15/2019 Design Examples-Digital System Designs and Practices Using Verilog HDL and FPGAs
http://slidepdf.com/reader/full/design-examples-digital-system-designs-and-practices-using-verilog-hdl-and 69/69
Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-69
The operations of T3 and T4 are determined separately by
each instruction