The input is a stream of received PS/2 bytes. A packet begins at a byte whose bit 3 is high; ignore earlier bytes. Store that start byte followed by the next two bytes, then pulse done for one cycle and return to searching. packet(23:16) is the first byte and packet(7:0) is the third.