Docsity

VHDL Architecture Models: Entity, Architecture, and Signal Usage in Digital Logic Design, Assignments of Microprocessors

Partial preview of the text

Download VHDL Architecture Models: Entity, Architecture, and Signal Usage in Digital Logic Design and more Assignments Microprocessors in PDF only on Docsity!

LABORATORY ASSIGNMENT # 1

VHDL Architecture ModelsVHDL Architecture Models

Basic Logic DesignSPRING 2009

ECE 371: Microprocessor Systems Department of Electrical and Computer EngineeringSchool of Engineering, Mathematics, and Science

Purdue University – Calumet

VHDL Entity

-^ Defines input and output interface of a design component^ –^

“black box” module with a defined set of inputs and outputs.

-^ Must have a unique name, must reside in a file with entity name.•^ Ports

: input and output signals of the entity – Mode:^ IN, OUT,

or^ INOUT

-^ Data Type:

STD_LOGIC

,^ STD_LOGIC_VECTOR, SIGNED, UNSIGNED,

LIBRARY

IEEE;

USING^

IEEE.STD_LOGIC_1164.

ALL ;

ENTITY

logicComponent

IS

PORT (A,

B,^ C^

:^ IN^ STD_LOGIC;

F^

:^ OUT^

STD_LOGIC

END^ ENTITY

logicComponent;

-^ Data Type: logicComponent.vhd

STD_LOGIC

,^ STD_LOGIC_VECTOR, SIGNED, UNSIGNED,

INTEGER, NATURAL, POSITIVE, STRING

ARCHITECTURE

dataflow

OF^ logicComponent

IS

Dataflow (RTL) Modeling

-^ Digital logic circuits are described by indicating how the inputs andoutputs of built-in primitive components are connected together.•^ Describes how signals flow through the circuit.^ –^

Utilized when Boolean equations are used to describe the logic

SIGNAL

D^ :^

STD _ LOGIC

BEGIN^ D^ <=

A^ AND

B;

F^ <=^ D

OR^ C;

END^ ARCHITECTURE

dataflow; ARCHITECTURE

rtl^ OF

logicComponent

IS

BEGIN^ F^ <=

(A^ AND

B)^ OR

C;

END^ ARCHITECTURE

rtl;

RTL = R

egister

T ransfer

L anguage

VHDL Signals

-^ Used for internal/intermediate signals within a module’s architecture•^ Designer cannot read ports of mode

OUT^

within architecture.

-^ Output ports can’t appear on

RHS^ of a concurrent signal assignment statement

-^ Solution

-^ Use an intermediate signal for intermediate storage

then

-^ Assign port of mode

OUT^ to intermediate signal using a concurrent assignment

-^ Example

ARCHITECTURE

wrong

OF^ gates

IS

BEGIN^ X^ <=

C^ XOR

Y ;

Y^ <=^ A

OR^ B;

END^ ARCHITECTURE

wrong

ARCHITECTURE

right

OF^ gates

IS

SIGNAL

Yint^

:^ STD_LOGIC;

BEGIN^ X^ <=

C^ XOR

Yint; Yint^ <=

A^ OR^

B;

Y^ <=^ Yint; END ARCHITECTURE

right

ENTITY

gates

IS

PORT (^

A,^ B,^

C^ :^ IN

STD_LOGIC

X,^ Y^

:^ OUT^

STD_LOGIC

END^ ENTITY

gates

RHS = R

ight^ H and

S ide

ARCHITECTURE

behavior

OF^ logicComponent

IS

SIGNAL^

ABC :^ STD_LOGIC_VECTOR

(2^ DOWNTO

0);

Behavioral (Algorithmic) Modeling • Describes a logic circuit in terms of the algorithm it performs.• High-level description of how a logic circuit or system shouldrespond to changes to its inputs^ –^ Utilized to quickly model a system that is complex.

ARCHITECTURE

behavior

OF^ logicComponent

IS

SIGNAL^

ABC :^ STD_LOGIC_VECTOR

(2^ DOWNTO

0);

BEGIN^ ABC <= A & B & C;F <= ‘0’

WHEN^ ABC = “000”

OR ABC = “010”

OR ABC = “100”

ELSE^ ‘1’;

END ARCHITECTURE

behavior; SIGNAL^

ABC :^ STD_LOGIC_VECTOR

(2^ DOWNTO

0);

BEGIN^ ABC <= A & B & C;^ WITH

ABC^ SELECT F <= ‘0’^ WHEN

“000”^

|^ “010”

|^ “100”,

‘1’^ WHEN OTHERS

;

END ARCHITECTURE

behavior;