How A Microprocessor Works

The visual depicts functioning of a microprocessor during the addition process, irrespective of the data entry sequence

Step 1 : The number '3' is presseda. On pressing the '3' key, the microprocessor (mP) is alerted. It asks the Prefetch Unit to get the instruction. The new data instruction comes into the mP through the Bus Unit, and is stored in the Instruction Cache, where it is assigned 'X' as the code. So at this point, 3 equals X.

b. The Prefetch Unit sends a copy of the new data to the Decode Unit.

c. At the Decode Unit, the data is translated into binary and sent to the Control Unit and the Data Cache.

d. '3' is stored in the Data Cache for the future at an address called 'X' as per the instructions of the Control Unit.

Step 2 : The number '4' is presseda. On pressing the '4' key, the microprocessor (mP) is alerted. It asks the Prefetch Unit to get the instruction. The new data instruction comes into the mP through the Bus Unit, and is stored in the Instruction Cache, where it is assigned 'Y' as the code. So at this point, 4 equals Y.

b. The Prefetch Unit sends a copy of the new data to the Decode Unit.

c. At the Decode Unit, the data is translated into binary and sent to the Control Unit and the Data Cache.

d. '4' is stored in the Data Cache for the future at an address called 'Y' as per the instructions of the Control Unit.

Step 3 : The ' ' key is presseda. On pressing the ' ' key, the mP is alerted, which asks the Prefetch Unit to get the instruction. The new data instruction comes into the mP through the Bus Unit, and is stored in the Instruction Cache as the code
'X Y = Z', indicating that an addition operation will be performed.

b. The Prefetch Unit then sends a copy of this new data to the Decode Unit for processing.

c. At the Decode Unit, the data is translated into binary and sent to the Control Unit and Data Cache. Also, the ALU is alerted that the ADD function has to be performed.

d. In the Control Unit, the code (X Y = Z) is broken down, and the ADD command is sent to the ALU. In the ALU, the values of X and Y are added, and the result, '7', is sent to an address location in the Register.

Step 4 : The '=' key is presseda. On pressing the '=' key, the mP is alerted. It asks the Prefetch Unit to get the instruction. The new data instruction comes into the mP through the Bus Unit, and is stored in the Instruction Cache as 'Print Z'.

b. The Prefetch Unit then sends a copy of this new data to the Decode Unit for processing.