Ln 15 Design Examples

69
Chapter 15: Design Examples  Digital System Designs a nd Practices Using Ve rilog HDL and FPGAs @ 2008-2010, John Wiley 15-1 Chapter 15: Design Examples Department of Electronic Engineering  National Taiwan Univers ity of Scien ce and Tec hnology Prof. Ming-Bo Lin

Transcript of Ln 15 Design Examples

Page 1: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 2: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 2/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-2

Syllabus

Objectives

BusData transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter

A simple CPU design

Page 3: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 systemsUnderstand the basic operations of bus structuresUnderstand the essential operations of data transfer Understand the design principles of GPIOsUnderstand the design principles of timers

Understand the design principles of UARTsDescribe the design principles of CPUs

Page 4: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 4/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-4

Syllabus

ObjectivesBus

A µ p system architectureBus structuresBus arbitration

Data transfer General-purpose input and output

TimersUniversal asynchronous receiver and transmitter A simple CPU design

Page 5: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 6: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 6/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-6

Syllabus

ObjectivesBus

A µ p system architectureBus structuresBus arbitration

Data transfer General-purpose input and output

TimersUniversal asynchronous receiver and transmitter A simple CPU design

Page 7: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 bususing tristate buffersoften called bus for short

Multiplexer-based bus

using multiplexers

