我是靠谱客的博主 坚强黑米,这篇文章主要介绍在verilog中使用clogb2函数可进行log2操作,用来计算数据位宽,现在分享给大家,希望可以做个参考。

//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);


在verilog中使用clogb2函数可进行log2操作,用来计算数据位宽

最后

以上就是坚强黑米最近收集整理的关于在verilog中使用clogb2函数可进行log2操作,用来计算数据位宽的全部内容,更多相关在verilog中使用clogb2函数可进行log2操作内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部