Contact bounce prevents reliably counting repeated presses of the same button. Therefore, for a binary encoding, we need at least three buttons.
Assume we wish to encode each symbol with a unique button sequence.
We need the last button of one sequence to be different from the first button of the next.
For three buttons, this means all sequences must end with the same button or begin with the same button, which is weird.
For four or more buttons (and 3 actually), each sequence must begin in one half partition and end in the other. Building a Huffman tree gets weird.
(Two buttons plus backspace to cancel an accidentally repeated keypress works well in practice.)
No comments :
Post a Comment