# Must a word be binary (and never unary)?

I understand that a computer memory sequential word must always include at least two bits so it must be binary and therefore cannot be unary.

Must a word be binary (and never unary)?
That is to ask; can there be a "unary" computer memory sequential word?

This question might relate to my other question - Must a Turing machine tape be binary?

Machine words have fixed length. Denoting the length by $$n$$ and the base by $$b$$, each machine word has $$b^n$$ possible values, and so stores $$\log_2 (b^n)$$ bits of information.

A base can be binary or decimal and so forth; if $$b=1$$ then the machine word has a single possible value, and so stores no information. It would be useless.

Unary encoding is only relevant in contexts where the length is not fixed.

• No. Decimal is base 10, binary is base 2, and so on. Commented Jan 31, 2021 at 8:40
• Unary encoding is only relevant in contexts where the length is not fixed. This is a very interesting read for me; I never read about such situations anywhere, would you say it's part of fringe theories of computer science? Are there computers which at least theoretically work this way and could produce similar output to the one we can get with RAM modeled or Turing-Machine modeled computers?
– Semo
Commented Jan 31, 2021 at 9:56
• It would be a folly to use unary encoding, since it’s exponentially less efficient than other encodings. Commented Jan 31, 2021 at 10:28
• @YuvalFilmus Well that's not entirely true. Unary encoding is used in data compression for symbols where the expected frequency of the symbols follows a geometric distribution. See, for example, Golomb-Rice coding, which is used in inverted index compression, as well as many codecs like FLAC and MP4-ALS. en.wikipedia.org/wiki/Golomb_coding Commented Feb 1, 2021 at 1:55