bitwise.comp
1 component bitwise "Computes various bitwise operations on the two input values"; 2 pin in u32 in0 "First input value"; 3 pin in u32 in1 "Second input value"; 4 pin out u32 out-and "The bitwise AND of the two inputs"; 5 pin out u32 out-or "The bitwise OR of the two inputs"; 6 pin out u32 out-xor "The bitwise XOR of the two inputs"; 7 pin out u32 out-nand "The inverse of the bitwise AND"; 8 pin out u32 out-nor "The inverse of the bitwise OR"; 9 pin out u32 out-xnor "The inverse of the bitwise XOR"; 10 11 author "Andy Pugh"; 12 license "GPL 2+"; 13 function _ nofp; 14 ;; 15 16 out_and = (in0 & in1); 17 out_nand = ~out_and; 18 out_or = (in0 | in1); 19 out_nor = ~out_or; 20 out_xor = (in0 ^ in1); 21 out_xnor = ~out_xor;