How to distinguish between bits?

I read a post about differences between synchronous and asynchronous transmission modes.
That post has a picture about how bits flows from terminal to computer in async mode.

But how computer can distinguish between 1s and determine what 1 does actually mean. Is it parity bit, is it start/stop bit or maybe it's start of idle bits? Or just part of data is being transmitted?

• 1s and 0s, are logic levels, where a 0 refers to a 'low' level and a 1 refers to a 'high' level. Since these are just voltage levels, the computer can recognize and operate on these natively. Also, a computer program is usually stored as 0s and 1s before compiling as well, as everything on your computer will be stored that way. However, after compiling, you get a file filled with what is called machine code. Machine code is a list of binary instructions (as opposed to text like the original source code) interpreted by the circuitry in the processor – quintumnia Jul 27 '18 at 16:59

If the computer starts in the middle of the stream, it has no way to know—it will be completely confused.

Fortunately, that's not how the protocol works. The computer and terminal have to sync up before they can communicate. There are a few different ways of doing that, but once they're in sync (which includes agreeing on how long each 1 or 0 should last), they both follow a set pattern.

In this example:

• The terminal starts out holding the line high (sending constant 1s) to indicate that it has nothing to say.
• When the terminal has something to say, it brings the line low for a moment (sending a 0). That's the "start" bit.
• The terminal then sends seven bits for the character: always exactly seven, since it's using ASCII, which is a seven-bit encoding.
• After those seven bits, it sends one additional bit for error checking. This is a 1 if there were an odd number of 1s in the character, and a 0 otherwise. This is the "parity" bit.
• Finally, it pulls the line high again to indicate that it once more has nothing to say.

The computer keeps track of which "mode" the connection is in at all times. If it sees a zero, it might record it as part of the data, or might switch from "idle" mode to "start listening for data" mode, or check the parity: it all depends on what it's seen before.

• Can you recommend a good book or another resource where it is possible to read about sync/async data transmission? – Kenenbek Arzymatov Jul 30 '18 at 10:48