A simple example will get us started. We use a classical "Hello, world'' example, which will do nothing meaningful except printing a text string. The code for the example is shown in Figure 1. The code for the example is from the Icarus Verilog User Guide. We will start using Icarus Verilog in Section Getting some tools.
module main; initial begin $display("Hello, world"); $finish; end endmodule
Figure 1. A hello world example in Verilog.
The code in Figure 1 contains a module, which is named main.
We remark that the code in Figure 1 generates an artificial, simulated behavior. It does not provide any code that can be used for synthesizing actual hardware.