Viewing a single comment thread. View all comments

km89 t1_je1v2k6 wrote

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.

1