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

960 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

You need to know the type of data you are dealing with. For example, if you want to open a .wav file, you find the specification (https://ccrma.stanford.edu/courses/422-winter-2014/projects/WaveFormat/) and then you write your program to the specification.

It says first 4 bytes are the ID, then next 4 bytes are the size, then next 4 are the format… etc. etc. etc.

If somebody just hands you a blob of data and tells you to interpret it, then you are correct to be confused. You’d have no idea what the bytes mean.

Also, if you open a file in the wrong program, it interprets the bytes in the wrong way and you just get nonsense. Open a .exe file in notepad and it’s just crazy characters all over the screen.

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