Codes are based on the below tutorial https://www.nandland.com/verilog/tutorials/tutorial-introduction-to-verilog-for-beginners.html
-
To compile
iverilog file_name.v -o out
-
To run
vvp out
-
To run and visualise testench
iverilog file_name.v -o out
vvp out -lxt2
gtkwave test.vcd