Reading Quadrature input Encoder;Synchrous Logic

Do some reading on the out-of-phase nature of quadrature encoder tracks. When you see a picture of the two square "waves" it will all make sense.

Long story short:

When A goes high
  if B is high
    moving forward
  if B is low
    moving backward

But I still highly recommend looking at a diagram of the tracks to see why this is.