What I don't understand, is how can a modern computer do so many different tasks?
I can ask a computer to compare any values I want, as many as I want, and have it do anything I want. How can this be possible without having to set up every single possible circuit to do that?
If what you're saying is true, then wouldn't I need a multiplexer hooked up to every single bit of memory in the computer? What if I wanted to do thousands of 'IF' statements all at the same time in one statement?
I can understand how a person can make a specific circuit that does a specific task, but how can you make a circuit that allows you to do any task?
For example, imagine I have 5 memory slots, each storing 1 bit, made from SR Latches.
How could I write a circuit (using only logic gates) that can:
p1) Select any (one) of the 5 memory slots. This will be called Mem_A.
p2) Ask if Mem_A is equal to (a choice of) '0' or '1'.
p3) If (p2) returns true, then select any (one) of the 5 memory slots. This will be called Mem_B.
p4) Have Mem_B set to either (a choice of) '0' or '1' (only if p2 was true)
And with the same circuit, I should be able to do TWO, or THREE IF statements at the same time, and/or affect more than just one memory slot as a result. How can you make a circuit with such flexibility, to the point that you could make a simple computer out of it that will perform any task?
?