当前位置:网站首页>[Verilog] sub module connection related problems (adder and Its Optimization)
[Verilog] sub module connection related problems (adder and Its Optimization)
2022-07-16 06:29:00 【GalaxyerKw】
One . adopt wire Variables achieve the interconnection of different sub modules

We create wire Variable interworking of these sub modules q→d, Then connect the sub module with the top-level module through the port name :
The procedure is as follows :
Write the knowledge you need to know about this program :
① Definition of sub module , Declaration and call ( Instantiation ).
② Connection method between sub module and top layer (by name).
③wire Variables store binary signals , Thus, it plays a role of undertaking .
【 Practice address links :Module shift】
Two . A slightly more complex example

Be careful :
① This example requires not only interconnected sub modules , And it needs to transmit multi bit signals .
② The key step is in the last four 8 Bit signal passes “ Signal selector ”( Trapezoidal element ), And by a two bit signal sel Control output . The realization of signal selector needs the help of [email protected](*) sentence .
The picture below is wire And some names of examples :
The procedure is as follows :
【 Practice address links :Module shift8】
3、 ... and . Design of adder

As shown in the picture 32 The bit adder is a 32 The signal of bit is split into “ high 16 position ” and “ low 16 position ”, Separate operation and integration . among cin and cout Control and control “ carry ”: low 16 The carry of bit operation passes cout Transferred to the cin, low 16 Bit initialization has no carry value , So low 16 Bit adder passed cin==0. therefore , Every adder actually operates a+b+cin.
The above adder is actually “ Full adder ”, Its interior is composed of several “ Half adder ” Made up of :
Each half adder ( In the picture add1) Only two can be operated 1 Addition of bit signals . It's not hard to see. , One “16 Bit full adder ” By 8 individual “ Half adder ” Made up of .
The half adder inputs two one bit signals , Output two signals :“ and ” and “ carry ”, Logic gates are as follows :
sum = a ^ b ^ cin
cout = a&b | a&cin | b&cin
Now? , We do this through code “ Half adder ”:
( We need to consider the logic gate design of half adder , There is no need to consider the connection between half adders )
【 Practice address links :Module fadd】
Four . Adder optimization
“ low 16 position ” The adder passes cout towards “ high 16 position ” Transmit carry signal , The delay in this process is quite large , Need to optimize :
The optimization method is : Make one more copy ” high 16 position “ adder , But a cin=1, the other one cin=0. adopt “ low 16 position ” The output carry signal controls a “ Selectors ”, Choose one “ high 16 position ” The result of the operation , Finally, integrate . This avoids “ high 16 position ” and “ low 16 position ” Signal transmission between adders , Reduced latency .
The specified names are as follows :
The top-level program is as follows :
【 Practice address links :Module cseladd】
边栏推荐
- 电脑常规操作
- [paper notes] - u-net-2015-miccai
- RT_thread互斥量的使用
- POJ 3417 Network (lca+树上差分)
- 【论文笔记】—ResNet—2015-CVPR
- [paper notes] - low illumination image enhancement - zero samples - ruas Network - 2021-cvpr
- [paper notes] - dark video enhancement supervised stablllve network 2021-cvpr
- swiper使用技巧(一)
- 基于RT_thread的分布式无线温度监控系统之SENSOR框架
- 二叉树的各种操作(叶子节点、双亲节点、搜索二叉树、删除二叉树中的节点、二叉树的深度)
猜你喜欢
随机推荐
嵌入式软件开发 STM32F407 蜂鸣器 标准库版
supervisor系列:4、子进程
[paper notes] - conditional motion propagation - self supervised - CMP optical flow prediction - 2019-cvpr
Dense contrast learning for self supervised visual pre training 2021
OPENGL 射线拾取法
[paper notes] - dark video enhancement supervised stablllve network 2021-cvpr
【ICCV2021】Tokens-to-Token ViT: Training Vision Transformers From Scratch on ImageNet
Stm32f429+lan4720a+lwip problem record and solution
[paper notes] - googlenet (inception-v1) - 2015-cvpr
OpenGL ray pickup method
常用学术文献数据库界面及导出参考文献方法
Max3232ese problem record and solution
【PCB】关于电赛——硬件设计和PCB绘制的一些心得(持续更新)
_ button. Enable=no does not work
keil5软件报错 Error: L6406E: No space in execution regions with .ANY selector matching xxx
POJ 3728 The merchant (在线查询+倍增lca)
typedef和define具体的具体差别
【论文笔记】—条件运动传播—Self-Supervised—CMP光流预测—2019-CVPR
[matlab] matlab lesson 3 - advanced drawing
虚拟内存位置结构(保留区、代码区、栈区、堆区、字面值常量区)与变量修饰符(const、auto、static、register、volatile、extern)



![[paper notes] - u-net-2015-miccai](/img/c4/8faeb9cb3aac1761f53a1ef72082f8.png)





