1、在使用verilog描述电路时,既可以进行行为级的描述,也可以进行结构级的描述。
      ①行为级描述:侧重对模块行为功能的抽象描述
      ②结构级描述:侧重对模块内部结构实现的具体描述
2、行为级描述
     ①描述体的组成
      ※由多个并行运行的过程块组成。
      ※过程块由过程语句(initial和always)和块语句(串行块begin-end和并行块fork-join)组成。
      ※块语句由过程赋值语句和高级程序语句构成。
            ◇过程赋值语句:阻塞与非阻塞式赋值。
            ◇高级程序语句:C语言如if-else、case、while、wait等组成。
     ②行为级描述模块的构成图
    
 Verilog Code 
//例:全加器行为级描述
module fadder(sum,a,b,cin);//模块定义
output sum,cout;//端口声明
input a,b,cin;//端口声明
reg sum,cout;//数据类型声明

always @(a or b or cin)//过程语句
   
    begin//高级程序语句
      sum=a^b^cin;//过程赋值语句
      cout=(a&b)|(b&cin)|(a&cin);//过程赋值语句
    end
endmodule//结束行
 
3、结构级描述
    ①描述体的组成
        ※门级描述:对由基本逻辑门(and、or、not、xor等)互连而成的具有一定功能的电路模块的描述。
        ※结构级描述:将上述逻辑门用一个个功能模块替换,就拓展到一般意义的结构级描述。
    ②结构级描述模块
      例:全加器门级
      
 Verilog Code 
//例:全加器结构级描述
module fadder(sum,a,b,cin);//模块定义
    output sum,cout;//端口声明
    input a,b,cin;//端口声明
    /*******门级互连*****/
    xor U0(sum,a,b,cin);
    and U1(net1,a,b);
    and U2(net2,a,cin);
    and U3(net3,b,cin);
    or U4(cout,net1,net2,net3);
endmodule//结束行