当前位置:网站首页>一般乘法器设计,verilog code
一般乘法器设计,verilog code
2022-06-29 08:21:00 【嗒曦】
一、前言:
verilog是描述硬件语言,直接使用乘号编译器会优化成乘法器IP。
位宽小,一个周期就可以输出结果,位宽大可以选择流水输出。但是乘法器IP也有限制,位宽限制,未知时序等。
常用乘法实现方式移位相加。例如
A = A<<1 ; //完成A * 2
A = (A<<1) + A ; //对应A * 3
A = (A<<3) + (A<<2) + (A<<1) + A ; //对应A * 15
用一个移位寄存器和一个加法器就可以完成乘以3操作,但是乘以15时就需要使用3个移位寄存器和3个加法器,反向思路也可以使用移位相减的方式。注意:有时候数字电路一个周期内并不能完成多个变量相加,多个相加会导致时序不满足。此时,流水线乘法器就有效果。
二、原理:和十进制类似

被乘数按照乘数对应bit位进行移位累加,即便完成相乘过程。假设一个时钟周期只能完成一次累加,那么乘法计算时间最少恰好是乘数的位宽,建议将位宽窄的数当做乘数。
三、verilog设计
module mult_low
#(parameter N=4,
parameter M=4)
(
边栏推荐
- Batch processing of experimental contact angle data matlab analysis
- How to recover data loss of USB flash disk memory card
- 人民链鲍大伟:打破壁垒,建立全域数据治理共享及应用平台
- 15 things to learn in a year of internship in famous enterprises, so you can avoid detours.
- 关于父母离婚后子女姓名变更有关问题的批复
- P6776-[NOI2020]超现实树
- 开发小技巧-图片资源管理
- 2022年7月产品经理认证招生简章(NPDP)
- 通过ELO机制衡量各类对弈活动水平
- The difference and usage of JS for in loop and for of loop
猜你喜欢

ThinkPHP 6 使用 mongoDB

Memoirs of actual combat: breaking the border from webshell
开发小技巧-图片资源管理

打印服务IP设置方案

TypeScript 变量声明 —— 类型断言

各種級數(調和、幾何)總結

The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion

sql server 用 administrator 权限运行吗?还是以普通用户运行呢?

Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences

io流的总结
随机推荐
P6776-[NOI2020]超现实树
“国防七校”之一西工大遭境外网络攻击
抽象类、接口
2022春夏系列 KOREANO ESSENTIAL重塑时装生命力
P6776-[noi2020] surreal tree
2022年7月(软考高级)信息系统项目管理师认证招生简章
闭关修炼(二十四)浅入了解跨域问题
(III) encoder self attention mask
2022年7月系统集成项目管理工程师认证招生简章
Analysis of c voice endpoint detection (VAD) implementation process
分布式数字身份的几个“非技术”思考
Open an account to buy funds. Is it safe to open an account through online funds-
Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences
TypeScript 變量聲明 —— 類型斷言
CDGA|交通行业做好数字化转型的核心是什么?
各種級數(調和、幾何)總結
Official reply on issues related to the change of children's names after parents' divorce
Matlab usage
实战回忆录:从Webshell开始突破边界
Is it really safe to open a stock account online? Find the answer