UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 4377

FPGA Express - Which libraries are needed for std_logic_vector addition/subtraction?

Description

Keywords: VHDL, libraries, std_logic_vector, addition, subtraction, FPGA Express

Urgency: Standard

General Description:
When I try to add/subtract with std_logic_vectors, the following error will be reported if the correct libraries are not used:

Error L23/C0 : #0 Error: <file>.vhd line <x>
Type mismatch on left and/or right operand of binary operator. (VSS-523)

Which libraries are needed for std_logic_vector addition/subtraction?

解决方案

1

For signed logic_vectors, use the following libraries:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_signed.all;

2

For unsigned logic_vectors, use the following libraries:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
AR# 4377
创建日期 07/30/1998
Last Updated 08/11/2003
状态 Archive
Type 综合文章