Varicode2 sugestion

24 views
Skip to first unread message

rijkard rijkard

unread,
Jun 27, 2025, 2:06:25 PMJun 27
to bpsk31.com Discussion list
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

Message has been deleted

rijkard rijkard

unread,
Jun 27, 2025, 2:18:28 PMJun 27
to bpsk31.com Discussion list

Follow table, better seen with monospaced font.

--3 bits ------------------
1 = 1 2                     SP          can be 011 or 100
quantity = 1
--4 bits ------------------
2 = 1 3                     e           can be 0111 or 1000
3 = 2 2                     o           can be 0100 or 1011
quantity = 2 (1+1)  --->  fibonacci terms sum
--5 bits ------------------
4 = 1 4                     t           can be 01111 or 10000

5 = 1 2 2                   a           can be 01100 or 10011
6 = 2 3                     i

7 = 3 2                     n
quantity = 4 (1+1+2)  --->  fibonacci terms sum
--6 bits ------------------
8 = 1 5                     LF
9 = 1 3 2                   CR
10 = 1 2 3                  l
11 = 2 4                    r
12 = 2 2 2                  s
13 = 3 3                    -
14 = 4 2                    c
quantity = 7 (1+1+2+3)
--7 bits ------------------
15 = 1 6                    d
16 = 1 4 2                  f
17 = 1 3 3                  h
18 = 1 2 2 2                m           can be 0110011 or 1001100
19 = 1 2 4                  p
20 = 2 5                    u
21 = 2 3 2                  ,
22 = 2 2 3                  .
23 = 3 4                    =
24 = 3 2 2                  A
25 = 4 3                    E
26 = 5 2                    I
quantity = 12 (1+1+2+3+5)
--8 bits ------------------
27 = 1 7                    S
28 = 1 5 2                  T

29 = 1 4 3                  b
30 = 1 3 2 2                g
31 = 1 3 4                  v
32 = 1 2 2 3                w
33 = 1 2 3 2                Y
34 = 1 2 5                  HT
35 = 2 6                    (
36 = 2 4 2                  )
37 = 2 3 3                  0
38 = 2 2 2 2                1
39 = 2 2 4                  2
40 = 3 5                    3
41 = 3 3 2                  :
42 = 3 2 3                  B
43 = 4 4                    C
44 = 4 2 2                  D
45 = 5 3                    F
46 = 6 2                    G
quantity = 20 ((1+1+2+3+5+8)
--9 bits ------------------
47 =1 8                     L
48 =1 6 2                   M
49 =1 5 3                   N
50 =1 4 2 2                 O
51 =1 4 4                   P
52 =1 3 2 3                 R
53 =1 3 3 2                 k
54 =1 3 5                   x
55 =1 2 2 4                 !
56 =1 2 2 2 2               "
57 =1 2 3 3                 #
58 =1 2 4 2                 $
59 =1 2 6                   '
60 =2 7                     *
61 =2 5 2                   +
62 =2 4 3                   /
63 =2 3 2 2                 4
64 =2 3 4                   5
65 =2 2 2 3                 6
66 =2 2 3 2                 7
67 =2 2 5                   8
68 =3 6                     9
69 =3 4 2                   ;
70 =3 3 3                   <
71 =3 2 2 2                 >
72 =3 2 4                   H
73 =4 5                     J
74 =4 3 2                   K
75 =4 2 3                   Q
76 =5 4                     U
77 =5 2 2                   V
78 =6 3                     W
79 =7 2                     X
quantity = 33
--10 bits ------------------
80 =1 9                         Y
81 =1 7 2                       [
82 =1 6 3                       \
83 =1 5 2 2                     ]
84 =1 5 4                       _
85 =1 4 2 3                     j
86 =1 4 3 2                     q
87 =1 4 5                       z
88 =1 3 2 4                     |
1 3 2 2 2                   NUL
1 3 3 3                     SOH
1 3 4 2                     STX
1 3 6                       ETX
1 2 2 5                     EOT
1 2 2 3 2                   ENQ
1 2 2 2 3                   ACK
1 2 3 4                     BEL
1 2 3 2 2                   BS
1 2 4 3                     VT
1 2 5 2                     FF
1 2 7                       SO
2 8                         SI
2 6 2                       DLE
2 5 3                       DC1
2 4 2 2                     DC2
2 4 4                       DC3
2 3 2 3                     DC4
2 3 3 2                     NAK
2 3 5                       SYN
2 2 2 4                     ETB
2 2 2 2 2                   CAN
2 2 3 3                     EOM
2 2 4 2                     SUB
2 2 6                       ESC
3 7                         FS
3 5 2                       GS
3 4 3                       RS
3 3 2 2                     US
3 3 4                       %
3 2 2 3                     &
3 2 3 2                     ?
3 2 5                       @
4 6                         Z
4 4 2                       ^
4 3 3                       `
4 2 2 2                     {
4 2 4                       }
5 5                         ~
5 3 2                       DEL
5 2 3                      
6 4
6 2 2
7 3
8 2
quantity = 54
--------------------
... 

Program to generate this table isn't hard to be developed because it's based in fibonacci.

rijkard rijkard

unread,
Jun 27, 2025, 4:09:01 PMJun 27
to bpsk31.com Discussion list
Errata:
By some reason, online translator changed sequence, sorry. I didn't find an way to edit previous post:

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"         <-- this is wrong in previously post.

Correct is:
011110001001101011011001010010011           <-- this is correct.
Reply all
Reply to author
Forward
0 new messages