当前位置:网站首页>数字IC设计经验整理(二)
数字IC设计经验整理(二)
2022-06-24 19:42:00 【皮皮宽】
数字IC设计经验整理(二)
一、verilog乘一个常数的优化
verilog乘一个常数,可以用移位和加法运算来完成
;
比如 b = a * 5 可以写为 b = a << 2 + a;
若a为2bits的数据,则可以写为 b = {a , a};
二、verilog中参数定义的位置
verilog中参数的定义有如下两种方式:
module u_test#(
parameter BW = 10)
(a, b, c);
Input [BW -1 : 0] a;
Input [BW -1 : 0] b;
output [BW -1 : 0] c;
module u_test(a, b, c);
Input [BW -1 : 0] a;
Input [BW -1 : 0] b;
output [BW -1 : 0] c;
parameter BW = 10;
这两种方式均可;但如果我们想在括号内定义端口位宽时,参数就必须采用如下的定义方式
:
module u_test#(
parameter BW = 10)
(
Input [BW -1 : 0] a;
Input [BW -1 : 0] b;
output [BW -1 : 0] c);
三、低功耗设计:门控时钟
在数字IC设计中,常用门控时钟来降低系统功耗。比如状态机模型,状态机中的所有模块并不需要同时且一直工作,因此我们可以令模块的时钟信号u_clk = fclk && u_en; 其中,u_clk为该模块的时钟信号,u_en为该模块的使能信号,fclk为系统时钟,只有使能信号为真时,模块的时钟信号u_clk才会翻转,从而减少系统功耗
;
四、单比特变量可以不用定义?
Wire 单bit变量不需要定义;
module(
input a,
output b);
assign c = a;
assign b = c;
endmodule
虽然没有定义c,但不会保错;仅仅wire类型的单bit变量不需要定义,reg任意bit都需要定义,端口变量默认为wire类型
边栏推荐
- laravel学习笔记
- laravel 宝塔安全配置
- Attention, postgraduate candidates! They are the easiest scams to get caught during the preparation period?!
- Design and implementation of spark offline development framework
- Parental delegation mechanism
- Servlet
- laravel model 注意事项
- [untitled]
- Talk about GC mechanism often asked in interview
- China Sky Lantern market trend report, technical dynamic innovation and market forecast
猜你喜欢
2022 safety officer-b certificate examination question bank and answers
京东618会议平板排行榜公布,新锐黑马品牌会参谋角逐前三名,向国货老大华为学习
Talk about GC mechanism often asked in interview
Mycms we media CMS V3.0, resource push optimization, new free template
关于某手滑块的一些更新(6-18,js逆向)
Dynamic menu, auto align
[text data mining] Chinese named entity recognition: HMM model +bilstm_ CRF model (pytoch) [research and experimental analysis]
What kind of processor architecture is ARM architecture?
记录一下MySql update会锁定哪些范围的数据
JD 618 conference tablet ranking list announced that the new dark horse brand staff will compete for the top three, learning from Huawei, the leader of domestic products
随机推荐
Laravel scheduled task
Recommended movies: Northeast tiger, licorice pizza
推送Markdown格式信息到釘釘機器人
Listen to the markdown file and hot update next JS page
監聽 Markdown 文件並熱更新 Next.js 頁面
07_SpingBoot 实现 RESTful 风格
Design and implementation of spark offline development framework
【nvm】
EPICS記錄參考3 -- 所有記錄都有的字段
Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training
Push markdown format information to the nailing robot
Recommended course: workplace writing training
监听 Markdown 文件并热更新 Next.js 页面
力扣解法汇总515-在每个树行中找最大值
Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
How to integrate Huawei cloud function services in fluent
2022 safety officer-a certificate examination questions and answers
F29oc analysis
laravel 添加helper文件
What kind of processor architecture is ARM architecture?