If digital data is stored in 0s & 1s, how does the reader know how many of the digits to take into consideration?

902 views

Must be a very basic and dumb question. But ‘1001’ can be 9 and also 2 & 1 if ’10’ & ’01’ is taken seperately. I’m confused.

In: 49

48 Answers

Anonymous 0 Comments

Depends on what it’s reading. If it knows in advance to expect ASCII text, then it will count out 8 bits to each letter.

The simplest ruleset which doesn’t limit you at all would be that, after ten letters, there is a single bit which says whether or not the message continues. This ruleset is inefficient as hell but shows a simple solution.

Anonymous 0 Comments

You’re completely correct that it could either be 9 or a 2 then a 1. The issue is that you’re assuming that the is no context.

In storage, there are conventions (e.g. ASCII) that say that basic text is 8 bits per letter. Similarly, other data is stored in fixed-length intervals.
In RAM, whoever is writing to it determines how it is used. It could be any length. The program (and programmer) using it needs to make sure they’re using it correctly.

There are also ways to compress things like text, where bit length is dynamic. But that’s a bit complex, so let me know if you want that explanation as well.

Anonymous 0 Comments

Depends on what it’s reading. If it knows in advance to expect ASCII text, then it will count out 8 bits to each letter.

The simplest ruleset which doesn’t limit you at all would be that, after ten letters, there is a single bit which says whether or not the message continues. This ruleset is inefficient as hell but shows a simple solution.

Anonymous 0 Comments

Not dumb, a great question.

On the microprocessor level the hardware is designed to always read a certain number of digits, called “bits” in this case, and 4 bits become a “nibble”, 8 bits are a “byte”.

So a 16 bit microprocessor would read the value “one” as

0000 0000 0000 0001

and read “ten” as

0000 0000 0000 1010

So in older days, the processor size was a big deal, I played a lot of video games so I remember that the Nintendo was 8-bit, we then 16-bit systems (Sega and Super Nintendo). and then 32/64 bit processors with Nintendo 64, etc.

For the most part we’ve stuck at 64 bit for our processors for many reasons.

Anonymous 0 Comments

Depends on what it’s reading. If it knows in advance to expect ASCII text, then it will count out 8 bits to each letter.

The simplest ruleset which doesn’t limit you at all would be that, after ten letters, there is a single bit which says whether or not the message continues. This ruleset is inefficient as hell but shows a simple solution.

Anonymous 0 Comments

It’s divided up, and any remaining space is filled with zeroes.

You may have heard the terms “bit,” “byte,” “megabyte,” etc. A bit is one digit; a byte is 8 digits, and multiples of that are named with their SI prefixes (“kilobyte”, “gigabyte”, etc).

So when the computer reads, it’s reading in multiples of 8 digits. In your case, the computer might read one byte that has the binary data “1001” stored in it. To the computer, this would show up as “00001001”, but 2 would just be “00000010” and 1 would be “00000001.”

Note that I’m talking about bytes for simplicity, but computers generally run off a “word” size (which is itself some multiple of 8 bits), and sometimes the first digit is flipped to 1 even if the data doesn’t fill the whole space. You can ignore that for now, that’s not important for this answer. Specifics aside, the point is that the computer is reading specific numbers of digits at a time and the data is padded with 0s if it doesn’t fill all of the digits the computer’s reading.

Anonymous 0 Comments

At the absolute lowest level, it’s built into the architecture of the system – when we say a “32-bit” or “64-bit” processor or architecture, what we are saying is that the native instruction set is encoded in that number of bits, with a bit being a discrete 1 or 0 – in other data sets that don’t need that much, we will have code that defines the length of a piece of data.

Anonymous 0 Comments

You’re completely correct that it could either be 9 or a 2 then a 1. The issue is that you’re assuming that the is no context.

In storage, there are conventions (e.g. ASCII) that say that basic text is 8 bits per letter. Similarly, other data is stored in fixed-length intervals.
In RAM, whoever is writing to it determines how it is used. It could be any length. The program (and programmer) using it needs to make sure they’re using it correctly.

There are also ways to compress things like text, where bit length is dynamic. But that’s a bit complex, so let me know if you want that explanation as well.

Anonymous 0 Comments

You’re completely correct that it could either be 9 or a 2 then a 1. The issue is that you’re assuming that the is no context.

In storage, there are conventions (e.g. ASCII) that say that basic text is 8 bits per letter. Similarly, other data is stored in fixed-length intervals.
In RAM, whoever is writing to it determines how it is used. It could be any length. The program (and programmer) using it needs to make sure they’re using it correctly.

There are also ways to compress things like text, where bit length is dynamic. But that’s a bit complex, so let me know if you want that explanation as well.

Anonymous 0 Comments

It’s divided up, and any remaining space is filled with zeroes.

You may have heard the terms “bit,” “byte,” “megabyte,” etc. A bit is one digit; a byte is 8 digits, and multiples of that are named with their SI prefixes (“kilobyte”, “gigabyte”, etc).

So when the computer reads, it’s reading in multiples of 8 digits. In your case, the computer might read one byte that has the binary data “1001” stored in it. To the computer, this would show up as “00001001”, but 2 would just be “00000010” and 1 would be “00000001.”

Note that I’m talking about bytes for simplicity, but computers generally run off a “word” size (which is itself some multiple of 8 bits), and sometimes the first digit is flipped to 1 even if the data doesn’t fill the whole space. You can ignore that for now, that’s not important for this answer. Specifics aside, the point is that the computer is reading specific numbers of digits at a time and the data is padded with 0s if it doesn’t fill all of the digits the computer’s reading.