Continue to Site

# [SOLVED]Arithmetic Operation Problem VHDL

Status
Not open for further replies.

#### hitx

##### Member level 2
Hi dear friends,

Can anybody help me about this calculation (showns below) in VHDL. Otherwise, I will become such an insane.

Xn+1 = 4*Xn*(1-Xn) Xn+1 is a new value and Xn is past. Xn will always be in the range of 0< Xn< 1. Xn is float number with 10 decimal point. inital value of Xn is 0.25.

So how can I obtain a suitable code for the given eqn? Please someone explains this by giving the VHDL library. Thanks alot.

Hitx

do you really mean floating point? your description implies it is fixed point.

If it is as simple as fixed point, all you need is a registered version of X, and you can pretty much do your formula as is in VHDL.

As single precision float precision is only about 7 decimals, you'll need to refer to IEEE double, a user specific float format, or probably better a specifically defined fxied point format.

Most FPGA vendors are supplying floating point IP that can be used for the problem, also IEEE VHDL fixed point library can handle it. IEEE VHDL floating point library isn't yet suited for synthesis.

Your question suggests that you are not familiar with VHDL arithmetic processing yet, thus some basic (text book) reading seems appropriate.

Hi dear friends,

Can anybody help me about this calculation (showns below) in VHDL. Otherwise, I will become such an insane.

Xn+1 = 4*Xn*(1-Xn) Xn+1 is a new value and Xn is past. Xn will always be in the range of 0< Xn< 1. Xn is float number with 10 decimal point. inital value of Xn is 0.25.

So how can I obtain a suitable code for the given eqn? Please someone explains this by giving the VHDL library. Thanks alot.

Hitx

Since you haven't been able to locate the VHDL fixed/floating point package on your own, here is a link that should help
https://www.lmgtfy.com/?q=fixed+point+floating+point+vhdl#

Kevin Jennings

Hi K-J;

There is a problem in which the VHDL codes you gave me. " signal Xn: sfixed(1 downto -15);" In here, sfixed command can not be recognized. Probably, there is a specific library missing in the codes. Do you have an idea to solve this?

Thanks

KJ already posted you a link that gives you plenty of information about the VHDL fixed point libraries.

Do you think that is that so funny to learn plenty of information for point libraries from the Google search engine?? Do not you know that I have already know this ? Think one more time before write my dear friend.

Byes

Hi K-J;

There is a problem in which the VHDL codes you gave me. " signal Xn: sfixed(1 downto -15);" In here, sfixed command can not be recognized. Probably, there is a specific library missing in the codes. Do you have an idea to solve this?

Thanks
The Google link was very specific and gives anyone all the information they would need. The first result returned was the FAQ for the fixed/floating point package; the second link is to the user's guide which is the definitiive source using the library; the third link takes you to the support page from which you can download the packages.

Based on your question to my earlier post, it would appear that you have not read the user's guide (Google result #1) and/or downloaded the source code to the packages (Google result #3). What exactly is the difficulty?

Kevin

Hi my friend,

OK. I have read fixed_point User guide, and there is nothing wrong here. I have download "fixed_float_types_c.vhdl" and "fixed_pkg_c.vhdl" files. But I have a problem for obtaining library that contains these packages. I have done every possible situation to compile these package into "ieee_proposed", but never managed. I guess I do not know exactly what should be done. I am doing like this :

1. Open Xilinx Project Navigator, create a new file.
2. Then create VHDL library.
3. Open fixed_float_types_c.vhdl" and "fixed_pkg_c.vhdl" files as added source in main vhd menu.
4. Then from library section, move these packages into new library I created.

Am I right? Please, someone helps me. Bye

Status
Not open for further replies.