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.
- [zr zi] = thru22(p1,p3) % zr=p1 zi=p3
- [zi zr]= addsub42(zi,p4,zr,p2) %zi= zi+p4 zr=zr+p2
The standard alternative is
- zr = sub(p1,p2)
- zi= add(p3,p4)
In fact there are two issues with the standard way;
- It needs the 4 input data on the first dual multiplication
- 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