Ok, so I know that the alphabet of computers consists of only two symbols, or states: zero and one.
I also seem to understand how computers count beyond one even though they don’t have symbols for anything above one.
What I do NOT understand is how a computer knows* that a particular string of ones and zeros refers to a number, or a letter, or a pixel, or an RGB color, and all the other types of data that computers are able to render.
*EDIT: A lot of you guys hang up on the word “know”, emphasing that a computer does not know anything. Of course, I do not attribute any real awareness or understanding to a computer. I’m using the verb “know” only figuratively, folks ;).
I think that somewhere under the hood there must be a physical element–like a table, a maze, a system of levers, a punchcard, etc.–that breaks up the single, continuous stream of ones and zeros into rivulets and routes them into–for lack of a better word–different tunnels? One for letters, another for numbers, yet another for pixels, and so on?
I can’t make do with just the information that computers speak in ones and zeros because it’s like dumbing down the process human communication to the mere fact of relying on an alphabet.
In: 264
Programmers have standards like Unicode and ASCII and JPEG that translate 1’s and 0’s into meaningful information like characters and emojis and pixels. When you open a file, your computer reads the file format and other metadata and based on that data, it knows which standard to use to decode the 1’s and 0’s with.
This is why, if you change the file format of a JPEG file into .txt, and then try to open it in notepad, you just get a bunch of gibberish, because your computer is applying the wrong decoding format to the 1’s and 0’s.
As for the physical process of converting, there’s a table full of the possible pixel outputs, and the 1’s and 0’s control which cell of the table gets sent to the monitor, by electrically turning on the electrical connections between that cell and the monitor, and electrically turning off the connections between all the other cells and the monitor. This works because computers are made with transistors, which are voltage-controlled switches. The 1’s and 0’s are just high or low voltage, and the transistors are arranged so that a particular pattern of 1’s and 0’s will turn the right pattern of transistors on and off to access a particular cell in the table.
Latest Answers