4.1 简介
非的含义是取反的意思,比如一个事情要发生,那么取反,就是这个事件不会发生。
又称“非电路” 、“逻辑非电路”。
注意:非门有1个输入端,1个输出端。
表达式 F = ~A
国内标准符合
国际标准符合
4.2 任务
通过modelsim软件,分析“或门"的逻辑行为。
4.3 程序设计
下面展示 功能代码
。
`timescale 1ns / 1ps
//
// Company:
// Engineer:
//
// Create Date: 2022/02/15 17:28:25
// Design Name:
// Module Name: and_gate
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//
// Verilog 功能代码如下:
module not_gate(
//input
input a,
//output
output y
);
assign y = ~a ;
endmodule
// Verilog 仿真代码如下:
`timescale 1ns / 1ps
//
// Company:
// Engineer:
//
// Create Date: 2022/02/15 17:40:44
// Design Name:
// Module Name: tb_and_gate
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//
initial begin
sys_clk = 1'b0;
sys_rst_n = 1'b0;
a = 1'b0;
#200
sys_rst_n = 1'b1;
a = 1'b0;
#200
a = 1'b1;
#200
a = 1'b1;
#200
a = 1'b0;
end
always #10 sys_clk = ~sys_clk ;
not_gate u_not_gate(
//input
.a(a),
//output
.y(y)
);
endmodule
4.4 仿真验证
结论:当a为1时,输出y就为1,当a为0时,输出y就为0。
参看文献:正点原子