OpenCores
URL https://opencores.org/ocsvn/ft816float/ft816float/trunk

Subversion Repositories ft816float

[/] [ft816float/] [trunk/] [rtl/] [verilog2/] [BCDMath.sv] - Diff between revs 66 and 70

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 66 Rev 70
Line 124... Line 124...
        BCDAddAdjust u1 (hsN[g],o[g*4+3:g*4],c[g+1]);
        BCDAddAdjust u1 (hsN[g],o[g*4+3:g*4],c[g+1]);
end
end
endgenerate
endgenerate
 
 
endmodule
endmodule
/*
 
module BCDAdd8NClk(clk, a, b, o, ci, co);
 
parameter N=33;
 
input clk;
 
input [N*8-1:0] a;
 
input [N*8-1:0] b;
 
output [N*8-1:0] o;
 
input ci;
 
output co;
 
 
 
reg [N:0] c;
 
wire [N:0] d;
 
assign c[0] = ci;
 
assign co = c[N];
 
 
 
genvar g;
 
generate begin : gBCDadd
 
for (g = 0; g < N; g = g + 1) begin
 
        BCDAdd u1 (c[g],a[g*8+7:g*8],b[g*8+7:g*8],o[g*8+7:g*8],d[g+1]);
 
 
 
        always_ff @(posedge clk)
 
                c[g+1] <= d[g+1];
 
end
 
end
 
endgenerate
 
endmodule
 
*/
 
 
 
module BCDSub(ci,a,b,o,c);
module BCDSub(ci,a,b,o,c);
input ci;               // carry input
input ci;               // carry input
input [7:0] a;
input [7:0] a;
input [7:0] b;
input [7:0] b;
Line 219... Line 192...
end
end
endgenerate
endgenerate
 
 
endmodule
endmodule
 
 
/*
 
module BCDSub8NClk(clk, a, b, o, ci, co);
 
parameter N=33;
 
input clk;
 
input [N*8-1:0] a;
 
input [N*8-1:0] b;
 
output [N*8-1:0] o;
 
input ci;
 
output co;
 
 
 
reg [N:0] c;
 
wire [N:0] d;
 
assign c[0] = ci;
 
assign co = c[N];
 
 
 
genvar g;
 
generate begin : gBCDsub
 
for (g = 0; g < N; g = g + 1) begin
 
        BCDSub u1 (c[g],a[g*8+7:g*8],b[g*8+7:g*8],o[g*8+7:g*8],d[g+1]);
 
 
 
        always_ff @(posedge clk)
 
                c[g+1] <= d[g+1];
 
end
 
end
 
endgenerate
 
endmodule
 
*/
 
 
 
module BCDAddAdjust(i,o,c);
module BCDAddAdjust(i,o,c);
input [4:0] i;
input [4:0] i;
output [3:0] o;
output [3:0] o;
reg [3:0] o;
reg [3:0] o;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.