Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

The "/" Operator Error

Altera_Forum
Honored Contributor II
1,501 Views

Does the division operator require any special library package ?  

 

I am getting this error ---  

 

--- Quote Start ---  

Error (10327): VHDL error at computation2.vhd(90): can't determine definition of operator ""/"" -- found 0 possible definitions 

 

--- Quote End ---  

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
628 Views

Division should be implemented through lpm_divide Megafunction, when necessary. Quartus has a feature, to infer dividers from HDL code under certain conditions, but it is effectively undocumented in present Quartus Handbook. 

 

Apparently, dividers are inferred from "/" operator for integer type only. You have to use integer range settings of the implied variables to control the divider's operand size.
0 Kudos
Altera_Forum
Honored Contributor II
628 Views

Hi, 

 

Extracts from Quartus help: 

 

 

--- Quote Start ---  

In VHDL, supported arithmetic operators consist of the prefix and binary plus (+) and minus (-) symbols, as well as the operators for multiplication (*) and division (/). See "Section 7.2.3: Adding Operators" and "Section 7.2.4: Multiplying Operators" in the IEEE Std 1076-1993 IEEE Standard VHDL Language Reference Manual for more information. 

--- Quote End ---  

 

 

 

--- Quote Start ---  

In VHDL, multiplying operators perform arithmetic multiplication and division operations on groups and numbers. Supported multiplying operators consist of multiplication (*) and division (/) operators, which are predefined for any integer type. See "Section 7.2.6: Multiplying Operators" in the IEEE Std 1076-1993 IEEE Standard VHDL Language Reference Manual for more information. 

--- Quote End ---  

 

 

 

--- Quote Start ---  

Altera recommends that you use the altfp_div megafunction instead of any other type of floating-point divider function. The altfp_div megafunction supports the following floating-point formats: single precision, double precision, single extended precision. The altfp_div megafunction is available for supported device (Apex II, Apex 20K, Arria GX, Cyclone, Cyclone II, Cyclone III, HardCopy II, HardCopy Stratix, Max II, Stratix, Stratix GX, Stratix II, Stratix II GX, and Stratix III) families. 

--- Quote End ---  

 

 

Hope this helps
0 Kudos
Altera_Forum
Honored Contributor II
628 Views

What are the types of your operands? VHDL only predefines "/" for integer and floating point types. I suggest using IEEE.NUMERIC_STD, which defines "/" for both UNSIGNED and SIGNED types.  

 

Quartus II will infer the LPM_DIVIDE megafunction for "/" though you can control the implementation more finely if you instantiate it yourself.
0 Kudos
Reply