0

On some machines the operation of data path between ALU and registers is controlled by microprogram . On some machines , it is controlled by hardware .On machines with software control of the data path, the microprogram is an interpreter for the instructions at machine level. It fetches, examines, and executes instructions one by one, using the data path to do so.

For example, for an ADD instruction, the instruction would be fetched, its operands located and brought into registers, the sum computed by the ALU, and finally the result routed back to the place it belongs. On a machine with hardwired control of the data path, similar steps would take place, but without an explicit stored program to control the interpretation of the machine level instructions.

I am unable to get that if there is no microprogram in the latter case then how is the hardware able to interpret instructions directly ?

  • Possible duplicate of How Do Computers Work? – gnat Dec 25 '16 at 16:58
  • 2
    If OP does not have the background knowledge of introductory sequential logic then I don't see the point of answering this question or even keeping this question open. – rwong Dec 25 '16 at 17:49
2

There is an instruction decoder that sends control signals to muxes, which are switches that choose between various inputs.

All transistors and logic gates are always operating (modulo modern power saving techniques), and the control necessary is simply to tell the cpu what of the hardware logic gates and signals to pay attention to vs. to ignore. So, by ignoring some gates and signals, while focusing on others, each machine code instruction executes its operation.


We could turn around and ask how a microcode engine works, what logic allows it to function! The bottom line is that hardware is at the bottom of the stack, not software. Yet, hardware and software share a lot of similar capabilities.


Hardware works by having a lot of concurrently available capabilities, like add, sub..., pathways and routes, switches, and by selectively and purposefully enabling them.

Hardware can store constants in tables/arrays, data structures that can be consulted for the count and sequences to execute for a given instruction. The data stored might, for example, be a bit or two for the setting of each mux on the cpu.

In some hardware, the individual bits of the instruction drive hardwired logic with few dedicated lookup tables, whereas in other hardware we might find more tables.

And while microcode is like a machine within a machine, it is in some sense, a data structure that is used to lookup how to execute a (macro) instruction. Effectively there are tradeoffs ranging from hardwiring and larger transistor counts to table-driven approaches, that trade performance for cost in terms of silicon real-estate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.