Answers Database


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


Record #4377

Product Family: Software

Product Line: Synopsys

Product Part: FPGA Express

Product Version: 2.1.1

Problem Title:
FPGA Express VHDL: Which libraries are needed for std_logic_vector addition/subtraction?


Problem Description:
Urgency: Standard

General Description:
When trying to add/subtract with std_logic_vectors, the following error will
be returned 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?


Solution 1:

For signed logic_vectors use the following libraries:

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



Solution 2:

For unsigned logic_vectors use the following libraries:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;




End of Record #4377 - Last Modified: 08/05/98 13:12

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Technical Tips!