If i want to save something in a computer such as a number 1 that would be 001 but if i save 001 in a computer how would the computer know that 001 is 1. Should we first save the number 1 in memory and tell the computer that hey this is 1 and it is 001 in your language. Basically if we want to save something, how would a computer know what are we saving to determine its output. Like if i say the computer hey i wanna save 10011 and i actually intended it to be The letter A how would the computer know 10011 is A?


Nowadays, all computers are built following certain conventions. One of those conventions is the use of zero and one (i.e. low voltage and high voltage): it's perfectly possible to make computers that don't use zeroes and ones, and in fact the Soviets did so (look into the Setun project). Another of those conventions is that text-based data comes in units of eight bits each, called "bytes".

Each byte holds a number from zero to 255, and more conventions define what each number means. The ASCII standard, for example, says that 65 means "A", while the UTF-8 standard says that 195 followed by 184 means "ø". But there's nothing intrinsically "A"-like about the number 65: it's just a convention people have agreed to follow, to make it easier for programs to work together.

(P.S. When two programs are using different conventions, you get a garbled mess called "mojibake". Nowadays most text data is stored in UTF-8, which helps avoid this, but there are still some holdouts (cough Windows API) who insist on using other conventions instead. It's a headache when you have to deal with that.)

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.