Is every cpu instruction implemented by logic gates at its core?

Viewed 168

Is every operation done by the CPU implemented by simple logic gates such as AND, OR, XOR gates?

For example a half adder is implemented with an AND + XOR gate. What about:

  • The rest of the Arithmetic Logic Unit (subtraction, multiplication, div)
  • The floating point unit
  • Shift operations
  • More complex instructions such as counting leading zeros, bit rotation, etc.

Is every instruction implemented by combining logic gates?

2 Answers

Practically speaking, all of the digital operations on a chip are implemented as logic gates or ROM lookups (and a ROM is just some logic gates for the address decoder, plus some wires that either are or aren't present).

And theoretically speaking, any boolean function can be implemented as logic gates. In fact, any boolean function of any number of arguments can be implemented using enough copies of just one logic gate.

Not every instruction. Many of the instructions you use while writing are actually a combination of simpler instructions (mov, add, sub, mul. etc.). But yes, most of them are implemented with logic gates.

Related