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

Subversion Repositories ft816float

[/] [ft816float/] [trunk/] [rtl/] [verilog2/] [positCntlz.sv] - Blame information for rev 84

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
`include "positConfig.sv"
2
// ============================================================================
3
//        __
4
//   \\__/ o\    (C) 2020  Robert Finch, Waterloo
5
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch@finitron.ca
7
//       ||
8
//
9
//      positCntlz.sv
10
//
11
// This source file is free software: you can redistribute it and/or modify
12
// it under the terms of the GNU Lesser General Public License as published
13
// by the Free Software Foundation, either version 3 of the License, or
14
// (at your option) any later version.
15
//
16
// This source file is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
// GNU General Public License for more details.
20
//
21
// You should have received a copy of the GNU General Public License
22
// along with this program.  If not, see .
23
//
24
// ============================================================================
25
//
26
module positCntlz(i, o);
27
parameter PSTWID = `PSTWID;
28
input [PSTWID-2:0] i;
29
output [$clog2(PSTWID-2):0] o;
30
 
31
generate begin : gClz
32
  case(PSTWID)
33
  16: cntlz16 u1 (.i({i,1'b1}), .o(o));
34
  20: cntlz24 u1 (.i({i,1'b1,4'hF}), .o(o));
35
  32: cntlz32 u1 (.i({i,1'b1}), .o(o));
36
  40: cntlz48 u1 (.i({i,1'b1,8'hFF}), .o(o));
37
  52: cntlz64 u1 (.i({i,1'b1,12'hFFF}), .o(o));
38
  64: cntlz64 u1 (.i({i,1'b1}), .o(o));
39
  80: cntlz80 u1 (.i({i,1'b1}), .o(o));
40
  default:  ;
41
  endcase
42
end
43
endgenerate
44
 
45
endmodule

powered by: WebSVN 2.1.0

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