By this I mean, when you write code, what exactly gives that the power to do anything is it more code? 0’s and 1’s? more so, what gives that thing the power to do anything? At some stage I can only deduce what must just be magic making it work because it’ll boil down to something metal and plastic ‘talking to’ an electric current, which doesn’t make sense at all
In: Engineering
Electricity follows very predictable paths. We can use this trait to accomplish some fun things.
We can make a circuit with two inputs, which sends an output signal if one input or the other (but not both) is receiving a signal. This clever little guy is called a NAND circuit (standing for not-and). If we take two of these circuits and chain them together we can make a circuit which takes two inputs and outputs a signal only if both of the inputs are receiving a signal. This is an AND circuit.
We can keep chaining these different kinds of circuits to create more complex logical expressions: OR, NOR, XOR, NOT, etc. With these logical expressions we can create complex logical processors capable of storing a binary value until needed, counting in binary, and adding binary numbers.
With those three things we can do anything else: subtraction, multiplication, division, taking input from the user, drawing pixels on the screen, and storing your half-finished novel you’ve been meaning to finish.
Mostly, we do this by assigning significance to various binary numbers, and then performing binary arithmetic to change between states.
All of it comes down to that little NAND circuit.
Latest Answers