URL
https://opencores.org/ocsvn/ft816float/ft816float/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 8 |
Rev 26 |
Line 1... |
Line 1... |
// ============================================================================
|
// ============================================================================
|
// __
|
// __
|
// \\__/ o\ (C) 2006-2016 Robert Finch, Waterloo
|
// \\__/ o\ (C) 2006-2019 Robert Finch, Waterloo
|
// \ __ / All rights reserved.
|
// \ __ / All rights reserved.
|
// \/_// robfinch<remove>@finitron.ca
|
// \/_// robfinch<remove>@finitron.ca
|
// ||
|
// ||
|
//
|
//
|
// f2i.v
|
// f2i.v
|
Line 37... |
Line 37... |
input ce,
|
input ce,
|
input [WID-1:0] i,
|
input [WID-1:0] i,
|
output [WID-1:0] o,
|
output [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 ? 10 :
|
|
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 ? 35 :
|
|
WID==44 ? 31 :
|
|
WID==42 ? 29 :
|
|
WID==40 ? 28 :
|
|
WID==32 ? 22 :
|
|
WID==24 ? 15 : 9;
|
|
|
|
|
|
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
|
|
|
// Decompose fp value
|
// Decompose fp value
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.