Hi, english is not my mother language, please be patience. Better seen with mono font.
Varicode2
by Ricardo Costa Pinto Andrade.
Released in public domain.
"In binary, from left to right, group bit counts that do not repeat (different) and consecutively repeat (equal)"
I recently discovered this method based on Fibonacci that creates variable-length codes. While searching the internet, I came across varicode.
I suggest a new version of varicode, which I call varicode2. In relation to varicode, it allows sending data using fewer bits, without the need for a symbol separator (since NOT, linear, is used).
Because it is a group of binary digit counts, the smallest code to be formed has 1+2=3 bits. The one (1) is because the count does not repeat, and two (2) is because the count of equal bits repeats.
If we try by brute force all possible combinations with 3 bits in binary, we will have 8 possible combinations.
000 not ok, because there are non repeating bits
001 not ok, because starts (from left to right) with repeating bits
010 not ok, because there are no repeating bits
011 OK, starts with non repeating bits (0) followed by repeating (11) bits
100 OK, ...
101 not ok,
110 not ok,
111 not ok,
We obtain 2 possible valid codes from the 8 possible combinations (011 or 100). These form the first possible code.
With 4 bits, we will have 2 other possible codes, with 5 bits, we will have 4 possible codes, ... .
Because the code requires that it starts with non-repeating bits, a signal can be sent at the beginning of the transmission to have synchronization.
A real example, look table below:
the word "banana"
We choose the initial bit, it can be 0 or 1. I choose bit zero (0).
I look for the letter "b" in the table below.
29 = 1 4 3 b
Since the initial bit chosen was 0, I have the following sequence for this letter (separated by boolean NOT): 01111000
The next letter is "a", so I invert (NOT) the last bit of the previous code.
5 = 1 2 2 a can be 01100 or 10011
Hence, it becomes, 01111000 10011.
The next letter is "n", so I invert (NOT) the last bit of the previous code.
7 = 3 2 n
Resulting in, 01111000 10011 01011
The next letter is "a", so I invert (NOT) the last bit of the previous code.
Resulting in, 01111000 10011 01011 01100
The next letter is "n", so I invert (NOT) the last bit of the previous code.
Resulting in, 01111000 10011 01011 01100 10100
The next letter is "a", so I invert (NOT) the last bit of the previous code.
Resulting in, 01111000 10011 01011 01100 10100 10011.
The final result of encoding the word "banana" results in 33 bits is:
01111000 10011 01011 01100 10100 10011
b     a   n   a   n   a
011110001001101010110010010010011
Looking at the final stream generated, it is easy to see and separate the "symbols" (characters), as they will always start with bits that do not repeat.
In varicode, from what I read, the symbols are separated by 2 or more zero bits. In this version, the symbols are separated by bits that do not repeat. 011110001001101011010010010010011
01111000 10011 01011 01100 10100 10011
Notice that the linearity, sequentiality of the symbols avoids ambiguity. Note the code generated for the letter "a" in the word "banana".
Since bit zero (0) was chosen as the initial bit for the code, then assuming a possible synchronization before the message we could send a sequence of bits that repeat opposite to the initial bit chosen.
SINCRONIZE_WITH_REPEATED_ONES 01111000 10011 01011 01100 10100 10011