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

Subversion Repositories ft816float

[/] [ft816float/] [trunk/] [rtl/] [verilog2/] [fpdivr16.v] - Diff between revs 30 and 34

Show entire file | Details | Blame | View Log

Rev 30 Rev 34
Line 1... Line 1...
// ============================================================================
// ============================================================================
//        __
//        __
//   \\__/ o\    (C) 2006-2019  Robert Finch, Waterloo
//   \\__/ o\    (C) 2006-2020  Robert Finch, Waterloo
//    \  __ /    All rights reserved.
//    \  __ /    All rights reserved.
//     \/_//     robfinch<remove>@finitron.ca
//     \/_//     robfinch<remove>@finitron.ca
//       ||
//       ||
//
//
//      fpdivr16.v
//      fpdivr16.v
Line 71... Line 71...
        b3 = b <= {r3,q[WID*2-4]};
        b3 = b <= {r3,q[WID*2-4]};
always @*
always @*
        r4 = b3 ? {r3,q[WID*2-4]} - b : {r3,q[WID*2-4]};
        r4 = b3 ? {r3,q[WID*2-4]} - b : {r3,q[WID*2-4]};
 
 
reg [2:0] state = 0;
reg [2:0] state = 0;
 
always @(posedge clk)
 
begin
 
  if (ld) state <= 3'd1;
 
  case(state)
 
  3'd0: ;
 
  3'd1: if (cnt[8]) state <= 3'd2;
 
  3'd2: state <= 3'd0;
 
  default:  state <= 3'd0;
 
  endcase
 
end
 
 
always @(posedge clk)
always @(posedge clk)
begin
begin
done <= 1'b0;
done <= 1'b0;
case(state)
case(state)
Line 98... Line 108...
                        gotnz <= 3'd1;
                        gotnz <= 3'd1;
                end
                end
        rxx <= r4;
        rxx <= r4;
                cnt <= cnt - 3'd1;
                cnt <= cnt - 3'd1;
        end
        end
        else
 
                state <= 3'd2;
 
3'd2:
3'd2:
        begin
        begin
        r <= r4;
        r <= r4;
        done <= 1'b1;
        done <= 1'b1;
        state <= 1'd0;
 
    end
    end
default:        state <= 1'd0;
default:        ;
endcase
endcase
if (ld) begin
if (ld) begin
        lzcnt <= 0;
        lzcnt <= 0;
        gotnz <= 1'b0;
        gotnz <= 1'b0;
        cnt <= {1'b0,maxcnt};
        cnt <= {1'b0,maxcnt};
        q <= {(a << REM),{WID{1'b0}}};
        q <= {(a << REM),{WID{1'b0}}};
      rxx <= {WID{1'b0}};
      rxx <= {WID{1'b0}};
        state <= 3'd1;
 
end
end
end
end
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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