基于Verilog的以2为底取对数函数log2(x)
2024-09-02 03:10:14
参考资料:xilinx AXI4 Stream Peripherals 源码
//************************************************************************
Verilog中函数使用方法这里不再赘述,只给出函数原型及其调用方式。
//************************************************************************
//function called clogb2 that returns an integer which has the
//value of the ceiling of the log base 2.
function integer clogb2 (input integer bit_depth);
begin
for(clogb2=0; bit_depth>0; clogb2=clogb2+1)
bit_depth = bit_depth>>1;
end
endfunction
//************************************************************************
localparam WIDTH_SRL = 32;
localparam WIDTH_CNT = clogb2(WIDTH_SRL/8-1);
转载:http://www.eefocus.com/mastershifu2015/blog/16-08/389919_64de0.html
最新文章
- I18n问题 国际化
- ORA-12638:身份证明检索失败
- mysql修改数据库编码(数据库字符集)和表的字符编码的方法
- POJ3928Ping pong[树状数组 仿逆序对]
- 「转」xtrabackup新版详细说明
- Linux 修改IP地址
- Travis-CI与Latex构建开源中文PDF
- Node_JS
- 怒刷DP之 HDU 1176
- LINUX 运维命令
- Centos6.4 mysql安装与配置
- OpenStack Summit Paris 会议纪要 - 11-04-2014
- Spring 入门 AOP
- 引入工程报包导入异常:import javax.servlet.annotation.WebFilter;
- Python中的str与unicode处理方法
- [ExtJS5学习笔记]第三十四节 sencha extjs 5 grid表格之java后台导出excel
- 瞧一瞧!这儿实现了MongoDB的增量备份与还原(含部署代码)
- nvm use 指定版本后无效 win7
- Flask第三篇——安装Flask
- Apache OFBiz 添加样式
热门文章
- HDOJ 4903 The only survival
- 【二分答案】【Heap-Dijkstra】bzoj2709 [Violet 1]迷宫花园
- 【kruscal】【最小生成树】【并查集扩展】bzoj3714 [PA2014]Kuglarz
- scope的范围
- python之装饰器、生成器、内置函数、JSON
- maven-pom-properties
- Android之Activity 生命周期
- 学习Microsoft SQL Server 2008技术内幕:T-SQL语法基础--第4章
- SQL SERVER 常用命令
- 《你不知道的 CSS》之等比例缩放的盒子