Está en la página 1de 1

module subtractor(output b,d, input x,y);

wire w1;
xor(d,x,y);
not(w1,x);
and(b,w1,y);

endmodule

module halfsub_tb;
reg x,y;
wire b,d;

subtractor s(b,d,x,y);
integer i;
initial
begin

for(i=0;i<4;i=i+1)
begin
{x,y}=i;
#10;
end
end

endmodule

También podría gustarte