If bits are continuous how can computers tell them apart?

375 viewsOtherTechnology

If bits are just a signal that switches from being on to being off, how does a computer know to interpret how many bits are being represented by each switch? Like, for example, how does a computer know a message is 0100011001 instead of just 010101. Also, if a message starts with a 0, how does a computer know to include in the message? Also, how does a computer know when one message ends and another begins?

In: Technology

7 Answers

Anonymous 0 Comments

One way is to have a clock signal on another wire. When the clock wire has a *rising/falling edge* (the short moment when it switches from 0 to 1 or the reverse, depends on protocol which – or both – are used), the reading device checks the state of the other line(s) and notes the value as a bit.

The other is either agreeing on a fixed bitrate and just sampling the line each X microseconds from the start of the message, or *detecting the speed* from how often the voltage flips on the data line on average.

The 0-start problem and the initial detection of the clock speed is solved by using “start bits” – basically each message starts with one or more bits that are just meant to notify the receiver to prepare for the rest of the message. For a fixed bitrate protocol like UART, it’s usually just one start bit to alert the receiver. For something that uses clock recovery like Ethernet, a longer sequence is used: every Ethernet message begins with 56 bits of alternating 1s and 0s to allow the receiver to synchronize their clock to the sender.

In addition to the longer start sequence, clock recovery protocols that deal with longer messages sometimes use a more complex way to encode the message than just straight dumping binary digits as high and low voltages. This lets them even out the density of high and low voltage signals on the line so the receiver doesn’t hit a long stretch of just one value and experience clock drift without the ability to re-sync.

You are viewing 1 out of 7 answers, click here to view all answers.