Implement XOR Gate in Verilog
Objective
Design and verify a simple 2-input XOR gate using Verilog.
The design should be tested using a testbench that applies all possible input combinations.
Requirements
-
Create a Verilog module named
xor_gatewith:- Two inputs:
a,b - One output:
y - Function:
y = a ^ b
- Two inputs:
-
Write a
testbenchmodule to verify the XOR gate:- Apply all 4 input combinations of
aandb(00, 01, 10, 11). - Observe the output
yfor correctness.
- Apply all 4 input combinations of
No Waveform Data
Submit your Verilog code using Cmd+Enter to see the simulation results and waveform visualization.