Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- Programmable Devices
- question about arithmetic operator '+'

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Altera_Forum

Valued Contributor III

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-02-2011
03:46 AM

693 Views

question about arithmetic operator '+'

Every time I try following code, there is a error saying that "Error (10327): VHDL error at Arithmetic.vhd(35): can't determine definition of operator ""+"" -- found 0 possible definitions", Can anyone shed some light? Thanks.

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use ieee.numeric_std.all; entity Arithmetic is port( var3 : in bit_vector(7 downto 0); var9 : out bit_vector(8 downto 0) ); end Arithmetic; architecture architecture of Arithmetic is signal var8 : bit_vector(8 downto 0); begin var8 <= '0' & var3; var9 <= var8 + var8; end architecture;
1 Reply

Highlighted
##

Altera_Forum

Valued Contributor III

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-02-2011
09:05 AM

6 Views

You get the error, because you are using unsuitable data types and incompatible libraries.

There are two possible ways: - You can refer to the legacy non-IEEE STD_LOGIC_UNSIGNED library. But then you have to import STD_LOGIC_ARITH instead of NUMERIC_STD. bit_vector has to be changed to std_logic_vector in addition - You can use correct VHDL types and the official IEEE.NUMERIC_STD library. The involved signals should be defined as unsigned in this case. As a side remark, the inplemented left-shift can be simply written as`var9 <= var3 & '0';`

without involving numeric types.
For more complete information about compiler optimizations, see our Optimization Notice.