Digital Signal Processing Reference
In-Depth Information
//correctionVector[10:6] = 5'b00000;
end
/*
******************************************************
* task: GENERATE_PPtk
* input: multiplicand, multiplicand one's complement
* recoderOut: output from bit-pair recoder
*output: correctionVector:addbitsfor2'scomplementcorrection
* output: ppi: ith partial product
******************************************************
*/
task GENERATE_PPtk;
input [2:0] recoderOut;
input [WIDTH:0] a;
input [WIDTH:0] _2a;
input [WIDTH:0] a_n;
input [WIDTH:0] _2a_n;
output [WIDTH:0] ppi;
output [1:0] correctionVector;
reg [WIDTH-1:0] zeros;
begin
zeros = 0;
case(recoderOut)
3'b000:
begin
ppi = {1'b1,zeros};
//ppi = {1'b0,zeros};
correctionVector = 2'b00;
end
3'b001:
begin
ppi = a;
correctionVector = 2'b00;
end
3'b010:
begin
ppi = _2a;
correctionVector = 2'b00;
end
3'b110:
begin
ppi = _2a_n;
correctionVector = 2'b10;
//correctionVector = 2'b00;
end
3'b111:
begin
ppi = a_n;
correctionVector = 2'b01;
//correctionVector = 2'b00;
end
default:
begin
Search WWH ::




Custom Search