645 three-segment encoding
Telegram encoding seems to be a very mysterious thing. In many battles, it seems that the telegram encoding is deciphered by someone, and then they lose.
In fact, those were all radio telegrams that were deciphered and exposed the combat plan, resulting in defeat.
Because anyone can receive radio waves within a certain range.
There is actually no problem with wired telegraphs. As long as they cannot find your communication line and dock it up, they cannot receive the signal.
Of course, this issue is not necessary to be considered now.
Because no country knows what electricity is now, and no one knows what telegram is.
Therefore, the encoding can be used in the simplest and most obvious way at this moment, as long as your own people can figure it out, and others don’t have to worry about it at all.
So, what is the easiest way to encode it?
The simplest encoding is naturally binary encoding, 0 represents zero in decimal, 1 represents one in decimal, 10 represents two in decimal, 11 represents three in decimal, and so on.
So what is the use of this code in telegram?
If there is only encoding, it is naturally useless. The encoding must have corresponding words.
For example, code 1 corresponds to your character, code 10 corresponds to my character, and code 11 corresponds to other characters.
Taichang explained such a simple code carefully, but Fang Yizhi still didn't understand it.
There is no way, this is his first time to come into contact with such a binary code. In the past, he didn't even know what the meaning of decimal code means. How could he understand binary code at once?
How do you explain this to others?
Taichang thought about it carefully and simply ordered someone to get paper and pen and list a code list for Fang Yizhi.
This encoding table is very simple, with only sixteen numbers in total, and only sixteen words in corresponding.
0000, represents zero in decimal and corresponds to herringbone.
0001 represents one in decimal and corresponds to your character.
0010, represents two in decimal, corresponding to my character.
0011 represents the three in decimal form, corresponding to other characters.
0100, represents the four in decimal, corresponding to the word.
0101, represents five in decimal, corresponding to the word "decimal".
0110, represents the six in decimal system, corresponding to the character entered.
0111, represents the seven in decimal system, corresponding to the word "retrograde".
1000 represents eight in decimal, corresponding to the above word.
1001, represents nine in decimal, corresponding to the following character.
1010, represents the ten in the decimal system, corresponding to the enemy character.
1011 represents the eleven in decimal, corresponding to the character horse.
1100, represents the twelve in decimal, corresponding to typing.
1101, represents the thirteenth in decimal, corresponding to the word "enclosed".
1110, represents the fourteenth in decimal system, corresponding to the word chasing.
1111, represents the fifteenth in decimal, corresponding to the word.
In fact, if he just encodes, he doesn't have to write the middle ones at all. The binary encoding represents the decimal number has nothing to do with the encoding of the telegram. He just needs to write out the corresponding characters directly.
However, in order to let Fang Yizhi understand the meaning of binary encoding, he still added the middle paragraph.
Fang Yizhi's result, when he looked at the encoding table written by Taichang carefully, he showed a hint of suddenness.
He roughly understood the relationship between the binary encoding and the decimal number, but he did not understand the corresponding words behind them very well.
What do these words mean after this?
He looked carefully for a while before he asked carefully: "Master, what are the uses of these words that are in response to later?"
Taichang explained helplessly: "This is what the telegram sends. If you translate the words into codes and send them to the other party through a telegram machine. After the other party receives the telegram code and then translates them into characters in reverse, you will know what the telegram means."
Uh, this one.
Fang Yizhi heard this and began to ponder again.
It seems that he still doesn't understand.
Taichang thought about it and simply picked up his pen and wrote down a code.
1010,000,0100,1111,1011,1000,1101,1000,0101,1100.
After he finished writing, he handed the pen in his hand to Fang Yizhi, and then pointed to the code list above and said, "This is the code that I translated based on the words I want to send. Just look up the code list above and write down the words corresponding to these codes."
OK, this is still very simple.
Fang Yizhi immediately took the brush and wrote the corresponding words one by one under the code.
1010 enemies, 0,000 people, 0,100 people, 1111 came, 1011 horses, 1000 on, 1101 circumference, 1000 on, 0101 go, 1100 fights.
When the enemy comes, go around and fight immediately!
He immediately understood after he finished writing.
It turns out that this code table means this.
It turns out that this telegraph sends messages!
Seeing that he suddenly realized, Taichang couldn't help but say with pride: "How about it, do you understand now?"
I understand, I understand.
Fang Yizhi nodded repeatedly, and suddenly became stunned again.
Immediately afterwards, he fell into deep thought.
Seeing this, Taichang couldn't help but curiously said, "What's wrong?"
Fang Yizhi pointed to the encoding table and thought, "Your Majesty, there are only sixteen words. We need to accurately transmit messages, at least thousands of words of encoding, right?
How to encode the following words? I am afraid that the code for a thousand words will cost more than ten digits?
We sent more than ten zeros and ones in a row, and there is a very likely problem in the middle!"
This is indeed a big problem.
Send a four-digit binary code at a time, and there may be no problem.
If you send a binary code of more than ten digits at a time, there is a very likely problem, because if you don’t, it means zero. If you pause a little in the middle, others will misunderstand and add one more zero!
What should I do about this?
Taichang thought about it, then picked up his pen and wrote eight 1s on the paper, and then calculated carefully.
By this calculation, he couldn't help but frown, 111111111111 is only 255!
In other words, Fang Yizhi's estimation is correct at all. He has to encode thousands of characters, and at least more than ten digits are required.
It seems that using both 1 and 0 are not safe. So, what should I do?
He looked at the switch that sent the signal, then looked at the bell that received the signal, and suddenly had an idea.
By the way, there is another way, click and hold it without letting go!
Clicking it means 0, and pressing it for one second or three seconds means 1, so it is not easy to make mistakes.
Moreover, for the sake of safety, the long code can be sent into several segments.
Thinking of this, he said decisively: "How about this, let's change it, treat the switch as 0, and treat the switch as one or three times when pressing the switch for one or three times without letting go.
Then, we divide an encoding into three segments to send, each segment is four digits, so that the three segments add up to twelve digits, which is enough to encode thousands of words."
Well, it seems that there will be no problem if you change the code method like this and then transmit it in three segments.
The question is, how do you divide this paragraph?
Fang Yizhi thought for a while and asked again: "Master, how do we divide these three paragraphs? How long will it take to stop in the middle? After all, both sides can't speak, and the other side doesn't know whether you are a coded segment or the beginning of the next encoding."
It seems that there is a support for this.
Taichang glanced around and couldn't help but have an idea.
He pointed to the hourglass on the table next to him and said, "We make batches of hourglass that are snapping fingers, and we have made an agreement in advance. The interval between each code is a snap of fingers. After sending a short code, turn the hourglass over and wait until the hourglass timing is over before continuing the next period. If the interval between the middleglass exceeds the time of the fingers, it is the next code."
It takes about five seconds to blink your fingers. When sending a telegram, it is already quite a short time to stop for five seconds, so there should be no misjudgment.
This method is indeed good.
Fang Yizhi thought about it and suggested: "Your Majesty, why not do this? We have agreed that both parties will turn the hourglass over at the same time after sending or receiving a four-code. The one sent before the hourglass timing is the next code, and the one sent after the hourglass timing is the next code."
clever!
This shouldn't cause any errors.
Just list the encoding table and practice it carefully to try long-distance communication.
Thinking of this, Taichang couldn't help but nod and admired: "Very good, just do it. You can quickly compile the code table of all the characters, and at the same time let the Ministry of Works make a batch of hourglasses that snap into fingers. We can try long-distance communication between Beijing and Tongzhou."
This is the prototype of the famous three-stage encoding in later generations.
Chapter completed!