Data Manipulation Micro-Operations in COA: Arithmetic, Logic and Shift Operations Worked Step by Step
Learn a fixed-width method for tracing arithmetic, logic, and shift micro-operations. Every example tracks register values, result bits, carry, and overflow.
KnowledgeGate Team
Exam prep & CS education

You may know arithmetic, logic, and shift micro-operations, yet lose track when register arrows, carry bits, and signed values appear together. Freeze the word width, then trace every source, result, and flag separately.
Data manipulation micro-operations act on register contents
A micro-operation is an elementary register-data operation, usually completed in one clock step under control signals. Read R3 ← R1 + R2 as: sample old R1 and R2, add at the fixed width, then load R3 at the clock edge.
A register transfer such as R2 ← R1 copies data. Arithmetic changes a numeric value, logic changes selected bits, and shifting moves bit positions. CPUs may combine an ALU and shifter, but control encoding is architecture-specific.
RTL control functions and common-bus design come first in Register Transfer and Microoperations in COA. Fixed-width 8-bit calculations then isolate arithmetic, logic masks, shifts, flags, and clock-edge state changes.
Each register holds 8 bits. We group binary into nibbles, check it in hexadecimal, and label unsigned or two's-complement signed meaning. Revise with Number Systems and Base Conversions Explained if needed.
Arithmetic micro-operations: add, subtract, increment, and flags
Fix R1 = 1011 0110 (0xB6, 182 unsigned, -74 signed) and R2 = 0010 1101 (0x2D, 45). Add them:
1011 0110
+ 0010 1101
= 1110 0011The result is 0xE3, 227 unsigned or -29 signed, with carry 0. Signed overflow is 0 because the operands have different signs.
Perform subtraction through the adder identity R1 - R2 = R1 + NOT(R2) + 1:
NOT(0010 1101) = 1101 0010
1101 0010 + 1 = 1101 0011
1011 0110 + 1101 0011 = 1 1000 1001Discard the ninth bit. Store 1000 1001 (0x89, 137 unsigned or -119 signed). Here carry-out 1 means no unsigned borrow.
Related results are R2 + 1 = 0010 1110 (46), R2 - 1 = 0010 1100 (44), and R1 + R2 + 1 = 1110 0100 (0xE4).
Carry and overflow differ. 0111 1111 + 0000 0001 = 1000 0000 has carry 0 but overflow 1, since 127 + 1 does not fit signed 8-bit form. 1111 1111 + 0000 0001 = 1 0000 0000 has carry 1 but no overflow because -1 + 1 = 0 is valid. Carry observes the ninth unsigned bit. Overflow checks the signed range.
Logic micro-operations: masks, toggles, and field insertion
Apply each logic operation bit by bit to the same R1 and R2:
Operation | 8-bit result | Hex | Unsigned |
|---|---|---|---|
|
|
| 36 |
|
|
| 191 |
|
|
| 155 |
|
|
| 73 |
AND clears or preserves, OR sets or preserves, XOR toggles where its mask has 1, and NOT flips every bit.
For field insertion, let D = 1011 0010 and S = 0000 0101. Clear low D with D AND 1111 0000 = 1011 0000. Isolate low S with S AND 0000 1111 = 0000 0101. OR them to get 1011 0101 (0xB5). Upper 1011 remains, while low 0101 is inserted.

Instruction fields differ from logic operations applied to register bits after decoding. Their encoding does not imply a universal ALU control code.
Shift micro-operations: logical, circular, and arithmetic cases
Take Q = 1011 0111 (0xB7, 183 unsigned or -73 signed). Its end bits are both 1.
Operation | Result | What happens to the expelled bit |
|---|---|---|
Logical left |
| Old MSB |
Logical right |
| Old LSB |
Rotate left |
| Old MSB |
Rotate right |
| Old LSB |
Arithmetic right copies the sign bit: 1011 0111 → 1101 1011, or -37. This divides by two with the negative odd result rounding down; logical right gives positive 91. Arithmetic left also gives 0110 1110, but -73 × 2 = -146 is outside the signed 8-bit range, so the sign change shows overflow.
Use logical shift when zeros enter, rotate when the expelled bit returns, and arithmetic right to preserve a signed value's sign. Record the outgoing bit separately, then test overflow separately.
Trace a complete micro-operation sequence clock by clock
Start with A = 1011 0110 (0xB6) and B = 0010 1101 (0x2D). Each row uses pre-edge values.
Clock | Sources before edge | Selected operation | 8-bit result | Carry or outgoing bit | Destination after edge |
|---|---|---|---|---|---|
T0 |
|
|
| Not applicable |
|
T1 |
|
|
| Carry |
|
T2 |
| Logical left |
| Outgoing |
|
T3 |
|
|
| Not applicable |
|
Check in hexadecimal: 0x24 + 0x2D = 0x51, 0x51 << 1 = 0xA2, and 0xA2 XOR 0x0F = 0xAD. Final C = 1010 1101 (0xAD, 173 unsigned or -83 signed).
An ALU forms a result, an optional shifter moves it, a multiplexer selects the input, and the clock loads the register. Our toy selector uses 00 = AND, 01 = ADD, 10 = logical left, and 11 = XOR, giving 00, 01, 10, 11.

Data manipulation micro-operation exam patterns and traps
Questions may ask you to evaluate an operation, trace a sequence, decode a control table given in the question, or select a mask or shift. Use this order:
Freeze the word width.
Copy all old source values.
Compute one clock row.
Retain only eight result bits.
Record flags separately.
Update the destination only at the edge.
For simultaneous A ← A + B and B ← A XOR B, old A = 0xB6 and B = 0x2D produce new A = 0xE3 and B = 0x9B. Using new A too early wrongly gives B = 0xCE.
Other traps are confusing rotate with shift, equating carry with overflow, omitting the subtraction +1, and assuming signed meaning. KnowledgeGate has over 10 practice questions on these micro-operations. Place the topic in the broader GATE CS Exam Preparation map. Once hand tracing is reliable, use the GATE Test Series for wider timed practice.
The short version and the next practice step
Arithmetic changes values and flags, logic reshapes selected bits, and shifts move bit positions. Preserve fixed width, keep sources unchanged until the edge, and separate carry from overflow.
Recompute the addition and subtraction, reproduce the field insertion, trace every shift case on Q, then rebuild the T0 to T3 table. For organised COA and wider subject coverage, GATE Guidance by Sanchit Sir is the next structured step.
Keep learning

Assembly Language and Assembler Design: Two-Pass Translation with a Complete Worked Example
Follow a 16-bit Basic Computer program through pass one, pass two, hexadecimal encoding and execution, with every symbol, address and result shown.

Computer Classification and Flynn’s Taxonomy: The Four Classes with a Worked Vector Example
A machine can belong to several computer classes at once. Learn the four classification axes, Flynn’s matrix, vector and multicore traces, and exam traps.

Programmed I/O: Polling, CPU Utilisation, Worked Examples and GATE Question Patterns
Follow one programmed-input transfer from control write to data read, then calculate how many polls one word costs and what a longer poll period buys.

Multiprocessor Fundamentals: Architecture, Speedup and Worked Examples
Build a clear model of multiprocessor systems, then use it to calculate speedup and efficiency, trace a coherent write, and diagnose a lost update.