All-optical AND/NAND logic gates based on Ti:PPLN waveguide by cascaded nonlinear optical processes