Saturday, November 7, 2015

Matching functions to structures

====== Building Block ISSUES  ======= 

Matching functions to structures

When designing a new BB it is because you need it. Hence, we call this need: a strictly functional need. There are two ways to go:
- stick to it and solve the present issue.
- have a broader view and design a more general purpose brick which can be reused.
A third case happens when the functional block can be turned into a generic structural block for no additional price. So before designing a new block, it is worth asking oneself.
Can I make this BB more generic?
Let us take as example the addition needed in a complex multiplication:
zr = xr*kr -xi*ki
zi = xi*kr + xi*kr
same as
zr = p1 - p2
zi=  p3 + p4
If we use a dual multiplier, the 4 multiplications can be done in 2 cycles.

Then it must be followed by two BBs for the complete equations. We now write the equations as follows.
  1.   [zr zi] = thru22(p1,p3)   %   zr=p1 zi=p3
  2.   [zi  zr]= addsub42(zi,p4,zr,p2) %zi= zi+p4  zr=zr+p2
It is easy to see that the two BBs are generic but the inputs and the equations are not straightforward..

The standard alternative is
  1. zr = sub(p1,p2)
  2. zi=  add(p3,p4)
which is simpler. So what are taking about here?

In fact there are two issues with the standard way;
  1. It needs the 4 input data on the first dual multiplication
  2. It does not work when we want  real_imag  to be in the same register so that the complex number is considered an entity made of 2 parts..

No comments:

Post a Comment