How does coding physically work?

114 viewsOtherTechnology

Like how exactly can a bunch of letters, numbers, and punctuation symbols make your computer do all kinds of things? Plus what happens inside the computer when it executes the code?

In: Technology

22 Answers

Anonymous 0 Comments

So the brain of the computer is called the processor. Deep down it is just a very large set of microscopic wires and switches, (formed to create logic gates) that are capable of performing really basic operations – for example they can detect if 2 input wires have power and pass this power along to the output, or they can invert the power from input to output. From those simple structures, by combining them appropriately you can create more and more advanced operations. Many talented engineers spend years of their work to design and manufacture operation sets, creating modern processors. Modern CPUs have more than 100 million of those logic gates.

Now, how does a written programming language talk to the processor? It can’t on its own, as they don’t speak the same language. They need some form of translation. This is what compiler does – it translates programming language to a machine code, that can be understood by the processor. This code is then taken by the operating system and ran through a driver – which is a piece of software designed to communicate between operating system and hardware components. The resulting machine code is in sets of 0’s and 1’s and as you can probably guess, 0’s mean some wires will be set to no power and 1’s mean that some wires will have power. Outputting wires, after the operation is complete are ran through driver back to the operating system, where it can be translated to human readable output.

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