次のAND/OR回路を作成する

真理値表
A B S F
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 1
0 0 1 0
0 1 1 1
1 0 1 1
1 1 1 1

module cir_andor(A,B,S,F);
 input A;
 input B;
 input S;
 output F;

 reg F;

always @(A,B,S)
begin
case(S)
1'b0:F<=A&B;
1'b1:F<=A|B;
default: F<= 1'b0;
endcase
end
endmodule
最終更新:2009年06月16日 00:00