mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-10 06:07:28 +03:00
30 lines
1.4 KiB
Verilog
30 lines
1.4 KiB
Verilog
// =============================================================================
|
|
// COPYRIGHT NOTICE
|
|
// Copyright 2006 (c) Lattice Semiconductor Corporation
|
|
// ALL RIGHTS RESERVED
|
|
// This confidential and proprietary software may be used only as authorised by
|
|
// a licensing agreement from Lattice Semiconductor Corporation.
|
|
// The entire notice above must be reproduced on all authorized copies and
|
|
// copies may only be made to the extent permitted by a licensing agreement from
|
|
// Lattice Semiconductor Corporation.
|
|
//
|
|
// Lattice Semiconductor Corporation TEL : 1-800-Lattice (USA and Canada)
|
|
// 5555 NE Moore Court 408-826-6000 (other locations)
|
|
// Hillsboro, OR 97124 web : http://www.latticesemi.com/
|
|
// U.S.A email: techsupport@latticesemi.com
|
|
// =============================================================================/
|
|
// FILE DETAILS
|
|
// Project : LatticeMico32
|
|
// File : lm32_functions.v
|
|
// Title : Common functions
|
|
// Version : 6.1.17
|
|
// =============================================================================
|
|
|
|
function integer clogb2;
|
|
input [31:0] value;
|
|
begin
|
|
for (clogb2 = 0; value > 0; clogb2 = clogb2 + 1)
|
|
value = value >> 1;
|
|
end
|
|
endfunction
|