Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

floating point number

Altera_Forum
Honored Contributor I
977 Views

Hi All, 

 

How can I convert a std_logic_vector number into a floating point number? 

 

What is the command-operator? what library to use? is it synthesizable ?  

 

Thanks
0 Kudos
9 Replies
Altera_Forum
Honored Contributor I
69 Views

If you want a synthesisable fp number you will have to use slv and user the floating point cores provided by altera. But why do you want floating point? Usually fire FPGAs it is far more efficient to use fixed point.

Altera_Forum
Honored Contributor I
69 Views

Hi, 

 

Do you mean ALTFP_CONVER from the IP library? 

 

If yes, it creates this entity, which is different from documentation. for example: what is "distance" input? 

Doesn't have this input in documentation. 

 

ENTITY ALTFP_CONVERa_altbarrel_shift_fof IS  

PORT  

(  

aclr : IN STD_LOGIC := '0'; 

clk_en : IN STD_LOGIC := '1'; 

clock : IN STD_LOGIC := '0'; 

data : IN STD_LOGIC_VECTOR (31 DOWNTO 0); 

distance : IN STD_LOGIC_VECTOR (4 DOWNTO 0); 

result : OUT STD_LOGIC_VECTOR (31 DOWNTO 0) 

);  

END ALTFP_CONVERa_altbarrel_shift_fof; 

 

 

 

 

 

 

Thanks
Altera_Forum
Honored Contributor I
69 Views

That is a altbarrel_shift_fof core.Not fp convert.

Altera_Forum
Honored Contributor I
69 Views

HI, 

I am using version quartus 16.1.0 and this is the vhdl i am getting after generating ALTFP_CONVER. 

 

Maybe a quartus bug. anyway looks like it works.
Altera_Forum
Honored Contributor I
69 Views

Sorry, it doesn't work. I think there is a problem with this IP in quartus 16.1.0. it generates ALTFP_CONVERa_altbarrel_shift_fof instead of ALTFP_CONVER.

Altera_Forum
Honored Contributor I
69 Views

If it is generating that odd looking IP, which looks like the ports for a barrel shifter, you should raise a support ticket with altera..

Altera_Forum
Honored Contributor I
69 Views

hi 

iam doing a project in floting point arithemetics  

so i want to separate the mantisa exponent and sign bit form an unsigned integer  

anybody have know how to convert and accces by vhdl code/command
Altera_Forum
Honored Contributor I
69 Views

If you want an unsigned integer, you will need to use the alt_fp_convert megafunction

Altera_Forum
Honored Contributor I
69 Views

Of course you can do the conversion in your own code. Float to integer is relative simple arithmetic, just a variable shift.

Reply