Verilog简单的组合逻辑设计
2015-06-01 22:37
316 查看
先用notepad++写好模块源代码,代码如下:
测试模块用于检测模块设计是否正确,代码如下:
组合逻辑仿真波形如下:
由仿真图可知,模块设计正确。
module compare(equal,a,b); input a,b; output equal; assign equal = (a==b)?1:0; endmodule
测试模块用于检测模块设计是否正确,代码如下:
`timescale 1ns/1ns //`include "./compare.v" module t; reg a,b; wire equal; initial begin a = 0; b = 0; #100 a=0; b=1; #100 a=1; b=1; #100 a=1; b=0; #100 a=0; b=0; #100 $stop; end compare m(.equal(equal),.a(a),.b(b)); endmodule
组合逻辑仿真波形如下:
由仿真图可知,模块设计正确。
相关文章推荐
- MVVM on Android
- FOJ 1147 Tiling
- IOS菜鸟的所感所思(八)——coreData与网络歌曲的本地化
- jquery inArray JSON解析
- JavaScript Array(数组) 对象
- asm数据文件迁移(os–>asm)
- EEliod嵌入式实验5
- c语言学习感受
- 关于TCP/IP协议栈的三次握手,四次挥手
- spring-mongodb-data存储文件
- LeetCode 137:Single Number II
- PHPNG (next generation)
- ABI EABI
- No result defined for action and result input
- 数字地与模拟地
- No result defined for action and result input
- No result defined for action and result input
- [Emacs学习笔记]使用Emacs写c语言并编译运行
- 数据结构之链栈的所有操作
- 3D软引擎之深度排序