当前位置:网站首页>一般乘法器设计,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)
(
边栏推荐
- verilog 归约操作符
- Chengtong network disk imitation blue playing network disk source code with video tutorial
- The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion
- ThreadLocal thread variable
- Is the securities account of qiniu school really safe and reliable?
- 2022年7月(软考高级)信息系统项目管理师认证招生简章
- 闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题
- Leetcode(142)——环形链表 II
- 闭关修炼(二十四)浅入了解跨域问题
- Déclaration de la variable Typescript - - assertion de type
猜你喜欢
![[untitled]](/img/6e/5dd5dcff89a74f7d367c9186a77268.png)
[untitled]

Dialogue | prospects and challenges of privacy computing in the digital age

互斥量互斥锁

闭关修炼(二十五)基础web安全

Baodawei of the people's Chain: break down barriers and establish a global data governance sharing and application platform

机器人代码生成器之Robcogen使用教程

对话| 数字时代,隐私计算的发展前景与挑战

802.11--802.11n protocol phy

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

Does the SQL server run with administrator privileges? Or run it as a normal user?
随机推荐
The return values of hostname -f and uname -n may be different
Self attention mechanism
51单片机中断与定时器计数器,基于普中科技HC6800-ESV2.0
[microservices openfeign] timeout of openfeign
[untitled]
“国防七校”之一西工大遭境外网络攻击
批量处理实验接触角数据-MATLAB分析
Batch processing of experimental contact angle data matlab analysis
工厂模式和策略模式的区别
io流的总结
名企实习一年要学会的15件事,这样你就省的走弯路了。
递归方法 rbac菜单层级显示 无限极分类
Measure the level of various chess playing activities through ELO mechanism
观察者模式怎么实现
在 RedisTemplate 中使用 scan
New paid Tarot calculation source code (with building tutorial)
mongoDB 持久化
Heavyweight released "FISCO bcos application landing guide"
背包九讲——全篇详细理解与代码实现
启牛学堂让开的证券账户是真的安全靠谱吗?