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
Computer code is typically an abstraction of “machine code”, the binary language that is directly executed by the computer’s hardware. That is the 0’s and 1’s that people talk about computers working with, and those in turn are symbolic of electric current (typically the 0 is no current and 1 is current).
How does that electric current do anything? Those pulses of current go into computer chips which rely on something called a “transistor” to function. A transistor is a semiconductor that can amplify or switch electric current.
Visualize a transistor as two wires going in and one wire going out. One of the incoming wires is the “source” and the other is a “gate” wire, with the outgoing wire being the “drain”. If a current comes in on the “source” but there is no current on the “gate” then the current is blocked and there is no current on the “drain”. However if a current comes in on both the “source” and the “gate” wire then it is allowed to flow through and there is a current on the “drain”!
Using multiple transistors it is possible to create binary logical operations. Everything computers do is built on this concept and modern computers contain billions of transistors.
And that is how code has the power to do stuff.
Latest Answers