1 Star 0 Fork 0

打野/Verilog练习代码

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
practice_24.1.19(改正).v 922 Bytes
一键复制 编辑 原始数据 按行查看 历史
打野 提交于 2024-01-23 23:44 +08:00 . 2024-1-23
//2024-1-19 姜青羊
//8位补码转换默写
`timescale 1ns/10ps
module comp_conv (
A,
A_comp
);
input[7:0] A;
output[7:0] A_comp;
wire[6:0] b;
wire[6:0] c;
wire[7:0] D;
assign b=~A[6:0]
assign c=b+1;
assign D={A[7],c};
assign A_comp=A[7]?D:A;
endmodule
//----------testbench------------
module tb_comp_conv ();
reg[7:0] aa;
wire[7:0] cc;
initial begin
aa=8'b0000_0000;
#3000 $stop;
end
always #10 aa=aa+1;
comp_conv u_comp_conv (
.A(aa),
.A_comp(cc)
);
endmodule
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fight_wild/verilog-code.git
git@gitee.com:fight_wild/verilog-code.git
fight_wild
verilog-code
Verilog练习代码
master

搜索帮助