当前位置:网站首页>Mux256to1v,Hadd,Fadd
Mux256to1v,Hadd,Fadd
2022-07-19 09:35:00 【Shanghai style sweetheart】
Create a 4-bit wide, 256-to-1 multiplexer. The 256 4-bit inputs are all packed into a single 1024-bit input vector. sel=0 should select bits in[3:0], sel=1 selects bits in[7:4], sel=2 selects bits in[11:8], etc.
There are several ways
module top_module(
input [1023:0] in,
input [7:0] sel,
output [3:0] out );
assign out = {in[sel*4+3], in[sel*4+2], in[sel*4+1], in[sel*4+0]};
endmodulemodule top_module(
input [1023:0] in,
input [7:0] sel,
output [3:0] out );
assign out = in[sel*4 +: 4];// from sel*4 Start , Select bit number greater than sel*4 Of 4 A bit , amount to [sel*4+3:sel*4]
endmodulemodule top_module(
input [1023:0] in,
input [7:0] sel,
output [3:0] out );
assign out = in[sel*4+3 -: 4]; // from sel*4+3 Start , Select bit number less than sel*4+3 Of 4 A bit , amount to [sel*4+3:sel*4]
endmoduleCreate a half adder. A half adder adds two bits (with no carry-in) and produces a sum and carry-out.
module top_module(
input a, b,
output cout, sum );
assign {cout,sum} = a + b;
endmodule
Create a full adder. A full adder adds three bits (including carry-in) and produces a sum and carry-out.
module top_module(
input a, b, cin,
output cout, sum );
assign{cout,sum} = a + b + cin;
endmodule
边栏推荐
- AnyControl Demo演示
- 565. Array nesting
- Latest fruit flstudio20.9 low version upgrade high version tutorial
- Static routing!! Static routing!! Static routing!!
- 在Pycharm里面如何避免全局索引?如何取消对于某个文件夹的索引?
- Mysqldump full recovery to another new instance, and then perform flush privileges analysis
- MySQL升级为主备,如何同步历史数据?
- R语言data.table导入数据实战:data.table使用dcast.data.table函数实现透视表(pivot table)
- 【C语言】指针练习题2——笔试真题及解析
- 07---布儒斯特角
猜你喜欢

Un7.16: how to deploy projects on code cloud and invite team members?
![[Luogu] p2357 tomb keeper](/img/89/34f543d9838293508252a3701f2db5.jpg)
[Luogu] p2357 tomb keeper

el-table 列拖拽(无须引入其他插件)

MySQL user management

MySQL--SQL优化案例--隐式字符编码转换

Questions d'entrevue - concevoir des cas d'essai pour:: memcpy

Line Flow Based Simultaneous Localization and Mapping

DuiLib 实现tooltip自定义鼠标提示窗口

【ACWing】947. text editor

LDA classifier
随机推荐
Static routing!! Static routing!! Static routing!!
Chapter VIII vector of STL
如何快速计算生成模型的FID、IS、sFID、Precision、Recall等关键评价指标?
Classificateur knn
Chapter 10 stack of STL
cookie和session在实际项目中的使用
C——指针
Day 5 training
Anaconda与Jupyter Notebook入门级详细使用教程
MySQL user management
Interview questions - design test cases for:: memcpy function
Chapter IX deque of STL
Daily model series: July 11, 2022
第十一章 STL 之 queue
un7.16:如何在码云上部署项目并邀请组员?
【洛谷】P2357 守墓人
Microservice splitting for stand-alone projects
Etcd database source code analysis -- etcdserver bootstrap recover store from snapshot
多租户 SaaS 的数据库设计模式,你学废了吗?
Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable exact version “11.4“)