(toc) #title=(Table of Content)
Basic of NOT Gate
Logic Symbol
Truth Table
Input A |
Output Y= |
---|---|
0 | 1 |
1 | 0 |
- When the input A is 0, the output Y is 1.
- When the input A is 1, the output Y is 0.
Boolean Equation
Timing Diagram
Gate Level Modeling
Verilog Code in Gate-Level Modeling
module not_gate (
input A, // Input signal
output Y // Output signal
);
// Gate-level modeling of NOT gate
not (Y, A);
endmodule
Data Flow Modeling
Verilog Code in Dataflow modeling
module not_gate (
input A,
output Y
);
// Dataflow modeling using a NOT gate
assign Y = ~A;
endmodule
Behavioral Modeling
Verilog Code in Behavioral Modeling
module not_gate (
input A,
output Y
);
// Behavioral modeling using an if-else statement
always @*
begin
if (A == 0)
Y = 1;
else
Y = 0;
end
endmodule
RTL Schematic of NOT Gate

- Input (A): The input labeled “A” represents a binary signal (either 0 or 1).
- Output (Not A): The output labeled “Not A” provides the logical negation of the input. If A is 0, then Not A is 1, and vice versa.
Functionality:
- When the input A is 0, the NOT gate allows current to flow through the path connected to “Not A,” resulting in a high output (1).
- Conversely, when A is 1, the NOT gate blocks current flow to “Not A,” resulting in a low output (0).
Testbench of NOT Gate
`timescale 1ns / 1ps
module tb_not_gate;
// Inputs
reg A;
// Outputs
wire Y;
// Instantiate the module under test (NOT gate)
not_gate uut (
.A(A),
.Y(Y)
);
// Stimulus generation
initial begin
// Initialize inputs
A = 0;
// Apply input values and observe outputs
// Test case 1: Input 0
#10; // Wait 10 time units
A = 0;
$display("Input A = %b, Output Y = %b", A, Y);
// Test case 2: Input 1
#10; // Wait 10 time units
A = 1;
$display("Input A = %b, Output Y = %b", A, Y);
// Add more test cases as needed
// End simulation
#10; // Wait 10 time units before ending simulation
$finish;
end
endmodule
Waveform of the NOT Gate

Questions and Answers
Q: What is NOT gate formula?
A: The formula for a NOT gate is
Q: What is the symbol for NOT gate?
A: The symbol for a NOT gate is a triangle with a small circle at its input.
Q: What is AND gate in Verilog?
A: In Verilog, an AND gate is described using the &
operator. For example:
assign Y = A & B;
Q: What are the codes of logic gates?
A: The Verilog codes for basic logic gates are:
- AND gate:
assign Y = A & B;
- OR gate:
assign Y = A | B;
- NOT gate:
assign Y = ~A;
Q: How to use a NOT gate?
A: To use a NOT gate, apply the input signal to the gate's input pin, and the output pin will provide the inverted output of the input signal.
Q: What is NOT gate truth value?
A: The truth table for a NOT gate is:
A | Y
-----
0 | 1
1 | 0
Q: Can a NOT gate have two inputs?
A: No, a NOT gate accepts only one input.
Q: What is the IC for NOT gate?
A: Common ICs (Integrated Circuits) for NOT gates include:
- 7404: Hex Inverter IC
- 74LS04: Low-Power Schottky Hex Inverter IC