How tf does binary code work.

604 views

it’s just a bunch of 0’s and 1’s.. like I can just put a bunch of them and somehow make a sentence??? like what does this mean -> 010100101001010010 (i legit just spammed 0’s and 1’s)

In: 0

26 Answers

Anonymous 0 Comments

I’m only adding onto what others have said.

Computers deal with two kinds of stuff: instructions and data. They’re the verbs and nouns of binary.

If you’re talking about instructions (the programs that run), then the ones and zeros describe locations and what to do when you get to those locations. “At place 010100101001010010, get the number you find and add it to whatever is in built-in place blah.” The instructions have addresses, as do devices (mouse, keyboard, pixels on your monitor).

When you ask what ‘010100101001010010’ means, then we’re talking about the nouns — data. Someone mentioned ASCII earlier, which gives the most basic (US English) assignments of 7-digit binary data to letters, numbers, some punctuation, and some basic formatting (new line, ring a bell, etc).

You provided 18 digits of binary. Most Unicode (the much, much larger set of worldwide character mappings) breaks down into sets of 8 bits (one byte) each. We can simply look up these values in the various Unicode or ASCII charts. Since you have only 18 digits, we can either:

* Pad out zeroes to the left (beginning) of the binary string when we don’t have enough. In other words, a 4-byte (32-bit) Unicode of your ‘010100101001010010’ becomes ‘00000000000000010100101001010010’;
* Convert any smaller sections into pieces for lower-bit values. In your example, we can have:

** 01, 01001010, and 01010010 as separate one-byte values (again, we can pad out zeros in front of any number that is too short);
** 0101, 0010100, and 1010010 for 7-bit ASCII values (which were more important in the data-compression days of dial-up modems);
** or even 010100, 101001, and 010010 for six-bit (uppercase) ASCII.

So let’s pull up [some wiki pages](https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)) and get going! We’ll start with the six-bit sets and get larger bit values as we go.

Notice that the pages refer to ‘U+003F’ instead of ‘00111111’ for a question mark. This is basic conversion of each four binary values to a sixteen-character value, aka hexadecimal. ‘F’ is ‘1111’, ‘2’ is ‘0010’, and so forth. I will refer to the hex values by putting a lowercase ‘h’ after each one.

six-bit:

* 010100 == 18h == ‘CAN’ (the ‘cancel’ character)
* 101001 == 29h == ‘)’ (close-parenthesis)
* 010010 == 12h == ‘DC2’, [device control 2](https://en.wikipedia.org/wiki/C0_and_C1_control_codes), which varies by OS and really does not apply to non-teletype machines.

seven-bit:

* 0000101 == 05h == ‘ENQ’, [the enquiry character](https://en.wikipedia.org/wiki/Enquiry_character). This goes back to the days of teletype machines.
* 0010100 == 14h == ‘DC4’ (see ‘DC2’)
* 1010010 == 52h == ‘R’, our first actual letter so far.

eight-bit:

* 00000001 == 01h == ‘SOH’, start of heading (more 1960s print-only instructions)
* 01001010 == 4Ah == ‘J’
* 01010010 == 52h == ‘R’ again.

Now we move to the [larger Unicode values:](https://en.wikipedia.org/wiki/List_of_Unicode_characters). I will leave these to the reader as an exercise.

* 0000000000000001
* 0100101001010010
* 00000000000000010100101001010010

tl;dr: ‘010100101001010010’ at best starts a type of sentence then says JR.

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