position detection

okay thanks a bunch!
the priority encoder is perfect! (if i can figure out how)