B
Bojan Jovanovic
Guest
Hi there,
I need to implement Carry Look Ahead binary Adder in FPGA, by
describing it in a parametrized way. I want to use the following
approach:
1. To use input signals and to make carry generate and carry propagate
signals - G and P
2. To use G and P and to obtain signal C
3. To use signals C and P and to obtain the sum S and the carry out
C_out
Generating the signals G and P is quite simply. G=A and B; P=A xor B
The problem is how, by using parameter N (input bit widths), to
obtain C.
When having C it is also easy to obtain the sum signal S.
For N=1
C0=G0 + P0Cin;
For N=2
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
For N=3
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
C2=G2+P2G1+P2P1G0+P2P1P0C0;
For N=4
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
C2=G2+P2G1+P2P1G0+P2P1P0C0;
C3=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0;
And so on...
So you can see that, depending on the number of input bits (N) I have
different number of and circuits with the different number of inputs.
Is there any way to describe in VHDL such a structure in parametrized
way (using for loops), so I could only change the parameter N and
obtain the CLA adder of preferred size?
Thank you very much for your time and effort to answer me.
Cheers,
Bojan
I need to implement Carry Look Ahead binary Adder in FPGA, by
describing it in a parametrized way. I want to use the following
approach:
1. To use input signals and to make carry generate and carry propagate
signals - G and P
2. To use G and P and to obtain signal C
3. To use signals C and P and to obtain the sum S and the carry out
C_out
Generating the signals G and P is quite simply. G=A and B; P=A xor B
The problem is how, by using parameter N (input bit widths), to
obtain C.
When having C it is also easy to obtain the sum signal S.
For N=1
C0=G0 + P0Cin;
For N=2
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
For N=3
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
C2=G2+P2G1+P2P1G0+P2P1P0C0;
For N=4
C0=G0 + P0Cin;
C1=G1+P1G0 + P1P0C0;
C2=G2+P2G1+P2P1G0+P2P1P0C0;
C3=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0;
And so on...
So you can see that, depending on the number of input bits (N) I have
different number of and circuits with the different number of inputs.
Is there any way to describe in VHDL such a structure in parametrized
way (using for loops), so I could only change the parameter N and
obtain the CLA adder of preferred size?
Thank you very much for your time and effort to answer me.
Cheers,
Bojan