Hola Democrito,
Thanks for your kind comments!
It is not Black magic, ;-) it is just that i am not good enough at explaining/summarize what i do !
For the formula : outp<=outp*8+outp*2 + in;
We loop 3 time ( max ) trough this formula to enter the max 3 integer digits one by one ( before the coma)
This loop replaces the formula: bin = (cen * 100) + (dec * 10) + uni; of the ascii to bin module(simplified)
As you see, i replaced outp*10 by outp*8+outp*2 because it seams the compiler eats less resources with the second version.
It the later case, it sees 2 simple bit-shifts ans one addition.
with that trick, on my colorligth board i spare 1 dsp multiplier and on Alhambra board, it uses also less LC.
This trick can only be used when we multiply a variable(here outp) with some special simple constants like (10,100,1000,...) that can be compose by sums of powers of two.(eg: 10= 8+2 = 2^3+2)
For example, In your atan2 ice file, you can (gain around 70LC) by changing the q16.16 block.
At the output of that block, you can change the code

to:
// Convert the decimals part to a notation that can be represented.
//wire [27:0] temp;
reg [27:0] temp;
reg [3:0] cpt=0;
always @(in) begin
temp<=in;
for(cpt=0;cpt<=3; cpt=cpt+1) begin
temp<=temp*8+temp*2; // = temp*10 and it is hardware reproduced (in cascade) 4 time to get temp*10000.
cpt<=cpt+1;
end
end
assign out = temp >> 16;
It is fine to have one converter with the maximum bits. But when only few bits are needed for a certain variable, the compiler may not be able to simplify the circuit enough and it can consume a lot of resources!
Sorry but i am a bit obsessed with resources usage! :-).
I want us to be able to fit as much complex functions as possible in our small entry level fpgas!
Who know, one day, i may be able to fit a music synthesiser (with plenty DSP calculations) in my colorligtht i5 board!
But do not worry about that, do your amazing and inspiring blocks as you used to do! And, if i want to, i can bring resources optimisations myself !
Thanks a lot for your work too Democrito and have a good night!