Is ALU used for all instructions?

1

On wikipedia page about Von Neumann Architecture is this picture. There are a lot of similar pictures like this.(Also in a lot of articles about Von Neumann Architecture is that only ALU execute program.) There are 2 arrows from and to ALU (I/O), and no arrows from I/O to Control Unit. (On some pictures are arrows representing data bus from memory only to ALU). This is confusing me. I understand that in CPU is Control Unit that fetch instruction, and use its resources to execute it. So, for example when there is instruction that just copy data from one to another location(mov),or Instruction that cause CPU to set its Instruction Pointer to given value(jmp),or IRQ, ALU isn't used. I think that Von Neumann Architecture was applicated only on computers which preformed only mathematics operations, so the input and output both represented only numbers, and input couldn`t make changes in memory(because it was connected only to ALU). So modern computer architecture inherited only that instruction and data are stored in same memory and cpu contains Control Unit,some registers and ALU (also this is only basic, modern CPU contains more than this). Am i right?

PcAF

Posted 2015-09-19T19:20:00.103

Reputation: 171

yes, in a model as simple as von neumann, every instruction is executed by the ALU. I think the source of your confusion is that the input and output are registers, and the request to read the input register is itself an instruction, so if only instructions interact with the input/output registers, only the ALU needs to use them. The CU fetches and tells the ALU to IN or OUT or STO or LDA, but the ALU actually performs them. – Frank Thomas – 2015-09-19T20:17:46.540

I don't understand. Why if only instructions interacts with i/o, only ALU need to use them? – PcAF – 2015-09-19T20:31:07.970

the CU fetches the instruction IN decodes it to 500, and sends it to the ALU. The ALU reads the input, and places it in the calculator register. To do this, the CU did not need access to the input register, it just needed to fetch and decode the instruction. The ALU actually moved the data. Next the CU fetches the instruction STO 99, and decodes it to 299, and sends it to the ALU. The ALU takes the value in the calculator register and places it in mem addr 99. Next CU fetches add 001 so the ALU incerements the calculator register. last OUT causes the ALU to copy the calc reg to out. – Frank Thomas – 2015-09-19T20:40:08.583

Note that actual input in LMC is outside the image you are looking at, the same way loading the instructions into RAM are. Neither the CU nor the ALU are involved in that process. Also, note that the instruction pointer is managed within the ALU, so instructions that control program flow are also executed by it. – Frank Thomas – 2015-09-19T20:41:15.140

Thanks. But we are talking about these old computers that did only math operations. But in modern computers ALU doesn't preform all instructions, or yes? – PcAF – 2015-09-19T20:54:30.567

The LMC is nothing like real world models. check out this signifigantly more complex architechure for the intel 8008 model from 1972: https://en.wikipedia.org/wiki/File:Intel_8008_arch.svg . There really isn't an exact parallel for the LMC's ALU in modern systems, as it's responsibilities are spread across numerous subsystems, and are designed to run multiple threads at once.

– Frank Thomas – 2015-09-19T21:03:11.123

1@FrankThomas So answer to this question should be: YES for EXACT von Neumann Architectore, but NO for modern cpu's , because ALU just do Arithmetic and Logic operations there. Am I right? – PcAF – 2015-09-21T12:43:34.983

pretty much, but I would state your second assertion as "The job of the ALU in simple models like LMC, would be far to complex and far too inflexible for a modern real-world CPU, so operations related to Algorithmic Logic processing are coordinated and performed by many differant components with differant relationships to eachother". – Frank Thomas – 2015-09-22T11:41:44.650

No answers