# How do you implement X^2.5???

Status
Not open for further replies.

#### khaila

##### Full Member level 2
I have asked about implemetation of X^2.5 while X is a vector of 8-bit.
No alhorith implemetaion is required.

I have suggested the following solution:
X^2.5= X^2*X^0.5
for X^2 I will use simple multiplier(X*X).
X^0.5 I will use ROM.
then I will multiply the results.

#### qieda

##### Full Member level 3
Hi,

if you want to use a table for X^0.5, why do you not use a table for the X^2.5?
maybe this is better than a sqrt table and 3 multipliere

regards

#### Scrts

##### Member level 3
Having a number multiplied by 0.5 will need less memory than by 2.5. 100^0.5=10, while 100^2.5=100000. However, in this situation, having a table for X^2.5 could be the best solution, which also saves a multiplier.

khaila

### khaila

Points: 2

#### qieda

##### Full Member level 3
Hi,

if you have a 8bit input you need always a memory with 256 entries.
the width may be different for x^0.5 and x^2.5

regards

#### kornukhin

##### Full Member level 3
You can made combinational table and compare area with ROM+multipliers.

Code:
module x25(inx, out_x);
input [7:0] inx;
output [19:0] out_x;
assign out_x =
inx==8'd0	?	20'd	0	:
inx==8'd1	?	20'd	1	:
inx==8'd2	?	20'd	6	:
inx==8'd3	?	20'd	16	:
...

#### khaila

##### Full Member level 2
Having a number multiplied by 0.5 will need less memory than by 2.5. 100^0.5=10, while 100^2.5=100000. However, in this situation, having a table for X^2.5 could be the best solution, which also saves a multiplier.

you suggerst two soluations:
1. implement all the equation by using memory only.
2. using less memory but using also 3 multipliers.

which soluation is better for ASIC and whichfor FGPA? is there any other consideration?

#### Scrts

##### Member level 3
you suggerst two soluations:
1. implement all the equation by using memory only.
2. using less memory but using also 3 multipliers.

which soluation is better for ASIC and whichfor FGPA? is there any other consideration?

I have never worked with ASICs and my FPGA knowledge is beginner level If there will be no multipliers used later - then the multiplier one, since memory is always useful for different operations (at least in fpgas)

#### qieda

##### Full Member level 3
Hi,

I assume for such a small table the hardcoded version from kornukhin is the cheapest solution.

regards

Status
Not open for further replies.