So this answer really has two different parts:
* CPUs (the chips you’d find in computers and cell phones) don’t actually hold code. They’re basically tiny machines, where the pins act like switches, and by flipping certain combinations of switches on and off it’s wired to activate/deactivate certain parts of the circuitry which all perform different functions. Each of these combinations of on/off is called an “instruction,” and the code that we type gets turned into these instructions before it’s run.
* Microchips/ICs (Integrated Circuits, like what you’d find in a digital camera or microwave) *do* hold the code, and is basically the same as a CPU but we’re cutting out the middle-man. Instead of writing the code, translating it into instructions, having the chip read those instructions, and then having those instructions switch between different circuitry on the chip, we just hard-wire those instructions directly into the chip themselves. This is mostly done automatically no different than how code is turned into CPU instructions, you basically just push a button and it translates the code into an circuit diagram.
Latest Answers