How Do Computers Work? (At Most Basic Level)

13 replies · 5K views · last reply
kyphysics
Messages
687
Reaction score
446
It's late/early...I'm procrastinating on a project...

Thought I'd ask a "dumb" question to satisfy my curiosity. I know computers have hardware (physical machine) and software (from the operating system to other programs/apps that can be downloaded onto the hardware to perform certain functions)...

But, how exactly does the computer "read" or interact with that software? Feel free to treat me like a 3rd grader, who is dumber than a door knob and ignorant of everything computer-related.

Once someone inserts a piece of software into the hardware to be downloaded and run it...what the heck actually goes on after that and how does the machine "process" the software to do the stuff it is designed to do?
 
Switches ... It's all about switches.

As soon as you turn the computer on, the current goes through pre-defined circuits and ends up doing an action. With additional software, you are setting the switches differently to "customize" the output.

The mechanical equivalent would be the valve body of an automatic transmission, which is really a very simple hydraulic computer.

Photo of an automatic transmission valve body: a flat aluminium plate with a maze of machined fluid passages, a central circular bore, and three solenoid valves on the right edge.

Hydraulic circuit schematic of an automatic transmission valve body showing fluid lines, manual valve, shift valves, solenoids, accumulators, servos and clutch assemblies in colour-coded pressure paths.
 
  • Wow
  • Haha
Likes   Reactions: Algr, kyphysics and berkeman
jack action said:
It's all about switches.
... or gates, such as AND gates, OR gates, and others. This wikipedia article shows a couple of animated GIFs of very simple CPUs that are able to add two bits - https://en.wikipedia.org/wiki/Adder... often,add 8, 16, 32, etc. bit binary numbers.

More capable CPUs can be designed and fabricated by chaining together collections of the kinds of devices depicted in that article.
 
  • Like
  • Wow
Likes   Reactions: DrClaude, jedishrfu and kyphysics
kyphysics said:
Once someone inserts a piece of software into the hardware to be downloaded and run it...what the heck actually goes on after that and how does the machine "process" the software to do the stuff it is designed to do?
The answer is probably more complicated than a 3rd grader is able to understand beyond a very cursory level. For the sake of simplicity, let's assume that said computer is equipped with an operating system and file system. When you click a executable file icon or type the name of the executable file in a command prompt, the operating system (OS) loads the file into memory. The computer's central processing unit (CPU) starts executing the machine instructions that are contained in the executable file, starting from what's called the file's entry point. The CPU continues processing the instructions in the file until the program ends, either because of the logic of the program or due to the user ending it.
 
  • Like
Likes   Reactions: kyphysics
Mark44 said:
... or gates, such as AND gates, OR gates, and others.
But logic gates are really just a bunch of switches:

LOGIC GATES USING SWITCH
AND GATE USING SWITCH
Four circuit schematics, each with a 5V battery, two series push-button switches SW 1 and SW 2, a 280Ω resistor and an LED; LED is off for 0,0 / 0,1 / 1,0 inputs and on for 1,1 input.

OR GATE USING SWITCH
Four circuit schematics, each with a 5V battery, a 280 Ω resistor and an LED, showing parallel pushbutton switches labelled "0" and "1" controlling whether the LED is on or off.

NOT GATE USING SWITCH
Two circuit schematics of a 5V battery, 280 Ω resistor, pushbutton switch and LED: top with switch open showing LED ON and "1", bottom with switch closed showing LED OFF and "0".

And when done with transistors, it looks like this:

Two transistor circuit schematics side by side, labelled AND on the left and OR on the right, each with 5V supply, OUT, GND, and transistor terminals B, C and E.
 
  • Like
Likes   Reactions: rbelli1
jack action said:
But logic gates are really just a bunch of switches:
But switches are just a bunch of molecules, and molecules are just a bunch of atoms. It just depends on how far down you want to go to explain the workings of a computer.
 
When I was a teen I read Code by Charles Petzold and The Definitive Guide to How Computers Do Math by Clive Maxfield. These both evolved my interest in fundamental computers such as Ben Eater's 8-Bit computer.