当前位置:网站首页>数字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类型
边栏推荐
- Sword finger offer 42 Maximum sum of successive subarrays
- Financial management [4]
- Solution to the login error of tangdou people
- Research Report on market evaluation and investment direction of Chinese dermatology drugs (2022 Edition)
- Servlet
- The large-scale market of graduate dormitory! Here comes the enviable graduate dormitory!
- Financial management [6]
- Docker-mysql8-master-slave
- laravel用户授权
- Vulnhub Vegeta: 1
猜你喜欢
![[ROS play with turtle turtle]](/img/94/4d1063f063d115aeef5cdf099278f8.png)
[ROS play with turtle turtle]

Cases of addition, deletion, modification and search of C # learning for two years and C # import and export (de duplication)

推送Markdown格式信息到釘釘機器人

vulnhub Vegeta: 1

Non single file component

Pousser l'information au format markdown vers le robot nail

docker安装mysql-简单无坑

Dig deep into MySQL - resolve the non clustered index of MyISAM storage engine

Dynamic menu, auto align

Main cause of EMI - mold current
随机推荐
Research Report on market supply and demand and strategy of ceiling power supply device industry in China
How should we measure agile R & D projects?
2022年安全员-A证考题及答案
Dynamic menu, auto align
C#学习两年的增删改查和C#导入导出(去重)案例
Selection (026) - what is the output of the following code?
Listen to the markdown file and hot update next JS page
Force deduction solution summary 515- find the maximum value in each tree row
Attention, postgraduate candidates! They are the easiest scams to get caught during the preparation period?!
Selection (027) - what is the output of the following code?
记录一下MySql update会锁定哪些范围的数据
Blogs personal blog test point (manual test)
What kind of processor architecture is ARM architecture?
02_SpingBoot 入门案例
2022 safety officer-a certificate examination questions and answers
shopee开店入驻流水如何提交?
Servlet
Second IPO of Huafang group: grown up in Zanthoxylum bungeanum, trapped in Zanthoxylum bungeanum
Recommended course: workplace writing training
Design and implementation of spark offline development framework