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.

Confusion in using a pipelined arithmatic unit in feedback mode for recursive formula

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
593
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,681
I have a recursive equation where the next output is a function of the current output and a constant set before start of the iteration. I am trying to implement this in hardware using VHDL. The aim is to see how many iterations are required to reach a specific value. At start I take a value 0, square it using multiplier and then add it to a constant. This result becomes new input for the squarer. This squaring and adding squared result to constant which becomes new input for the squarer will happen until either the result reaches a threshold or 256 iterations are complete.

I know that the multiplier blocks in Altera Quartus have option for adding pipeline latency. This shall let me run the design at a higher clock frequency as far as I am aware.

There is a problem, since the output is actually fed back, if I use pipelining, I will not get an increased throughput. Lets say I have N stages in pipeline. At start I have to wait N cycles to get first output, that feeds back in and I get next output N cycles later and so on. It is not possible to get a new result every clock cycle. Is there a workaround for this when using recursion or feedback like this?
 

Without seeing the equation, we dont know what you're trying to do.
You can feed back your results on every clock cycle, or just pipeline the design to give you the results - basically anything is possible.
 

OK, here is the equation:
Z_(n+1)=〖Z_n〗^2 + c
The Z is complex and so is c, I am using a complex number multiplier. c is a constant.


So I start with Z_0 = 0, and then
Z_1 = c and then
Z_2 = (Z_1)^2 + c and then
Z_3 = (Z_2)^2 + c and then
Z_4 = (Z_3)^2 + c and then
Z_5 = (Z_4)^2 + c ...

So I have to square Z, add it with c and then put it back for this result to be squared and added with c again
 

since this is a static calculation (c is constant) , then the formula can be pre-calculated at 0 time, for given c.
 

Trying to see what the problem is here, you can calculate Z_(n+1) in a single clock cycle.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top