URL
https://opencores.org/ocsvn/ft816float/ft816float/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 82 |
Rev 84 |
Line 64... |
Line 64... |
reg [5:0] digcnt;
|
reg [5:0] digcnt;
|
reg [FPWID*2-1:0] qi;
|
reg [FPWID*2-1:0] qi;
|
reg [FPWID+3:0] ri;
|
reg [FPWID+3:0] ri;
|
reg [FPWID-1:0] bi;
|
reg [FPWID-1:0] bi;
|
wire sgn;
|
wire sgn;
|
wire [FPWID-1:0] dif;
|
wire [FPWID+3:0] dif;
|
reg gotnz; // got a non-zero digit
|
reg gotnz; // got a non-zero digit
|
|
|
generate begin : gSub
|
generate begin : gSub
|
BCDSubtract #(.N(N)) ubcds1
|
BCDSubtract #(.N(N+1)) ubcds1
|
(
|
(
|
.clk(clk),
|
.clk(clk),
|
.a(ri),
|
.a(ri),
|
.b(bi),
|
.b({4'b0,bi}),
|
.o(dif),
|
.o(dif),
|
.sgn(sgn)
|
.sgn(sgn)
|
);
|
);
|
end
|
end
|
endgenerate
|
endgenerate
|
Line 116... |
Line 116... |
begin
|
begin
|
digcnt <= digcnt - 1'd1;
|
digcnt <= digcnt - 1'd1;
|
if (digcnt=='d0) begin
|
if (digcnt=='d0) begin
|
clkcnt <= clkcnt + 1'd1;
|
clkcnt <= clkcnt + 1'd1;
|
digcnt <= 6'd10;
|
digcnt <= 6'd10;
|
if (sgn) begin
|
if (bi > ri) begin
|
ri <= {ri,qi[FPWID*2-1:FPWID*2-4]};
|
ri <= {ri,qi[FPWID*2-1:FPWID*2-4]};
|
qi <= {qi[FPWID*2-5:0],cnt};
|
qi <= {qi[FPWID*2-5:0],cnt};
|
cnt <= 4'd0;
|
cnt <= 4'd0;
|
dcnt <= dcnt - 1'd1;
|
dcnt <= dcnt - 1'd1;
|
if (dcnt=='d0)
|
if (dcnt=='d0)
|
st <= DONE;
|
st <= DONE;
|
end
|
end
|
else begin
|
else begin
|
if (clkcnt > 600 && 1'b0) begin
|
if (clkcnt > 600 && 0) begin
|
ri <= {ri,qi[FPWID*2-1:FPWID*2-4]};
|
ri <= {ri,qi[FPWID*2-1:FPWID*2-4]};
|
qi <= {qi[FPWID*2-5:0],cntm1};
|
qi <= {qi[FPWID*2-5:0],cntm1};
|
cnt <= 4'd0;
|
cnt <= 4'd0;
|
dcnt <= dcnt - 1'd1;
|
dcnt <= dcnt - 1'd1;
|
if (dcnt==6'd0)
|
if (dcnt==6'd0)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.