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

Subversion Repositories ft816float

[/] [ft816float/] [trunk/] [rtl/] [verilog2/] [fpSize.sv] - Blame information for rev 29

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 robfinch
`ifndef EXTRA_BITS
2
`define EXTRA_BITS      0
3
`endif
4
 
5
// This file contains defintions for fields to ease dealing with different fp
6
// FPWIDths. Some of the code still needs to be modified to support FPWIDths
7
// other than standard 32,64 or 80 bit.
8
localparam MSB = FPWID-1+`EXTRA_BITS;
9
localparam EMSB = FPWID==128 ? 14 :
10
          FPWID==96 ? 14 :
11
          FPWID==80 ? 14 :
12
          FPWID==64 ? 10 :
13
                                  FPWID==52 ? 10 :
14
                                  FPWID==48 ? 10 :
15
                                  FPWID==44 ? 10 :
16
                                  FPWID==42 ? 10 :
17
                                  FPWID==40 ?  9 :
18
                                  FPWID==32 ?  7 :
19
                                  FPWID==24 ?  6 : 4;
20
localparam FMSB = FPWID==128 ? (111 + `EXTRA_BITS) :
21
          FPWID==96 ? (79 + `EXTRA_BITS) :
22
          FPWID==80 ? (63 + `EXTRA_BITS) :
23
          FPWID==64 ? (51 + `EXTRA_BITS) :
24
                                  FPWID==52 ? (39 + `EXTRA_BITS) :
25
                                  FPWID==48 ? (35 + `EXTRA_BITS) :
26
                                  FPWID==44 ? (31 + `EXTRA_BITS) :
27
                                  FPWID==42 ? (29 + `EXTRA_BITS) :
28
                                  FPWID==40 ? (28 + `EXTRA_BITS) :
29
                                  FPWID==32 ? (22 + `EXTRA_BITS) :
30
                                  FPWID==24 ? (15 + `EXTRA_BITS) : (9 + `EXTRA_BITS);
31
localparam FX = (FMSB+2)*2;     // the MSB of the expanded fraction
32
localparam EX = FX + 1 + EMSB + 1 + 1 - 1;

powered by: WebSVN 2.1.0

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