+ All Categories
Home > Documents > Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language...

Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language...

Date post: 22-Mar-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
65
Programmable Programmable Logic Logic Design Design Grzegorz Budzy Grzegorz Budzy ń ń L L ecture ecture 6: 6: Combinational Combinational & & sequential sequential circuits circuits
Transcript
Page 1: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

ProgrammableProgrammable LogicLogic DesignDesign

Grzegorz BudzyGrzegorz Budzyńń

LLectureecture 6:6:Combinational Combinational & & sequentialsequential circuitscircuits

Page 2: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Plan

• Complex types and types conversion

• Resolution functions

• Combinational circuits

• Statements examples

• Simple sequential circuits

• Regular sequential circuits

Page 3: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Complex types and types

conversion

Page 4: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Types and subtypes

• Number of types available in VHDL is very limited

• It is possible and common to construct usable data subtypes

• There are a few methods of doing so:– 1) limiting the range of the basic data type

Page 5: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Types and subtypes

– 2) making a new data type with limited range of thebasic data type

Page 6: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Types and subtypes

– 3a) construct a composit types: arrays or records

Page 7: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Types and subtypes- 3a) construct a composit types: arrays or records – array

init

Page 8: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Types and subtypes

– 3b) construct a composit types: arrays or records

Page 9: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Type conversion

• VHDL is a strongly typed language

• std-logic-vector, unsigned, and signed are treated as different data types even when all of them are defined as an array with elements of the std-logic data type

• A conversion function or type casting is needed to convert signals of different data types

Page 10: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Data conversion table

Page 11: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Data conversion - example

Page 12: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Data conversion – user function

Page 13: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution functions

Page 14: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution function

• VHDL does not allow multiple concurrent signalassignments to an unresolved signal

• Resoltuion functions are used to determine theassigned value when there are multiple signaldrivers to the same signal

• Resolution functions can be user defined or calledfrom a package

Page 15: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution function

• The specification of a resolution function is the same as for ordinary functions with one requirement: the resolution function must be pure– The value returned by an impure function can depend

on items other than just its input parameters (e.g.shared variables)

Page 16: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution function

• Syntax:

Page 17: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution function• Resolution functions are associated with signals

that require resolution by including the name of the resolution function in the declaration of signals or in the declaration of the signal subtype.

• Standard types (BIT and BIT_VECTOR) are notresolved and it is not possible to specify multiple-source buses with these types. This is quite restrictive for typical applications, which use buses.

• Because Std_Logic and Std_Logic_Vector are resolved and can handle buses, they became the de facto industrial standard types.

Page 18: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Resolution function

Page 19: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Combinational circuits

Page 20: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Combinational circuits

• Combinational Circuits: Circuits whose outputs depend only on the current inputs; hence they appear to combine the inputs in some way to produce the outputs

• Combinational circuits are composed of intermediate-sized components, such as adders, comparators, and multiplexers.

Page 21: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Combinational circuits

• A combinational circuit can be thought of as an implementation of a Boolean function

• It takes some inputs A, B, C, etc., and produces a unique output f(A,B,C, … ).

• The circuitit self is just a network of the basic gates, where the information flows in one direction only (generally from left to right)

Page 22: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Combinational circuits

Page 23: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks

Page 24: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Sequenatial circuits are composed of simple basic

blocks like simple gates:

Sourc

e: [1

]

Page 25: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Multiple input gates:

– Q <= x1 AND x2 AND x3 AND x4…

Sourc

e: [1

]

Page 26: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Multiple input gates:

– Q <= x1 OR x2 OR x3 OR x4…

Sourc

e: [1

]

Page 27: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Multiplexers:

Sourc

e: [1

]

Page 28: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Decoders:

Sourc

e: [1

]

Page 29: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks• Arithmetic comparators:

Process(input1 , input2 )

begin

if ( input1 >= input2 ) then

output <= '1';

else

output <= '0';

end if;

end process;

Sourc

e: [1

]

Page 30: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Statement examples

Page 31: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

when�else example

Page 32: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

when�else example

Page 33: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

with�select example

Page 34: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

with�select example

Page 35: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

if�else example

Page 36: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

generic example• VHDL provides a construct, known as a generic, to pass

information into an entity and component.

• Since a generic cannot be modified inside the architecture, it functions somewhat like a constant.

Page 37: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

generic example

Page 38: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

generic example

Page 39: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Barrel shifter example

Page 40: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Simple sequential circuits

Page 41: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits

• A sequential circuit is a circuit with memory, which forms the internal state of the circuit.

