Logic Microoperations

Microoperations are fundamental, low-level operations executed on data stored in registers within a digital computer. They are crucial for manipulating individual bits or portions of binary data within registers and can be used to implement complex machine instructions.

16 Logic Microoperations

The following are key logic microoperations that can be performed on two binary variables (x and y):

x y F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15
00 0000 0000 1111 1111
01 0000 1111 0000 1111
10 0011 0011 0011 0011
11 0101 0101 0101 0101
F₀ = 0
F ← 0 (Clear)
F₁ = xy
F ← A ∧ B (AND)
F2 = xy'
F ← A ∧ B
F₃ = x
F ← A (Transfer A)
F4 = x'y
F ← A ∧ B
F₅ = y
F ← B (Transfer B)
F₆ = x ⊕ y
F ← A ⊕ B (Exclusive-OR)
F₇ = x + y
F ← A ∨ B (OR Operation)
F₈ = (x + y)'
F ← A ∨ B (NOR)
F9 = (x ⊕ y)'
F ← A ⊕ B (Exclusive-NOR)
F10 = y'
F ← B (Complement B)
F11 = x + y'
F ← A ∨ B
F₁₂ = x'
F ← A (Complement A)
F13 = x' + y
F ← A ∨ B
F₁₄ = (xy)'
F ← A ∧ B (NAND)
F₁₅ = 1
F ← all 1's (Set all bits to 1)

Hardware Implementation

Logic microoperations are implemented using logic gates combined with multiplexers. A one-stage logic circuit can generate four basic operations using a 4x1 multiplexer.

S1S0 = 00
AND Operation
S1S0 = 01
OR Operation
S1S0 = 10
XOR Operation
S1S0 = 11
Complement A
Logic Circuit

Common Applications

1. Selective Set Operation

Sets bits in register A to '1' where corresponding bits in register B are '1'.

Formula: A ← A ∨ B

Example:
A before: 1010
B (operand): 1100
A after: 1110

2. Selective Clear Operation

Clears bits in register A where corresponding bits in register B are '1'.

Formula: A ← A ∧ B

Example:
A before: 1010
B (operand): 1100
A after: 0010

3. Selective Complement Operation

Complements bits in register A where corresponding bits in register B are '1'.

Formula: A ← A ⊕ B

Example:
A before: 1010
B (operand): 1100
A after: 0110

4. Mask Operation

Clears bits in register A where corresponding bits in register B are '0', isolating specific bit groups.

Formula: A ← A ∧ B

Example:
A before: 1010
B (mask): 1100
A after: 1000

5. Insert Operation

Inserts a new value into specific bit positions using a two-step process: mask to clear, then OR to insert.

Example: Insert 1001 into left four bits:
A before: 0110 1010
After masking: 0000 1010
After insertion: 1001 1010

6. Clear Operation (Comparison)

Compares two numbers and produces all '0's if they are equal using XOR operation.

Formula: A ← A ⊕ B

Example:
A: 1010
B: 1010
Result: 0000 (Equal!)
Start Learning Shift Microoperations