Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8491227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:21:19+00:00 2026-06-10T22:21:19+00:00

I need to do operations on IEEE 754 floating point numbers stored as std_logic_vector

  • 0

I need to do operations on IEEE 754 floating point numbers stored as std_logic_vector signals.

e.g.:

signal a, b, ans : std_logic_vector( 63 downto 0 );
..
ans <= std_logic_vector(to_float(a) + to_float(b));

How can I do that? (I suppose I need to define the number of bits somewhere during the conversion?)
edit: the code is synthesizable but I get warnings. Code:

variable tempfloat1, tempfloat2, tempfloat3 : float32;
..
tempfloat1 := to_float(s_do_ssc2wb, exponent_width => 8, fraction_width => 23 );
tempfloat2 := to_float(s_do_wb2ssc, exponent_width => 8, fraction_width => 23 );
tempfloat3 := tempfloat1 + tempfloat2;

Warnings:

 "float_pkg_c.vhdl" line 1515: VHDL Assertion Statement with non constant condition is ignored.
    "float_pkg_c.vhdl" line 1600: Index value(s) does not match array range, simulation mismatch.

I wonder whats the right syntax for it… the “add” function doesn’t accept the arguments like in the example in the user’s guide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:21:21+00:00Added an answer on June 10, 2026 at 10:21 pm

    For VHDL 2008, use the built-in float_pkg which provides the float type which is convertable to and from std_logic_vector. For earlier versions of VHDL, you can use the original, pre-standard version of these same packages from http://www.vhdl.org/fphdl/index.html .

    When using float types, they work very straightforwardly, similar to unsigned types: you can do arithmetic on them, resize them, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: 32 bit hex to 32 bit floating point (IEEE 754) conversion in
I am writing an (almost) IEEE 854 compliant floating point implementation in TeX (which
I need to perform operations on Lua tables from C where the tables are
I need to perform multiple operations on an Image, for example, I need to
I need to perform some operations on all folders within a file share which
I need to do some registry operations & other system operations for that i
I need to force any time related operations to GMT/UTC, regardless the timezone set
We need to profile the JDBC operations of several web applications, number of queries,
I need a data structure which will support the following operations in a performant
I need to design a data structure that supports the following operations: search element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.