Analysis of piecewise affine systems with logic states