











Arithmetic Logic Unit (ALU)
Notes:
The ALU, besides performing the standard bit manipulation and binary operations, has an adder. This gives us two adders on the C54x. In an earlier example we said we were going to accumulate a sum in the A accumulator and accumulate the result of the MAC unit in the B accumulator. This is possible because we have two adders.
The inputs to the ALU can be the two data buses (C & D buses), the feedback of the output of accumulators A & B, or the output from a shifter.
This provides a great deal of flexibility. For example, we can add a memory value to the accumulator, shifted by some amount. This seems like a simple sort of instruction. What we are asking the ALU to do is to go out on one of the data buses, the D bus, go through the shifter, shift the value in memory by 8 bits, then go to the ALU, add the shifted value to the value that's already in the accumulator and put the result back in that particular accumulator. This is an example of the type of instructions that the ALU allows us to do.
The ALU generates the standard status bits (shown in the lower right-hand corner), including overflow flags for both A and B, zero flags for both A and B, and a carry bit for both A and B.