You are on page 1of 7

Computer Organization and Architecture

CSEN 2202
Lecture 3 – 4
20/01/2020

Dr. Debranjan Sarkar


Arithmetic Logic Unit
• CPU = ALU + CU
• ALU executes instructions on the operand data stored in registers/
memory
• Registers vs. memory
• A register is a temporary storage area built into a CPU
• Some registers are used internally and cannot be accessed outside
the processor
• Some registers are user-accessible
• Most modern CPU architectures include both types of registers
• Memory also holds the data that can be directly accessed by the CPU
• Register holds the data that the CPU is currently processing whereas,
the memory holds program instruction and data that the program
requires for execution
Arithmetic Logic Unit
• CPU Registers:
• Accumulator
• General Purpose Registers
• Special Purpose Registers
• Program Counter (PC)
• Instruction Register (IR)
• Stack Pointer (SP)
• Base Register (BR)
• Memory Address Register (MAR)
• Memory Buffer / data Register (MBR / MDR)
• Status Register or Program Status Word (PSW)
Arithmetic Logic Unit
• An operation performed on the data stored in registers is called micro-operation
• A micro-operation is an elementary CPU operation, performed during one clock
pulse. An instruction consists of one or more micro-operations.
• Mainly there are four categories of micro-operations:
• Register transfer micro-operations
• Arithmetic micro-operations Memory R/W’
MAR
• Logical micro-operation
• Shift micro-operations
MBR

• Register Transfer Language (RTL)


• Symbolic notation to describe the µ-instruction “Transfer between registers”
• Example: R1 ← R2
Arithmetic Logic Unit
• Memory Transfer
• When the information is transferred from a memory, it is “read”
• When the information is stored into a memory, it is “write”
• In both the cases, the memory word is specified by an “address”
• A memory unit receives the address from a register “MAR”
• For memory read operation, the data from the memory is transferred to another register called “MDR”
or “MBR”
• The data to be written into the memory should be available in the “MDR” for memory write operation.
• Memory Transfer
• Read operation: Memory to CPU MBR ← M[MAR]
• Write operation: CPU to memory [MBR] ← [R]
M[MAR] ← [MBR]
• Arithmetic micro-operation
• Basic arithmetic micro-operations are
• Addition R1 ← R2 + R3
• Subtraction R1 ← R2 - R3
• Increment R1 ← R1 + 1
• Decrement R1 ← R1 – 1
etc. etc.
Arithmetic Logic Unit
• Logical micro-operation
• Basic logical micro-operations are
• AND R1 ← R2 ꓴ R3
• OR R1 ← R2 ∩ R3
• Complement R1 ← NOT(R1)

• Shift micro-operation
• Basic shift micro-operations are
• Left shift by n bitsR1 ← R1 << n
• Right shift by n bits R1 ← R1 >> n
Thank you

You might also like