How does a CPU decide which transistors to use?

-1

Perhaps I'm not thinking about this correctly, but when you give the CPU a command such as Multiply Registers (MR) R2,R4 how does it decide which logic gates it will use, is it just the first gates available or is there something I'm not aware of going on under the hood. I understand a CPU has millions of logic gates so how does it manage their use correctly?

Scholar

Posted 2015-05-03T20:09:44.070

Reputation: 3

Question was closed 2015-05-04T16:12:50.883

Answers

0

Your question is really more in the realm of electrical engineering than in computer science, so its a bit off topic, but I'll see what I can do.

Your multiply instruction would be queued to an Arithmetic Processing Unit on one of its input/output connections.

The ALU uses Combinational Logic in its layout, such that the electricity flows through the entire circuit, and its output varies based on the input received. It does not select a set of gates to use, all of the gates are receiving signal, but the layout of the circuit creates a reproducible transformation of the input signal carrying the result. Note that at this level, you are working with analog signal as much as digital bits, so the electricity is flowing like water through a network of pipes, and the circuitry is allowing more or less water through different pathways.

The Execution unit driving the instruction sends it the ALU for processing, and on the next clock tick, expects the result to be available on one of the ALUs output registers. see more details here: https://en.wikipedia.org/wiki/Arithmetic_logic_unit#Circuit_operation

Frank Thomas

Posted 2015-05-03T20:09:44.070

Reputation: 29 039

0

Simply put it is the command that you are running itself that determines the transistor states and therefore the logic gates in use. It will see a series of bytes and that series are effectively configuring the processor initial state. It's a lot more complicated on modern processors with multiple execution units but this is the gist of it.

When the processor starts up it will be at address 0, and will put that address onto the address bus. It will then be waiting for the bytes at address 0 to appear on its data inputs. This will then tell the processor the starting state it needs to be in, so it can then put the next address location out on the address bus and wait for the next byte and so on.

Soon it will have a full command, and the bytes it needs to multiply together. All these bytes will effectively "configure" the processor core to the task that needs to be done.

Having pulled the full command in along with the needed data bytes put in the register it can then carry on with the command needed and, after cycling through the series of logic transitions needed, will then output the result.

Mokubai

Posted 2015-05-03T20:09:44.070

Reputation: 64 434