Bird view of the Microprocessor
The microprocessor performs two types of operations called Arithmetic and Logic. So, the basic functional unit which consists of Arithmetic (Addition, Subtraction, Multiplication, Division) and Logic (AND, OR, NOT, NAND, NOR) is called Arithmetic Logic Unit.
The Control input is the one that informs the ALU units what operations are to be performed. So, even though the ALU can perform a lot of functions at a time, it perform only one operation based on the control input. This control input to the ALU is generated by the control unit which is shown below.
Based on what criteria the Control unit generated the Control output? The control output is generated based on the input called Opcode(Operation code), which can be called an Instruction.
How the Control unit is getting the Opcode? The Opcode is stored in Memory by the User as shown below. The user knows for each Opcode the behavior of the Control unit. For example, 75 means Addition, 98 means Multiplication, 87 means Subtraction, 21 means AND like that. Here is a sample memory where the top two memory locations are filled with Addition and AND instructions. The other locations are don't care (x).
How the memory gives the data? Memory has Address and Data lines. Through the Address lines, it identifies the location and through the Data lines, it gives the content outside. We can see this in the diagram below.
The user stores the data inside Memory. Memory is giving the data based on the Address. Who is giving the Address? There is a unit called the program counter inside the microprocessor which generates the address. This program counter is controlled by the Control Unit.
Now, let us connect the memory to the microprocessor. So, the address from the program counter is connected to the address of memory, and data from memory is connected to the input of the control unit.
Now, let us connect all the components of the microprocessor and draw a single block diagram as shown below.
Now, let us see how the functions inside ALU are controlled by the control unit.
References: https://www.geeksforgeeks.org/program-execution-in-the-cpu/
Comments
Post a Comment