How do computers KNOW what zeros and ones actually mean?

1.89K views

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

47 Answers

Anonymous 0 Comments

It “knows” based on context.

At the beginning there is a powered of computer with sleeping processor and a BIOS chip. As the computer is powered up, BIOS ROM (Read-Only-Memory) is connected to the bus of the processor and a signal “reset” is applied to one of the contact pins on the processor. The reset signal causes processor to set its “Program counter” (meaning “next instruction to be read” address) register to address 0x000000 – the beginning of the BIOS program. The first binary number in the first Byte (in an 8-bit processor, or 2Bytes in a 16 bit processor, or 4Bytes in a 32bit processor …) is an instruction, the next bytes are interpreted either as instructions or addresses, depending on context. An instruction can be a stand-alone (meaning the next number is next instruction), or can have a set number of parameters (such as an address where to read a number from or where to write the result). An instruction is hard-wired in the processor, it means transistors will, for example increment the “program counter” to the address of the next instruction, perform computations in Accumulator register and/or many other functions. A modern processor is very, VERY complicated and complex with interrupts, pipelines, busses … lots of stuff. Find some videos that describe functioning of a simple 8-bit computer, this can be understood by a simple mortal without years of studying.

The program in machine code in BIOS will set certain parameters, let processor identify connected disks and identify boot partition (where next step program in machine code is located that proceeds to load up an operating system), will let processor identify other parts of the system – size and mapping of the RAM, location of graphic cards, network cards … Whole lot of work is done before OS starts loading. When the OS loads the computer can read files from disk and start processing bytes according to context (file extension in Windows, “Magic number” (I am not kidding) at the beginning of a file in Linux or Unix …)

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