Register Transfer and Micro-Operations – Complete Computer Architecture Notes (BCA Level)
What Are Register Transfer and Micro-Operations?
Register Transfer and Micro-Operations form the foundation of CPU execution at the hardware level. They describe how data moves between registers and basic operations performed inside the processor.
Simple Analogy: Think of registers as small boxes inside the CPU holding data temporarily. Micro-operations are like tiny actions (add, shift, load) that move or change data between these boxes.
This topic bridges high-level instructions (like ADD R1, R2) with actual hardware signals that make them happen.
Register Transfer Language (RTL)
Register Transfer Language (RTL) is a symbolic notation used to describe data movement and operations between registers.
Key Features of RTL:
-
Symbolic representation of hardware operations
-
Readable format for hardware designers
-
Describes what happens during instruction execution
-
Used in CPU design and digital system simulation
Basic RTL Syntax:
R2 ← R1
Meaning: Transfer contents of Register R1 to Register R2.
R1 ← R2 + R3
Meaning: Add R2 and R3, store the result in R1.
RTL Notation Elements:
-
Registers: R0, R1, AC (Accumulator), PC (Programme Counter)
-
Arrows (←): Indicate data transfer direction
-
Operators: +, -, AND, OR, SHL (Shift Left)
-
Constants: #5, K2 (immediate values)
Example:
AC ← AC + M[AR] // Add memory content to Accumulator
PC ← PC + 1 // Increment Programme Counter
Register Transfer
Register Transfer refers to the movement of data from one register to another or between registers and memory.
Types of Register Transfers:
1. Simple Transfer:
R2 ← R1
-
Binary Content of R1 copied to R2
-
R1 remains unchanged
2. Conditional Transfer:
If K = 1 then (R2 ← R1)
-
Transfer happens only when the condition is true
3. Simultaneous Transfer:
R1 ← AC, R2 ← M[AR]
-
Multiple transfers in the same clock cycle
4. Transfer with Operation:
R1 ← R2 + 5
-
Arithmetic operation during transfer
Register Transfer Timing:
T1: R2 ← R1
T2: R3 ← R2
T1, T2 represent different clock cycles
Types of Micro-Operations
Micro-operations are elementary operations performed on data stored in registers. They are the smallest units of CPU activity.
Four Fundamental Types:
-
Register Transfer Micro-operations
-
Arithmetic Micro-operations
-
Logical Micro-operations
-
Shift Micro-operations
Execution Sequence: Each machine instruction triggers multiple micro-operations in sequence.
Register Transfer Micro-Operation
Register Transfer Micro-operations handle data movement between registers, memory, and I/O devices.
Common Examples:
1. R0 ← R1 // Register to Register
2. R1 ← M[AR] // Memory to Register (Load)
3. M[AR] ← R1 // Register to Memory (Store)
4. R1 ← R2, R3 ← R4 // Parallel Transfers
5. OUTR ← R1 // Register to Output Register
Hardware Implementation:
Symbol Gates Required Timing
R2 ← R1 AND + OR 1 clock cycle
M[AR] ← R1 Memory Write 2 clock cycles
Practical Case Study: During LOAD instruction:
T1: MAR ← PC // Fetch address
T2: MBR ← M[MAR] // Read memory
T3: R1 ← MBR // Load to register
Arithmetic Micro-Operation
Arithmetic Micro-operations perform mathematical calculations on register data.
Basic Arithmetic Operations:
1. R1 ← R1 + R2 // Addition
2. R1 ← R1 - R2 // Subtraction
3. R1 ← R1 + 1 // Increment
4. R1 ← R1 - 1 // Decrement
5. R1 ← R2 - R1 // Subtract and transfer
Hardware Components:
-
ALU (Arithmetic Logic Unit)
-
Carry/Borrow flags
-
Status Register
Increment/Decrement Examples:
ADD R1, R1, 1 // R1 ← R1 + 1
SUB R1, R1, 1 // R1 ← R1 - 1
Binary Addition Example:
R1: 1011 (11₁₀)
R2: 0011 (3₁₀)
R1 ← R1 + R2
Result: 1110 (14₁₀)
Carry: 0
Arithmetic Overflow:
R1: 0111 (7)
R2: 0010 (2)
R1 ← R1 + R2 → 1001 (Overflow flag set)
Logical Micro-Operation
Logical Micro-operations perform bitwise operations between registers.
Four Basic Logical Operations:
1. R1 ← R1 AND R2 // Bitwise AND
2. R1 ← R1 OR R2 // Bitwise OR
3. R1 ← R1 XOR R2 // Bitwise XOR
4. R1 ← NOT R1 // Complement
Truth Tables:
AND Operation:
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
Practical Example – Masking:
R1: 10110110
R2: 00001111 (Mask)
R1 ← R1 AND R2
Result: 00000110 (Lower 4 bits only)
XOR Application – Clearing Bits:
R1: 11001100
R2: 00001100
R1 ← R1 XOR R2
Result: 11000000 (Cleared specific bits)
Hardware: Uses logic gates (AND, OR, XOR, NOT) inside ALU.
Shift Micro-Operation
Shift Micro-operations move bits left or right within a register.
Types of Shifts:
1. Logical Shift:
SHL R1 // Shift Left (Multiply by 2)
SHR R1 // Shift Right (Divide by 2)
2. Circular Shift:
R1 ← SHL R1, C0 // Left circular (LSB to MSB)
R1 ← SHR R1, C0 // Right circular (MSB to LSB)
3. Arithmetic Shift:
ASHL R1 // Preserves sign bit (Left)
ASHR R1 // Preserves sign bit (Right)
Shift Examples:
Logical Left Shift (×2):
R1: 00101100 (44)
SHL R1
R1: 01011000 (88)
Logical Right Shift (÷2):
R1: 10110110 (182)
SHR R1
R1: 01011011 (91)
Arithmetic Right Shift (-45):
R1: 10110110 (-46 in 2's complement)
ASHR R1
R1: 11011011 (-23)
Multiple Shifts:
R1 ← SHL R1, 2 // Shift left twice (×4)
R1 ← SHR R1, R2 // Shift by register count
Introduction to HDL (Hardware Description Language)
Hardware Description Language (HDL) allows designers to describe digital circuits using textual code instead of drawing schematics.
Purpose of HDL:
-
Simulation before hardware manufacturing
-
Synthesis to generate actual circuits
-
Documentation of complex designs
-
Reusability of components
Popular HDLs:
-
VHDL (VHSIC Hardware Description Language)
-
Verilog
-
SystemVerilog
Basic HDL Structure:
ENTITY register_transfer IS
PORT (
clk : IN STD_LOGIC;
data_in : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
data_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END ENTITY;
Benefits:
-
Technology independent
-
Hierarchical design
-
Automatic optimisation
Introduction to VHDL
VHDL (VHSIC Hardware Description Language) is an IEEE standard for describing digital systems.
VHDL Structure:
ENTITY declaration
ARCHITECTURE description
PROCESS statements
COMPONENT declarations
Simple VHDL Example – Register Transfer:
ENTITY reg_transfer IS
PORT (
clk, load : IN STD_LOGIC;
din : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
dout : OUT STD_LOGIC_VECTOR(3 DOWNTO 0)
);
END reg_transfer;
ARCHITECTURE behavior OF reg_transfer IS
BEGIN
PROCESS(clk)
BEGIN
IF rising_edge(clk) THEN
IF load = '1' THEN
dout <= din; -- RTL: dout ← din
END IF;
END IF;
END PROCESS;
END behavior;
VHDL Operators (RTL Equivalent):
+ Addition R1 ← R2 + R3
& Concatenation R1 ← R2 & R3
AND Logical AND R1 ← R2 AND R3
SHL Shift Left R1 ← SHL R2
VHDL Advantages:
-
Strong typing prevents errors
-
Concurrent execution models hardware
-
Synthesisable code generates actual circuits
-
Extensive simulation capabilities
Case Study: Modern FPGAs (Field Programmable Gate Arrays) use VHDL for implementing custom CPUs with specific register transfer paths.
Key Takeaways
-
RTL provides a symbolic notation for describing hardware operations clearly
-
Micro-operations are atomic actions (transfer, arithmetic, logical, shift) executed by the CPU
-
Register transfers form the backbone of instruction execution
-
Arithmetic micro-ops handle calculations using the ALU
-
Logical operations manipulate individual bits efficiently
-
Shift operations enable multiplication/division by powers of 2
-
VHDL bridges design description with actual hardware synthesis
-
Understanding these concepts is essential for embedded systems, FPGA design, and processor architecture