Docsity

Binary Up/Down Counter Design: A CSCE 491 Computer Engineering Project, Study notes of Computer Science

Toggle sidebar
bg1
2003/8/25
Fall 2003 - Lecture 7
Design Example – Binary Up/Down Counter Block
© 2003 Dr. James P. Davis
CSCE 491
CSCE 491
Computer
Computer Engr
Engr. Design Project
. Design Project
Page 2© 2002 Dr. James P. Davis
Lecture 7
Lecture 7 -
-Outline
Outline
z
Objective: To start an example to give you more insight on:
z
How to start a design model from an analysis model
z
How to think about digital systems modeling using ASM charts.
z
To explore the connection between the analysis and design activities
of Computer Engineering discipline.
z
Means:
9
The Binary Up/Down Counter example (taken from flowHDL Manual).
z
Result:
z
You should be able to create this design in flowHDL for homework.
Analysis
Architecture
& Design
Problem
Domain
Analysis
Model
(UM L )
Design
Model
(ASM)
pf3
pf4

Partial preview of the text

Download Binary Up/Down Counter Design: A CSCE 491 Computer Engineering Project and more Study notes Computer Science in PDF only on Docsity!

Fall 2003 - Lecture 7

Design Example – Binary Up/Down Counter Block

© 2003 Dr. James P. Davis

CSCE 491CSCE 491

Computer EngrComputerEngr. Design Project. Design Project

Lecture 7 - Lecture 7- OutlineOutline

z Objective: To start an example to give you more insight on:

z How to start a design model from an analysis model

z How to think about digital systems modeling using ASM charts.

z To explore the connection between the analysis and design activities

of Computer Engineering discipline.

z Means:

9 The Binary Up/Down Counter example (taken from flowHDL Manual).

z Result:

z You should be able to create this design in flowHDL for homework.

A n a ly s is

A rc h ite c tu re

& D e s ig n

P ro b le m D o m a in

A n a ly s is M o d e l (U M L )

D e s ig n M o d e l (A S M )

© 2002 Dr. James P. Davis Page 3

The Binary Up/Down Counter – The Binary Up/Down Counter– Register LevelRegister Level

z The Binary Up/Down Counter

9 This multi-mode counter

block takes an input “seed”

value, and counts up or

down from this value,

based on the direction of

count.

9 Each count cycle the

Enable pulse is set, the

Direction bit can be set to

count in one or the other

direction, and the Seed and

NoCounts values are set.

9 The counter will run for the

number of cycles indicated

by input NoCounts.

NoCounts

8

Seed

8 Direction

1

Enable

1

CountValue

8

Valid

1

Up/Down Counter Model – Up/Down Counter Model– Use Case DiagramUse Case Diagram

z Use cases and actors:

9 We have two different Use

Case models, one that is

more abstract than the

other.

9 The more abstract one is

created from the 1 st pass

analysis of the Counter, the

2 nd one is created from a

more detailed look.

Set_NoCounts

Set_Seed

Set_Direction

Set_Enable

Reset

Count_Up

Count_Down

U-D_Counter

Output_CountValue

Set_ValidFlag

" User"

Specify_Count_Up

Specify_Count_Down " Us er"

Reset

2 nd^ Pass Analysis Model. 1 st^ Pass Analysis Model.

© 2002 Dr. James P. Davis Page 7

Up/Down Counter ModelUp/Down Counter Model –– State ChartState Chart

z States:

9 We use the State Diagram

notation to get a sense of

the state behavior of a

block.

9 Here we use a Statechart

to model the state-based

behavior for the counter’s

overall function.

9 Notice that, in the 2 nd pass

analysis model, we have a

“nested” state model,

showing that out ability to

count is dependent on first

enabling the counter (to

load its values), then

clearing the enable signal.

9 Just as for the Activity

Chart, we consider State

Charts when looking at the

control flow within a single

Class (i.e., a hardware

Block or ASM Thread).

Start

Finish

Not_Activated Enabled

Enable_Cleared

Enable = '1'

Enable = '0' Enable = '1'

Enable = '0'

1 st^ Pass State Model.

Start

Finis h

Not_Activated Enabled

Enable_Cleared Enable_Cleared_St art

Count_UP Count_DN

Enable_Cleared_Finish

Enable = '1'

Enable = '0' Enable = '1'

Enable = '0'

Enable_Cleared_St art

Count_UP Count_DN

Count < NoCounts Count < NoCounts

Enable_Cleared_Finish

DirectionUp = '1' DirectionUp = '0'

2 nd Pass State Model.

Up/Down Counter Design ModelUp/Down Counter Design Model –– ASM ChartASM Chart

O This is an in-class Exercise, which we’ll discuss, and continue as Homework #2. You’ll

need to create your design model in flowHDL®, by enhancing the one I have created here.

Poll

^RES Bus_1 <- Seed Bus_2 <- Direction Bus_3 <- NoCounts Loop <- ‘0’ CountVal <- ‘0’

Enable = ‘1’

Y

N

CntControl

Loop = Bus_

Loop <- INCRNC(Loop)

N

Y

Bus_2 = ‘1’ Y N

Bus_1 <- INCRNC(Bus_1)

Bus_1 <- DECRNC(Bus_1)

Poll

CountVal <- Bus_

CLK