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.

suggestions regarding angle calculation algorithm

Status
Not open for further replies.

Jaffry

Member level 1
Joined
May 16, 2012
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,594
Dear all,

I am implementing a research paper for my VLSI course.

I have few questions in this regard. Please see the question in red

  1. I have to multiply the data with the PI value, i.e. 3.1415... I am aware of the fixed point implementations and what I know we have to do normal operations, just consider the decimal point (or exponent value) for each operation, like addiotion, multiplication etc. But I cannot come up for some better solution for PI value... Any suggestion.
  2. During implementation, there is one flow as following ==>

  • (theta_L)2 = X : where theta_L is a 12 bit decimal point value. So (theta_L)2 means theta_L with exp -24 in consideration
  • Y = X/2 => I implementing this by right shifting just one bit, hence we have Y with exp -25
  • 1-Y => For this I first take the negation of Y then add 1 to it, so the value is (1 + Y)2 exp -25 .... Is it correct?
  • also what do you suggest if I implment all this in 1 clk cycle, or should I use piple line, in this case do I have to use some flag to indicate that one operation is done and other can be performed...?


Waiting for reply

Bests,
Jaffry
 

I assume you mean theta_L is a 12 bit number that is all fraction bits. What about integer bits?

1. Fixed point is fixed point - you can change how many bits you want.
2. Why negate Y? why not just use 1-Y?

And you keep talking about exponent. In fixed point the things you should refer to are fraction and integer. Exponent is part of floating point.

Have you considered how much accuracy you actually need? if in the end you only need 12 bits, then can you accept a +- 2^-13 rounding error? You need to know what it is you're actually doing. For example, if it was video processing, at the end of the day you only have 256 grey levels, is 2^-12 of a grey level really going to make a difference?

etc etc.
 
  • Like
Reactions: Jaffry

    Jaffry

    Points: 2
    Helpful Answer Positive Rating
TrickyDricky!

Thank you for your quick reply.

I assume you mean theta_L is a 12 bit number that is all fraction bits. What about integer bits?
Yes it is 12 bit number. The implementaion is just from 0 to PI/4 the integer bit is considered 0 in the algorithm.

Yes I know fixed point is fixed point, thank you for reminding, well this thing just slip from my mind and I confused it.

Why negate Y? why not just use 1-Y?
Yes you are right, I guess looking for best and efficient way of implmentation I ignore the common sense. Thank you.

Have you considered how much accuracy you actually need? if in the end you only need 12 bits, then can you accept a +- 2^-13 rounding error? You need to know what it is you're actually doing. For example, if it was video processing, at the end of the day you only have 256 grey levels, is 2^-12 of a grey level really going to make a difference?

Well I am just implementing the theoratical algorithm discussed in this IEEE paper. It is angle rotation algorithm and although can be further in many applications, but for now it is simply finding (x,y) values after rotation of angle THETA.

What do you suggest about point 3 in previous post, i.e. pipelining or w/o pipelining. I thinkg implementing whole in 1 block is better if clock speed is not required. It will save much gates in FPGA
Thankyou again.
 

It will use the same number of gates whether its pipelined or not. But the max clock speed will be very poor if you did all that in a single cycle. I suggest pipelining after each arithmetic stage.
 
TrickyDicky.

While implementing I face one more issue, it is regarding increasing bit size. I hope you can suggest something.

My original bit size of inputs is 12 bit/12bit for angle/position coordinates.
But after all additions and esp multiplication, it increases to 42 bit(that too a/c to my knowledge).
If I want to truncate or round of, how can I do that, just ignore the final 'n' number of bits or what?

Code:
input [11:0]  Xo, Yo;
input [11:0] angle; 
output reg [41:0] Xr, Yr;

Now for example in the code below d/f lengths are added so what should be my ...
I have tried to explain the increament or addition of bits in the comments.
Code:
wire [7:0] theta_l;
sq_theta <= 1*(17'h10000) - ((theta_l * theta_l) >> 1); //17-b+(16-b * 16-b) = 16 bit
...
...
//so finally 
Xr <= (sq_theta * X1) - theta_l * Y1;// 17b*25b + 8b * 25bit => 42bit + 33 bit , hence Xr = 42bit

bests,
Jaffry
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top