So, you need log2(width) bits [...].
But, you also have the "all bits are
correct" case which must be
conveyed. So, log2(width)+1 are required.
Yes, basic counting proofs make it clear that that many are necessary.
It is not obvious to me that they are sufficient - but then, I've never
really studied coding theory; it's quite possible there is a known way
of constructing a suitable code for any word size.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse at rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B