Continue to Site

# floating point input in verilog

Status
Not open for further replies.

#### GARNETWILSON

##### Newbie level 3
i have to design an adder module in verilog; input values are 0.1519 and -1.02123

#### TrickyDicky

Good luck. SOunds like a straight forward project.
How far have you got so far?

#### dipin

##### Full Member level 4
hi,

search "negative number representation " in the fourm itself.

regards

GARNETWILSON

### GARNETWILSON

Points: 2

##### Super Moderator
Staff member
i have to design an adder module in verilog; input values are 0.1519 and -1.02123

You don't want floating point arithmetic you want to implement fixed point arithmetic.

The whole point of using floating point is to be able to represent numbers like 0.0000000000000000234 and 234000000000000000 in a small number of bits (significant digits), hence the decimal point can "float".

You have a fixed range of values, so just search for fixed point scaling.

GARNETWILSON

### GARNETWILSON

Points: 2

#### GARNETWILSON

##### Newbie level 3
floating point in verilog

thank u....sir actually I'm doing image processing in Xilinx. I have to do histogram equalization using Verilog. The output of the 1st module should be converted to floating point and feed to the 2nd module...I don't know how...

- - - Updated - - -

can you send me a link to learn about Xilinx IP core generator?

sharath666

### sharath666

Points: 2

##### Super Moderator
Staff member
Re: floating point in verilog

The output of the 1st module should be converted to floating point and feed to the 2nd module...I don't know how...
And why is the second module using floating point and not fixed point?

Let me guess...the 2nd module is being designed by another student and they think they need to use floating point because the C software algorithms use the float type.

GARNETWILSON said:
can you send me a link to learn about Xilinx IP core generator?

#### GARNETWILSON

##### Newbie level 3
Re: floating point in verilog

sir,actually in the 1st module I have to perform histogram equalization.And it is written in the paper the the o/p should be converted to floating point. From that some data should be taken and fed to the second module. So I thought the I/ps to the second module is also floating point. In fact I could not design the 1st module.

#### mrflibble

I will let you in a secret: 9 out of 10 papers generate vacuum when it comes to implementation details. So, no you should in fact not use floating point like the paper says. You should use fixed point like ads-ee who has a clue says. ;-)

Or even better yet, you yourself should do some calculations and work out your error budget so that you know what kind of precision you require at the various processing steps. I am not saying that there are absolutely no cases where you want floating point. I am however saying that quite often you are better off with fixed point. Floating point is just the "easy" choice for the lazy of this world. And "easy" is in quotes because choosing to use floating point actually makes things harder for you. Floating point takes up more resources. For a given fpga you can stuff a lot more functionality / larger pipeline in it with fixed point. Floating point? *poof* What's that? That's the sound of your free resources evaporating.

So repeat after me: "Research papers s*ck**. I shall use my own brain."

(**) regarding implementation details.

#### TrickyDicky

Also a point to note: research papers are often generated by academics.
The people who actually implement things to sell and make a profic usually dont read or generate research papers.

Status
Not open for further replies.