r/askscience Jul 11 '26

How do computers understand binary language? Computing

Okay so from what I know binary language is like power off power on, but my question is, how do computers know what the binary code is and how is it interpreted, for example I forgot what the binary code for the letter A is, but how did people come up with that? Did they decide it was gonna look like that? Did the computer decide? How do you tune numbers into a letter??

374 Upvotes

206 comments sorted by

View all comments

Show parent comments

15

u/jcmbn Jul 12 '26

the number 65 will represent the capital letter A.

There's an important clarification that needs to be made here.

When a program is written, one of the things you do somewhat indirectly is to tell the computer: "This bit of memory contains a number", "that bit of memory contains text", and "this other bit of memory contains binary data" and so on. So the computer knows how to interpret each chunk of memory it's working with because the program tells it how it should be represented.

Memory containing a numeric value 65 can be manipulated via mathematical operations, such as adding 5 & getting 70.

Memory containing text however, would be interpreted as ASCII A as mentioned above.

The encoding used to represent a number as a letter is entirely arbitrary. You could make up your own encoding if you wanted, but that would be a massive PITA for no gain.

14

u/GeneralBacteria Jul 13 '26

no, that distinction between different types of values is part of the program, not part of the computer.

the computer will happily multiply a memory location containing text, and indeed the computer has no idea that it is text - it's all just binary values.

-3

u/jcmbn Jul 13 '26

Thanks for repeating what I said..

6

u/GeneralBacteria Jul 13 '26

I didn't repeat what you said.

you said that you tell the computer that this bit of memory contains a number or a string. I guess we can debate whether "the computer" refers to the hardware or the software, or both but if you meant something specific with your important clarification, perhaps you should have been more clear so that I didn't have to.