Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How do you implement X^2.5???

Status
Not open for further replies.

khaila

Full Member level 2
Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
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
Full Member level 3
Joined
Aug 15, 2006
Messages
150
Helped
47
Reputation
94
Reaction score
47
Trophy points
1,308
Activity points
2,174
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
Member level 3
Joined
Mar 17, 2009
Messages
60
Helped
15
Reputation
30
Reaction score
15
Trophy points
1,288
Location
Kaunas, Lithuania
Activity points
1,604
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.
 
  • Like
Reactions: khaila

    khaila

    Points: 2
    Helpful Answer Positive Rating

qieda

Full Member level 3
Full Member level 3
Joined
Aug 15, 2006
Messages
150
Helped
47
Reputation
94
Reaction score
47
Trophy points
1,308
Activity points
2,174
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
Full Member level 3
Joined
Sep 2, 2010
Messages
164
Helped
47
Reputation
94
Reaction score
46
Trophy points
1,308
Location
Zelenograd
Activity points
2,169
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
Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
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
Member level 3
Joined
Mar 17, 2009
Messages
60
Helped
15
Reputation
30
Reaction score
15
Trophy points
1,288
Location
Kaunas, Lithuania
Activity points
1,604
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
Full Member level 3
Joined
Aug 15, 2006
Messages
150
Helped
47
Reputation
94
Reaction score
47
Trophy points
1,308
Activity points
2,174
Hi,

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

regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top