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

Subversion Repositories ft816float

[/] [ft816float/] [trunk/] [rtl/] [verilog/] [fpTrunc.sv] - Diff between revs 21 and 26

Show entire file | Details | Blame | View Log

Rev 21 Rev 26
Line 34... Line 34...
        input ce,
        input ce,
        input [WID-1:0] i,
        input [WID-1:0] i,
        output reg [WID-1:0] o,
        output reg [WID-1:0] o,
        output overflow
        output overflow
);
);
localparam MSB = WID-1;
`include "fpSize.sv"
localparam EMSB = WID==128 ? 14 :
 
                  WID==96 ? 14 :
 
                  WID==80 ? 14 :
 
                  WID==64 ? 10 :
 
                                  WID==52 ? 10 :
 
                                  WID==48 ? 11 :
 
                                  WID==44 ? 10 :
 
                                  WID==42 ? 10 :
 
                                  WID==40 ?  9 :
 
                                  WID==32 ?  7 :
 
                                  WID==24 ?  6 : 4;
 
localparam FMSB = WID==128 ? 111 :
 
                  WID==96 ? 79 :
 
                  WID==80 ? 63 :
 
                  WID==64 ? 51 :
 
                                  WID==52 ? 39 :
 
                                  WID==48 ? 34 :
 
                                  WID==44 ? 31 :
 
                                  WID==42 ? 29 :
 
                                  WID==40 ? 28 :
 
                                  WID==32 ? 22 :
 
                                  WID==24 ? 15 : 9;
 
 
 
integer n;
integer n;
wire [MSB:0] maxInt  = {MSB{1'b1}};             // maximum unsigned integer value
wire [MSB:0] maxInt  = {MSB{1'b1}};             // maximum unsigned integer value
wire [EMSB:0] zeroXp = {EMSB{1'b1}};    // simple constant - value of exp for zero
wire [EMSB:0] zeroXp = {EMSB{1'b1}};    // simple constant - value of exp for zero
 
 

powered by: WebSVN 2.1.0

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