In: Computer Science
Provide explanation on how the ALU is related to the CPU? Describe main functions of ALU in supporting operations of the system. Providing an example to illustrate or support your argument. |
Every computer have a CPU(Central Processing Unit) also called as a main processor that executes instructions that make up a computer program. In that, ALU(Arithmetic Logic Unit) is the fundamental building block of the CPU. In addition to ALU, CPU also contain a CU(control unit) that directs the operations of the processor and the small amount of high-speed memory called register.
An Arithmetic Logic Unit (ALU) is a digital circuit used to perform arithmetic and logical operations. most of the operations of a CPU are performed by one or more ALU's, it takes input from the Accumulator and Temp register and output of most of the ALU operations is stored back into the Accumulator.
An Accumulator is a programmable register holds one of the operands that can be read or write by the user, and Temp is a register for storing one of the operands during an operation and a programmer has no access to this register.
ALU performs arithmetic operations like Addition, Subtraction, Multiplication and Division and logic operations like AND, OR, NOT etc.,
EXAMPLE:, ADDITION of two numbers 38 and 53.
ANS: 38 in Binary - 1 0 0 1 1 0
53 in Binary - 1 1 0 1 0 1 (+)
(carry) 1 1
-------------------------------
Addition result: 1 0 1 1 0 1 1 = 91
As we know,
1. 0+0 = 0 represents 0
2. 1+1 = 1 represents 1
3. 0+1 = 1 represents 1
4. 1+1 = 1 0 represents 2
becacuse, 1+1 = 2 in bainary [ 1 0 ] here 1 is a carry.
Likewise, In ALU, inputs gives to AX,BX registers
AX - Accumulator
BX - register
AX holds 38 (1 0 0 1 1 0)
BX holds 53 (1 1 0 1 0 1)
Meanwhile,By perform addition the result of each operation store in TEMP register such as carry values and Hence, the result of the operation is stored back to AX (Accumulator) to display output.
Therefore, To do this arithmetic and logic operations a seperate unit is required in CPU and that is ALU (Arithmetic Logic Unit).