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

VHDL Reference Guide

function "="(L: SIGNED;

R: UNSIGNED) return Boolean;

function "="(L: UNSIGNED;

R: INTEGER)

return Boolean;

function "="(L: INTEGER;

R: UNSIGNED) return Boolean;

function "="(L: SIGNED;

R: INTEGER)

return Boolean;

function "="(L: INTEGER;

R: SIGNED)

return Boolean;

function "/="(L: UNSIGNED;

R: UNSIGNED)

return Boolean;

function "/="(L: SIGNED;

R: SIGNED)

return Boolean;

function "/="(L: UNSIGNED;

R: SIGNED)

return Boolean;

function "/="(L: SIGNED;

R: UNSIGNED)

return Boolean;

function "/="(L: UNSIGNED;

R: INTEGER)

return Boolean;

function "/="(L: INTEGER;

R: UNSIGNED)

return Boolean;

function "/="(L: SIGNED;

R: INTEGER)

return Boolean;

function "/="(L: INTEGER;

R: SIGNED)

return Boolean;

Shift Functions

The std_logic_arith package provides functions for shifting the bits in SIGNED and UNSIGNED numbers. These functions produce shifters. See the following example for shift function declarations. For a list of shift and rotate operators, see the “Operators” section of the “VHDL Constructs” chapter.

function SHL(ARG: UNSIGNED;

 

COUNT: UNSIGNED)

return UNSIGNED;

function SHL(ARG: SIGNED;

 

COUNT: UNSIGNED)

return SIGNED;

function SHR(ARG: UNSIGNED;

 

COUNT: UNSIGNED)

return UNSIGNED;

function SHR(ARG: SIGNED;

 

COUNT: UNSIGNED)

return SIGNED;

The SHL function shifts the bits of its argument ARG to the left by COUNT bits. The SHR shifts the bits of its argument ARG to the right by COUNT bits.

The SHL functions work the same for both UNSIGNED and SIGNED values of ARG, shifting in zero bits as necessary. The SHR functions treat UNSIGNED and SIGNED values differently. If ARG is an UNSIGNED number, vacated bits are filled with zeros; if ARG is a SIGNED number, the vacated bits are copied from the sign bit of ARG.

The following example shows some shift function calls and their return values.

10-12

Xilinx Development System

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