Hardware Design: SIE
Sign in or create your account | Project List | Help
Hardware Design: SIE Git Source Tree
Root/
| 1 | // ============================================================================= |
| 2 | // COPYRIGHT NOTICE |
| 3 | // Copyright 2006 (c) Lattice Semiconductor Corporation |
| 4 | // ALL RIGHTS RESERVED |
| 5 | // This confidential and proprietary software may be used only as authorised by |
| 6 | // a licensing agreement from Lattice Semiconductor Corporation. |
| 7 | // The entire notice above must be reproduced on all authorized copies and |
| 8 | // copies may only be made to the extent permitted by a licensing agreement from |
| 9 | // Lattice Semiconductor Corporation. |
| 10 | // |
| 11 | // Lattice Semiconductor Corporation TEL : 1-800-Lattice (USA and Canada) |
| 12 | // 5555 NE Moore Court 408-826-6000 (other locations) |
| 13 | // Hillsboro, OR 97124 web : http://www.latticesemi.com/ |
| 14 | // U.S.A email: techsupport@latticesemi.com |
| 15 | // =============================================================================/ |
| 16 | // FILE DETAILS |
| 17 | // Project : LatticeMico32 |
| 18 | // File : lm32_functions.v |
| 19 | // Title : Common functions |
| 20 | // Version : 6.1.17 |
| 21 | // ============================================================================= |
| 22 | |
| 23 | function integer clogb2; |
| 24 | input [31:0] value; |
| 25 | begin |
| 26 | for (clogb2 = 0; value > 0; clogb2 = clogb2 + 1) |
| 27 | value = value >> 1; |
| 28 | end |
| 29 | endfunction |
| 30 |
Branches:
master
