woodylcy wrote
I can't figure out what's the C on A Register , on Mux and on decode.
I hope someone can help me about this. explain the C
The C signals in the CPU block diagram are "control" signals. The Instruction Decoder generates the control signals from the bits in the instruction. The control signals are used to make the rest of the CPU do what it needs to do to execute the instruction.
The simplest control signal would indicate that the instruction is an A-instruction. This signal could be named aInst. Its implementation is
Not(in=instruction[15], out=aInst);
aInst will be used to route instruction to the A-register and store it.
Although you can use instruction[15] wherever the CPU needs to know if it is executing a C-instruction, it's more understandable to create a cInst control signal. (And a lot less typing!)
Not(in=aInst, out=cInst);
The CPU also needs to store the output from the ALU into the A-register, depending on the destination bits in the C-instruction, so you need a destA control signal. This signal is only active during C-instructions. Its implementation is
And(in=cInst, b=instruction[5], out=destA);
When does the A-register need to be loaded? Whenever aInst or destA is true.
Or(in=aInst, b=destA, out=loadA);
What data needs to be loaded into the A-register? A multiplexer chooses that based on aInst.
Other control signals are similarly generated by further decoding the C-instruction, and they are used to control other parts of the CPU.
--Mark