Verilog Testbench Clock

Try moving clk=0 above the forever loop. Instead of toggling the clock every #10 you’re resetting the clock to 0 every #10 units, and then toggling it instantly. I think that still might work in some cases, but it’s probably not what you intended to do.

What is the difference between reg and wire in a verilog module

Wire:- Wires are used for connecting different elements. They can be treated as physical wires. They can be read or assigned. No values get stored in them. They need to be driven by either continuous assign statement or from a port of a module. Reg:- Contrary to their name, regs don’t necessarily correspond to physical … Read more