RTL Studio Open IDE

Logic Gates

2-Input NAND Gate

A basic 2-input NAND gate implemented in Verilog.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

2-Input NAND Gate is a Verilog reference block in the Logic Gates catalog. AND, OR, XOR, and other combinational gate and boolean logic primitives. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This OpenIP implements a basic 2-input NAND gate using Verilog. It is a fundamental logic gate suitable for educational purposes and basic digital design integration.

This IP provides a verified 2-input NAND gate. It is suitable for basic logic synthesis and simulation. The design is minimal, using a single continuous assignment statement, and includes a comprehensive testbench covering all input combinations.

The module performs the logical NAND operation on two input bits. It outputs a low signal only when both inputs are high.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 2-Input NAND Gate.
  2. Read the Verilog module in the editor. The catalog line for this block: A basic 2-input NAND gate implemented in Verilog.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Ports

PortDirectionWidthDescription
ainput1First input bit
binput1Second input bit
youtput1NAND result

Architecture

The design uses a single continuous assignment statement.

Verification

The testbench verifies all four input combinations.

Test CaseInputsExpected OutputResult
TC10, 01PASS
TC20, 11PASS
TC31, 01PASS
TC41, 10PASS

All test cases passed successfully.

More in Logic Gates

All Logic Gates blocks