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

1.01K 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 would write in known lengths such as “each number will be 8 bits,” as well as extra numbers here and there that might say things like “the first number X is how long the list is, the next X numbers are the list, the number Y after that is how many letters there are, followed by Y number of letters.”

The programmer gets to determine all of these things and make up the rules. It’s what makes things like reverse engineering file formats difficult, since the file could be laid out in any format.

If you want to see this being done in real time, check out the [Metroid Prime Modding Discord](https://discord.gg/AMBVFuf). They’ve been reverse engineering the original GameCube game for years, and recently the remastered dropped so they’re currently in the process of tearing that apart and figuring out how the data is laid out so they can read it.

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