• Unlike a combinational circuit, in which the output is a function of input only, the output of a sequential circuit is a function of the input and the internal state

Page 42: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits

• The present state of a sequential circuit depends on a previous state and on the values of input signals.

• In the case of synchronous sequential circuits, thechange of state is controlled by a clock signal.

• With asynchronous circuits, the change of state

may be caused by the random change in time of

an input signal.

Page 43: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits

• Sequential circuits are circuits that perform a computation in multiple steps (clock cycles)

• They compose of:– Memory registers

– Combinational circuits

• Intermediate results are held in registers andtransferred from register-to-register usingcombinational circuits

Page 44: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Synchronous System - Block Diagram

Page 45: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Synchronous System - Blocks

• State register: a collection of D FFs controlled by the same clock signal

• Next-state logic: combinational logic that uses the external input and internal state (i.e., the output of register) to determine the new value of the register

• Output logic: combinational logic that generates the output signal

Page 46: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks

Page 47: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks

• The most basic storage component in a sequential circuit is a D-type flip-flop (D FF):– Stores n-bits of data

– Rising (or falling) clock latches the input

– Output always maintains the value of stored bit

– May have asynchronous reset

• A collection of D FFs can be grouped together to store multiple bits and is known as a register.

Page 48: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – simple DFF

Page 49: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – DFF with reset

Page 50: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – „full” DFF

Page 51: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – D-latch

Page 52: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – Register

Page 53: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Building blocks – 3-bit counter

Page 54: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Synchronous vs asynchronous reset

Synchronous Asynchronous

Page 55: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

DFF - parameters

• The three main timing parameters of a D FF are:– Tcq( clock-to-q delay),

– Tsetup(setup time),

– Thold (hold time).

• Tcq is the time required to propagate the value of d to q at the rising edge of the clock signal. The d signal must be stable around the sampling edge to prevent the FF from entering the metastable state.

• Tsetup und Thold specify the time intervals before or after the sampling edge.

Page 56: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

DFF - parameters

Page 57: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Maximal operating frequency

• It is very important and difficult to estimate themaximal operating frequency of the sequentialcircuit

• As all storage components are grouped together, so they can be treated as single register – thissimplifies the analysis

Page 58: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Maximal operating frequency

Where:– Tcq- clock-to-q delay,

– Tsetup - setup time,

– Tcomb - the maximal propagation delay of next-statelogic

Page 59: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits - categories

• Based on the characteristics of the next-state logic, sequential circuits can be divided intothree categories:

– Regular sequential circuit

– FSM (finite state machine)

– FSMD (FSM with data path).

Page 60: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits - categories• Regular sequential circuit.

– The state transitions in the circuit exhibit a “regular”pattern, as in a counter or shift register. The next-state logic is constructed primarily by a predesigned, “regular” component, such as an incrementor or shifter.

s0

s2

s1s3

Page 61: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits - categories• FSM (finite state machine).

– The state transitions in the circuit do not exhibit a simple, repetitive pattern. The next-state logic is constructed by “random logic” and synthesized from scratch.

s0

s2

s1s3

Page 62: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits - categories• FSMD (FSM with data path).

– The circuit consists of a regular sequential circuit and an FSM.

– The two parts are known as a data path and a control path, and the complete circuit is known as an FSMD.

– This type of circuit is used to implement an algorithmrepresented by register-transfer (RT) methodology, which describes system operation by a sequence of data transfers and manipulations among registers.

Page 63: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Sequential circuits - categories• FSMD (FSM with data path).

– The job of the finite state machine is to sequence

operations on a datapath

Page 64: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

Thank you for your attention

Page 65: Programmable Logic Design Grzegorz Budzy ń …Typeconversion • VHDL is a strongly typed language • std-logic-vector, unsigned, and signed are treated as different data types even

References[1] „Combinational Circuits”, http://www.cs.Princeton.EDU/~cos126

[2] http://www.cs.umbc.edu/portal/help/VHDL/

[3] http://eesun.free.fr/DOC/vhdlref/refguide/language_overview/objects__data_types_and_operators/understanding_vhdl_attributes.htm

[4] http://www.xilinx.com/itp/xilinx10/books/docs/cgd/cgd.pdf

[5] http://www.xilinx.com/support/documentation/data_sheets/ds312.pdf

[6] http://highered.mcgraw-hill.com/sites/dl/free/0072460857/173199/vra60857_ch06.pdf

[7] http://ftp.utcluj.ro/pub/users/calceng/SSC/Ssc06/SSC06-e.pdf

[8] http://vhdl.renerta.com/source/vhd00058.htm


Recommended