Yes, the only thing it can store is numbers, but you can represent different things with numbers. For example, the numbers will correspond to different instructions on the CPU. So if the CPU sees 100110 at the start of an instruction, that could correspond to “add these two numbers together” or “write this value to this register”. The CPU is designed to check the next few blocks of bits to figure out which two numbers we’re adding or which register we’re writing to, and then anything after that is the next instruction.
For other kinds of data, we’ve found different ways to turn numbers into other things. For example, we’ve assigned numbers to every character you can type on a computer. So an A is 65 and 😀 is 128,512. When you are writing code to deal with text, you’ll know to treat those values as text rather than numbers.
Latest Answers