Results 1 to 10 of 10

Thread: floating point number

  1. #1
    Join Date
    Jul 2015
    Posts
    20
    Rep Power
    1

    Default floating point number

    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

  2. #2
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,767
    Rep Power
    1

    Default Re: floating point number

    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.

  3. #3
    Join Date
    Jul 2015
    Posts
    20
    Rep Power
    1

    Default Re: floating point number

    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

  4. #4
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,767
    Rep Power
    1

    Default Re: floating point number

    That is a altbarrel_shift_fof core.Not fp convert.

  5. #5
    Join Date
    Jul 2015
    Posts
    20
    Rep Power
    1

    Default Re: floating point number

    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.

  6. #6
    Join Date
    Jul 2015
    Posts
    20
    Rep Power
    1

    Default Re: floating point number

    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.

  7. #7
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,767
    Rep Power
    1

    Default Re: floating point number

    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..

  8. #8
    Join Date
    Feb 2017
    Posts
    1
    Rep Power
    1

    Default Re: floating point number

    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

  9. #9
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,767
    Rep Power
    1

    Default Re: floating point number

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

  10. #10
    Join Date
    Dec 2007
    Location
    Bochum Germany
    Posts
    6,185
    Rep Power
    1

    Default Re: floating point number

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

Similar Threads

  1. Replies: 2
    Last Post: September 3rd, 2013, 05:16 AM
  2. logarithmic number system and floating point system convert to verilog coding
    By najwa_virgo87 in forum Verilog and System Verilog
    Replies: 0
    Last Post: March 14th, 2013, 08:23 AM
  3. How to use floating-point number in verilog code?
    By twk1989 in forum University Program
    Replies: 3
    Last Post: July 30th, 2012, 03:48 AM
  4. Replies: 5
    Last Post: January 7th, 2010, 12:43 PM
  5. rounding up a floating point number
    By joelw in forum General Discussion Forum
    Replies: 0
    Last Post: March 16th, 2005, 12:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •