3 - Modeling of Digital Systems

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Modelling of Digital Systems

Dr Cesar Ortega-Sanchez

The Design Process

Problem

Idea

Specification

Implementation

System design is the process of implementing a


desired functionality using a set of physical
components

What is a model?
Give me some definitions
Description

Formal (no
ambiguity)

Understandable

Natural

Abstraction
Blocks and
relationships
Representation

Easy to use

Complete (describes
the entire system)
Tool for designers

Simplification of
something complex

Easy to
modify

One possible definition


A model is a formal system consisting of objects
and composition rules that is used to describe the
characteristics of a system
A model is used to simplify and facilitate the
implementation of a system.

There are different kinds of models that emphasise


different aspects of a system, e.g. time response,
structure, topology, data dependencies.
Models can be used to specify, simulate, test and
validate our designs

What models do we use in electronics?

Drawings:
Plans, Schematics

What models do we use in electronics?

State machines
Moore

Mealy
11/Out5

11

10

10
11

S1
Out 1
01

10/Out2

S2
Out 2

S1

10/Out6
11/Out3

10
01

11
S3
Out 3

S3

01
01/Out4

S2

What models do we use in electronics?

Equations

What models do we use in electronics?

Graphs

What models do we use in electronics?

Programs

What models do we use in electronics?

Virtual machines

Lets organise these models


A good engineer must know different ways to describe
a system and be able to choose the one that best suits
a particular solution.
Sometimes it is better to go from the general (little
detail) to the particular (lots of detail). Top-Down
approach.
Sometimes it is better to concentrate first on the
algorithm and later on the implementation. (Bottom-Up
approach)
Different problems call for different approaches.
The only way to be good at choosing the best
methodology is by doing it! Practice, practice, practice.

Models in Electronics

Models can be classified according to the amount


of implementation detail they provide.

The main classification is between

Behavioural and Structural Models

Behavioural Models
Behavioural models give little detail and concentrate
more on the overall function of the system.
Consist of code that represents the behaviour of the
HW without respect to its actual implementation.
Dont include timing numbers.
Behavioural models can be

Algorithmic and Architectural

Behavioural Algorithmic Models


Represent data manipulation.
No HW implementation is
implied.
Similar to SW Eng programs.
Extensive use of Hardware
Description Languages (HDL).
Coded to be fast, efficient and
mathematically correct.
Can be simulated to test that
the basic specification of the
design is correct.

-- Multiplier for two unsigned numbers


Process (a , b)
begin
product <= a * b;
End process;

Behavioural Architectural Models


Represent the blocks that implement the algorithm.
Blocks give no detail of how their function is
implemented.
Can be compared to an algorithmic model of the
same circuit to discover if a chips architecture is
correctly implementing the algorithm.
a
Multiply
b

product

Structural Models
Give details of the actual
HW implementation.
Consist of objects that
represent specific pieces of
hardware.
Can take the form of
schematic diagrams or HDL
programs.
Can give details at Register
Transfer Level (RTL), Gate
Level or Switch Level.

// Multiplier for two unsigned numbers

always @(posedge clk) begin


if (multiply_en == 1) begin
count <= ~0;
product <= 0;
end
if (count) begin

if (b[count]) begin
product <= (product << 1) + a;
end
else begin
product <= product << 1;
end

count <= count - 1;


end
end

Pseudo code

Summarising

Algorithmic
According to
the level of
implementation
detail they
provide models
can be

Behavioural
Architectural

Register Transfer Level


Structural

Gate level
Switch level

Models and architectures


A model specifies the functionality of a system at any
level of detail required, but does not describe exactly
how that system is to be implemented.
An architecture defines the system implementation by
specifying the number and types of components as well
as the connections between them.
In summary: Models describe how a system works,
while architectures describe how it will be manufactured.

Model: Finite-State Machines (FSM)


Consists of a set of states, a set of transitions and a set of
actions associated with these states or transitions
Transition
State 1

State 2

Action 1

Action 2
Transition

Most popular for describing sequential systems because its


temporal behaviour is naturally represented in this form.

Controller Architecture
Is a straightforward implementation of the FSM model.

Consists of a register and two combinational blocks.


Well-suited to implement controllers that do not require
data manipulation.

Clock

Inputs

Next
state
logic

State
Register

State signals

Output
logic

Outputs

Model: Dataflow Graphs

x a b
2

b
t1

square

square

t3

This model is good for


describing computational
intensive systems (DSP
components and systems).

t4

Not suitable for representing


the control part of
programming languages.

t2
add

sqrt

Mathematical equations can


be naturally represented by
nodes representing operations
and arcs representing the
order in which the nodes are
executed.

Dataflow Graphs
Asynchrony principle: All operations are executed
when and only when the required operands are
available.
Functionality principle: All operations behave as
functions which do not have any side effects, i.e.
any two operations can be executed in either order
or concurrently.
Real systems usually feature control and
computation, hence dataflow graphs are combined
with FSM to represent them.

Datapath Architecture
Can be used for implementing DFGs.
Useful when a fixed computation must be performed
repeatedly on different sets of data (DSP systems).
Consists of high-speed arithmetic units, connected in
parallel and heavily pipelined in order to achieve a high
throughput.
A computation is divided into pipeline stages of equal
length and the values between the stages are stored in
registers controlled by a common clock.

Examples of Datapath Architecture

y(i) k 0 x(i k )b(k )


N 1

FIR filter
For N = 4

x(i)

x(i-1)
b(0)

x(i-2)
b(1)

b(2)

*
+

x(i-3)
b(3)

*
registers

+
y(i)

*
+

Pipeline
stages

Examples of Datapath Architecture

y(i) k 0 x(i k )b(k )


N 1

FIR filter
x(i)

x(i-1)
b(0)

x(i-2)
b(1)

x(i-3)
b(2)

b(3)

Question:

Pipeline stages

y(i)

What are the


advantages and
disadvantages
of each
architecture?

Model: Programming Languages

Provide an heterogeneous model that can support


data, activity and control modeling.
Are presented in a textual, rather than a graphic, form.
Two major types of programming languages:
Imperative and Declarative.

Imperative Programming Languages


Use a control-driven model of execution in which
statements are executed in the order written in the
program.
Provide a variety of data structures: Basic and
composite data types.
Model small activities by means of statements and
large activities by means of functions or procedures.
Use control constructs that specify the order in which
activities are to be performed: sequential, branching,
looping and subroutine calls.
Examples: C, Pascal

Declarative Programming Languages


Model execution through demand-driven or patterndriven computation.
Specify no explicit order of execution, focusing instead
on defining the target of the computation through a set
of functions or logic rules.
Examples: Lisp, Prolog
(defun factorial (n)
(if (<= n 1)
1
(* n (factorial (- n 1)))
)
)

In real life
We design using a top-down approach starting with a
general view of the system (block diagram) and going
down to the details.

Hence, depending on the stage we are, we will need to


use more than one model or a combination of models to
solve engineering problems. For example:
FSM + DFG for systems performing control and
computation.
FSM + Programs for systems with concurrent programs.

Computer System Engineering 302


Electronic Design 302
Dr. Cesar Ortega-Sanchez

Suggested Activities
Think of your own definitions for model and architecture
and be ready to defend them.

Think about the convenience of making a clear distinction


between models and architectures.
What sort of models and architectures would you use
during the development of:
The control for a vending machine
The electronic systems in an automobile

The transactions data base of a bank

You might also like