manchaster_adder(a,b,inflg,n) { allzero=and(); for (i=0;i0) { cell[i].input(bufif(cell[i-1] , xor(a[i],b[i]).out).out); } else { cell[0].input(bufif(inflg.cy, xor(a[i],b[i]).out).out); } cell[i].input( bufif( 1 , and(a[i],b[i]).out).out); cell[i].input( bufif( 0 , nor(a[i],b[i]).out).out); result[i]=xor( a[i],b[i],cell[i].node.out).out; } flags.zero=allzero.out; flags.cy=cell[n-1].out; flags.ov=xor(cell[n-1].out,cell[n-2].out); }