The module definition starts with the keyword module. The module name, port list, port declaration, and optional parameter declaration must appear before other sections, and the endmodule statement must be the last statement of the module. A port is a channel for interaction between the module and the external environment. A port list and a port Declaration are required only when the module has a port. The five components in the module are: Variable declaration, data flow statement, lower-layer module instance, behavior statement block, and task and function. A port is an interface that interacts with the external environment. In the external environment, the module is invisible, and calls to the module can only be performed through its port. This feature provides designers with great flexibility: as long as the interface remains unchanged, modifications within the module will not affect the external environment. The port is often used as a terminal. (Terminal) port list: contains an optional port list in the module definition. If no signal is exchanged between the module and the external environment, no port list is available. Port declaration all ports in the port list must be declared in the module. The ports in the OpenGL have the following three types: input, output, and inout. In OpenGL, all ports are implicitly defined as the wire type. Therefore, if you want a port to have the wire data type, declare it as one of the three types: If the output type is