Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ЛО САПР / VHDL.PDF
Скачиваний:
43
Добавлен:
17.04.2013
Размер:
5.27 Mб
Скачать

Sequential Statements

 

 

 

 

-- Assigns ’0’ to C

 

 

 

 

-- Assigns ’0’ to D

--

Named

notation

(3

=> E,

 

4

=> F,

2

=> G(1),

1

=> G(2)) := H;

-- Assigns H(1)

to G(2)

-- Assigns H(2)

to G(1)

--

Assigns

H(3)

to

E

--

Assigns

H(4)

to

F

Variable Assignment Statements

A variable assignment changes the value of a variable. The syntax follows.

target := expression;

target names the variables that receive the value of expression. See the “Assignment Statements and Targets” section of this chapter for a description of variable assignment targets.

Expression determines the assigned value; its type must be compatible with target. See the “Expressions” chapter for further information.

When a variable is assigned a value, the assignment takes place immediately. A variable keeps its assigned value until another assignment takes place.

The following example shows the different effects of variable and signal assignments.

signal S1, S2: BIT;

signal S_OUT

: BIT_VECTOR(1 to 8);

. . .

 

 

process( S1,

S2 )

 

variable V1, V2: BIT;

begin

 

 

V1

:= ’1’;

--

This sets the value of V1

V2

:= ’1’;

--

This sets the value of V2

S1

<= ’1’;

--

This assignment is the driver for S1

S2

<= ’1’;

--

This has no effect because of the

 

 

--

assignment later in this process

S_OUT(1) <= V1;

-- Assigns ’1’, the value assigned above

S_OUT(2) <= V2;

-- Assigns ’1’, the value assigned above

VHDL Reference Guide

5-7

Соседние файлы в папке ЛО САПР