It is not smart. Computer are fundamtaly a lot of interconnected electrically controlled switches.
You can have a single switch to turn on a light bulb. But you can alos but tow in series so both need to be in the correct position to turn on the light. You could but two in parallel so eighter can turn on the light but both need to be off to turn it off
You can alos conned it if you flip either switch the light change state, that is how lamps in a starwell in a house it typically connected.
The electricity is not smart in how it turn the lamp on and off, it just flow trough the wire is there is a open path. computer are the same.
If you instead of a lamp attach a device that can turn a switch you have a electromechanical logic system. Some early computer was build like that. A electrically controlled switch like that is called a relay.
Computer today use transistor as switches. In a computer that do the same as relay but with no movie part and it extremely small and modern computer have billion of them.
If you really what to know how it can be done look at [https://eater.net/8bit/](https://eater.net/8bit/) where a 8 bit computer is build from scratch. The explanation start with how transistor works and the every other level and component is explained. It is not advanced computer like are made today but somting more similar to computer in the 1970s or early 1980s
Binary is a light switch. Turn on (1), a light goes on. Turn off (0), the light goes off.
You can combine light switches in parallel or series to make different logic.
eg. two light switches in series = AND. Both must be on for the light to turn on.
two light switches in parallel = OR. One or the other must be on for the light to turn on.
Then you build up other logic from there.
eg. Two add two single-bit binary numbers:
0 + 0 = 0, carry = 0
0 + 1 = 1, carry = 0
1 + 0 = 1, carry = 0
1 + 1 = 0, carry = 1
The carry bit is just an AND. the sum bit is an XOR (exclusive or). (A or B) and (not (A and B))
The electric current isn’t actually doing anything special in a computer, you can make computers out of physically moving objects as well like cogs (which Charles Babbage famously designed), marbles, or even dominos!
[This explanation of a domino computer](https://www.youtube.com/watch?v=lNuPy-r1GuQ) might help understand what’s going on inside an electronic comptuer as you can imagine the movement of the dominos like an electric current.
Latest Answers