HDLbits
Browse Problems

Circuits/Sequential Logic

PS/2 Packet Parser

medium
fsmps2protocol

Search incoming bytes until finding one whose bit 3 is high, which marks the first byte of a packet. Count the next two bytes unconditionally, then pulse done for one cycle before searching again. Reset returns to the search state.