cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anomi17
Visitor
Visitor
995 Views
Registered: ‎06-07-2018

Adding two floating points numbers in a vector

Hi!

 

I have a problem:

 

I need to add two floating point numbers that are stored in a vector (random size f.e. 0-7). The result of adding is also stored in a vector. Adding must be done by indexes that means if I have a number that is stored in a vector A  <= 1,765 and the second number stored B <= 14,123 adding goes as follow C [0] = A [0] + B [0]. However, before adding, numbers that are stored in a vector must be filled in with 0 that coma is aligned. It would look like this A (001.7650) and B (014.1230). 

 

Can you please help me, I'm struggling with this for some time :/ Thank you in advance. I'm working in ISE on Spartan 3 

0 Kudos
2 Replies
u4223374
Advisor
Advisor
973 Views
Registered: ‎04-26-2015

Is this binary coded decimal floating point? What code have you written and tested so far?

0 Kudos
anomi17
Visitor
Visitor
929 Views
Registered: ‎06-07-2018

I thought about a decimal floating point, however, as I read some materials it would be easier to do binary coded decimal floating point. I didn't try out any code yet because I don't know how to even the coma in two digits. That is where I'm currently in. I will try to write a code later today and I will upload it what I have achieved, but I would be very very grateful for any tips, sample codes etc. 

0 Kudos