门级风格的描述
//二选一数据选择器的门级风格描述
module mux_str(out,a,b,sel);
input a,b,sel; //输入端口声明
output out; //输出端口声明
not gate(net1,sel); //非门gate中,net1是输出,sel是输入
and gate2(net2,a,net1);//与门gate2中,net2是输出,a和net1是输入
and gate3(net3,b,sel); //与门gate3中,net3是输出,b和sel是输入
or gate4(out,net2,net3);
endmodule
数据流风格的描述
数据流风格描述方式