module add-half(sum,c_out,a,b);
input a,b;
output sum,c_out;
wire c_out_bar; // 內部接線
xor(sum,a,b);
nand(c_out_bar,a,b);
not(c_out,c_out_bar);
endmodule
------------------------------------------
Behavioral model 行為模式
always
begin
sum = a + b;
c = a & b;
end
沒有留言:
張貼留言