Page 8: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 9: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 examplemodule 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 busassign qout = enable ? data : {N{1'bz}};

endmodule

Page 10: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 examplemodule 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 busassign data_from_bus = receive ? qout : {N{1'bz}};assign qout = send ? data_to_bus : {N{1'bz}};endmodule

Page 11: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 12: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 12/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-12

Syllabus

ObjectivesBus

A µ p system architectureBus structuresBus arbitration

Data transfer General-purpose input and output

TimersUniversal asynchronous receiver and transmitter A simple CPU design

Page 13: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 schemesdaisy-chain arbitrationradial arbitration

Page 14: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 14/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-14

Syllabus

Objectives

BusData transfer Synchronous transfer mode

Asynchronous transfer modeGeneral-purpose input and outputTimersUniversal asynchronous receiver and transmitter A simple CPU design

Page 15: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 modessynchronous modeasynchronous mode

The actual data can be transferred in

parallel : a bundle of signals in parallelserial : a stream of bits

Page 16: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 signalBus master Bus slave

Two types

Single-clock bus cycleMultiple-clock bus cycle

Page 17: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 18: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 schemeImplicitly clocking scheme

Page 19: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 20: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 20/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-20

Syllabus

ObjectivesBusData transfer

Synchronous transfer mode

Asynchronous transfer modeGeneral-purpose input and outputTimersUniversal asynchronous receiver and transmitter A simple CPU design

Page 21: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 randomControl approaches

strobe schemehandshaking scheme

Page 22: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 22/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-22

Strobe

Page 23: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 validdata acceptanceacknowledge

h l

Page 24: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 24/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-24

Handshaking

Two typessource-initiated transfer destination-initiated transfer

Ch 15 D i E l

Page 25: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Ch t 15 D i E l

Page 26: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 27: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 27/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-27

Syllabus

ObjectivesBusData transfer General-purpose input and output

TimersUniversal asynchronous receiver and transmitter

A simple CPU design

Chapter 15: Design Examples

Page 28: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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)inputoutput

bidirectional

Chapter 15: Design Examples

Page 29: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 30: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 controlSelection the value of DDR Handshaking control

Readback capability of DDR Input latch

Input/Output pull-upDrive capability

Chapter 15: Design Examples

Page 31: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 32: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 32/69

Chapter 15: Design Examples

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-32

Syllabus

ObjectivesBusData transfer General-purpose input and output

TimersInterfaceBasic operation modes

Advanced operation modesUniversal asynchronous receiver and transmitter A simple CPU design

Chapter 15: Design Examples

Page 33: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 33/69

p g p

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-33

Timers

Important applicationstime-delay creationevent countingtime measurement

period measurement pulse-width measurementtime-of-day tracking

waveform generation periodic interrupt generation

Chapter 15: Design Examples

Page 34: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 34/69

p g p

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-34

Timers

Chapter 15: Design Examples

Page 35: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 35/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-35

Syllabus

ObjectivesBusData transfer General-purpose input and output

TimersInterfaceBasic operation modes

Universal asynchronous receiver and transmitter A simple CPU design

Chapter 15: Design Examples

Page 36: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 36/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-36

Basic Timer Operations

TimersWhat is a timer?What is a counter?What is a programmable counter?What is a programmable timer?

Basic operation modesterminal count (binary/BCD event counter)

rate generation(digital) monostable (or called one-shot)square-wave generation

Chapter 15: Design Examples

Page 37: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 37/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-37

Terminal Count

Chapter 15: Design Examples

Page 38: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 38/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-38

Rate Generation

Chapter 15: Design Examples

Page 39: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 40: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

gateclk

timer_loadgenerator

timer_enable

timer_load DCK

Q

timer is 1

Shift plus LSB

out logic

latch_load

Chapter 15: Design Examples

Page 41: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 41/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-41

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter

InterfaceBasic transmitter structure

Basic receiver structureBaud-rate generators

A simple CPU design

Chapter 15: Design Examples

Page 42: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 42/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-42

UARTs

Hardware modelthe CPU interfacethe I/O interface

Software modelreceiver data register (RDR)transmitter data register (TDR)status register (SR)

control register (CR)

Chapter 15: Design Examples

Page 43: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 43/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-43

UARTs

Chapter 15: Design Examples

Page 44: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 44/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-44

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter

InterfaceBasic transmitter structure

Basic receiver structureBaud-rate generators

A simple CPU design

Chapter 15: Design Examples

Page 45: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 45/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-45

Design Issues of UARTs

Baud rateSampling clock frequencyStop bitsParity check

Chapter 15: Design Examples

Page 46: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 46/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-46

A Transmitter of UARTs

The transmittera transmitter shift data register (TSDR)

a TDR empty flag (TE)a transmitter control circuita TDR

parity generator

Chapter 15: Design Examples

Page 47: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 48: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 48/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-48

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter

InterfaceBasic transmitter structure

Basic receiver structureBaud-rate generators

A simple CPU design

Chapter 15: Design Examples

Page 49: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 50: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 51: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 51/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-51

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter

InterfaceBasic transmitter structure

Basic receiver structureBaud-rate generators

A simple CPU design

Chapter 15: Design Examples

Page 52: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 approachesMultiplexer-based approachTimer-based approachOthers

Page 53: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 53/69

Chapter 15: Design Examples

S ll b

Page 54: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 54/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-54

Syllabus

ObjectivesBusData transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter A simple CPU design

Programming modelDatapath designControl unit design

Chapter 15: Design Examples

CPU B i O ti

Page 55: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Th S ft M d l f CPU

Page 56: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 modelInstruction formatsAddressing modesInstruction set

Chapter 15: Design Examples

The Programming Mode

Page 57: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 58: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 58/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-58

Instruction Formats

Two major partsOpcode

Operand

Chapter 15: Design Examples

Addressing Modes

Page 59: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 fetchedregister

indexedregister indirectimmediate

Chapter 15: Design Examples

The Instruction Set

Page 60: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 61: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 62: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 63: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 63/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-63

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter A simple CPU design

Programming modelDatapath designControl unit design

Chapter 15: Design Examples

A Datapath Design

Page 64: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 65: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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

Page 66: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 66/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-66

Syllabus

ObjectivesBus

Data transfer General-purpose input and outputTimersUniversal asynchronous receiver and transmitter A simple CPU design

Programming modelDatapath designControl unit design

Chapter 15: Design Examples

A Control Unit

Page 67: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 67/69

Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008-2010, John Wiley 15-67

The decoder-based approach

Page 68: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 68/69

Chapter 15: Design Examples

A Control Unit

Page 69: Ln 15 Design Examples

8/15/2019 Ln 15 Design Examples

http://slidepdf.com/reader/full/ln-15-design-examples 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 byeach instruction