Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
In the intricate world of computer architecture, data transfer and manipulation stand as pillars that uphold the efficiency and functionality of computing systems. These processes are integral to the seamless operation of computers, enabling them to perform a wide range of tasks from executing simple instructions to running complex applications. Understanding how data moves within a system and how it can be manipulated is crucial for anyone looking to delve deeper into the inner workings of computer technology.
What is data transfer and manipulation in computer system architecture?
Data transfer involves the movement of data between different components of a computer system, such as from the processor to memory, between registers, or across network interfaces. This movement is essential for fetching instructions, storing results, and communicating between various parts of a system.
Data manipulation, on the other hand, refers to the processes that transform and operate on data to produce desired outcomes. This includes arithmetic operations, logical operations, bit-level manipulations, and data shifting. Each of these operations plays a vital role in how computers process information and execute tasks.
Different types of manipulation in computer
Data manipulation instructions can be categorized into three parts:
1) Arithmetic instruction
2) Logical and bit manipulation instructions
3) Shift instructions
Arithmetic Instruction
Arithmetic instructions include increment, decrement, add, subtract, multiply, divide, add with Carry, subtract with Borrow, negate that is (2’s) two's complement. If there’s a negative number, it is considered as negate (so two's complement).
Generally, most computers carry instructions for all four of these operations. If computers have only addition(ADD) and possibly subtraction(SUB) instructions, the other two operations, i.e. multiplication(MUL) and division(DIV) must be generated using software subroutines. These four basic arithmetic operations are sufficient for solving scientific problems when expressed in numerical analysis methods.
The table given below shows the Arithmetic Instructions:
Name
Mnemonic
Example
Explanation
Increment
INC
INC R1
Increases the value stored in register R1 by 1.
Decrement
DEC
DEC R2
Decreases the value stored in register R2 by 1.
Add
ADD
ADD R3, R4
Adds the value in register R4 to the value in register R3.
Subtract
SUB
SUB R5, R6
Subtracts the value in register R6 from the value in R5.
Multiply
MUL
MUL R7, R8
Multiplies the value in register R7 by the value in R8.
Divide
DIV
DIV R9, R10
Divides the value in register R9 by the value in R10.
Add with carry
ADDC
ADDC R11, R12
Adds the value in register R12 and the carry flag to R11.
Subtract with borrow
SUBB
SUBB R13, R14
Subtracts the value in R14 and the borrow flag from R13.
Logical and Bit Manipulation Instruction
We have another list of instructions that is logical and bit manipulation instructions starting with clear (that means clear the content of accumulator), complement the accumulator, AND, OR, Exclusive-OR, Clear carry, Set carry, Complement carry, Enable interrupts, Disable interrupts, all these are logical and bit manipulation instructions.
These logical instructions consider each operand bit individually and treat it as a Boolean variable. Basically, logical instructions help perform binary operations on strings of bits stored in registers.
Clear instruction means making all the bits of a register ‘0’.
AND instruction is sometimes referred to as bit clear instruction or mask.
OR instruction is sometimes referred to as bit set instruction.
Set instruction means making all the bits of a register ‘1’.
XOR instruction is referred to as bit complement instruction.
Name
Mnemonic
Example
Explanation
Clear
CLR
CLR R1
Sets the value in register R1 to 0.
Complement
COM
COM R2
Inverts all the bits in the value stored in register R2.
AND
AND
AND R3, R4
Performs a bitwise AND between values in R3 and R4, stores the result in R3.
OR
OR
OR R5, R6
Performs a bitwise OR between values in R5 and R6, stores the result in R5.
Exclusive-OR
XOR
XOR R7, R8
Performs a bitwise XOR between values in R7 and R8, stores the result in R7.
Clear carry
CLRC
CLRC
Clears the carry flag (sets it to 0).
Set Carry
SETC
SETC
Sets the carry flag to 1.
Complement Carry
COMC
COMC
Inverts the carry flag (if it was 1, it becomes 0, and vice versa).
Enable Interrupt
EI
EI
Enables the interrupt system, allowing interrupts to occur.
Disable Interrupt
DI
DI
Disables the interrupt system, preventing interrupts from occurring.
Shift Instructions
Shift instructions allow the bits of a memory byte or register to be shifted one-bit place to the right or the Left.
There are basically two types of shift instructions — arithmetic and logical. Arithmetic shifts consider the contents of the memory byte or register to be a signed number. So, when the shift is made, the number is arithmetically divided by two (right shift) or multiplied by two (left shift). Logical shifts consider the contents of the register or memory byte to be just a bit pattern when the shift is made.
OP is the opcode field
RL (It tells whether to shift it right or left).
REG (It determines which register is to be shifted).
COUNT (It tells the number of places to be shifted).
TYPE( It tells the type of shifting from the list given below).
In right-shift operations, zeros are shifted into high-order vacated positions. And in the case of the left-shift operation, shifts the zero into low-order vacated positions.
Name
Mnemonic
Logical Shift Right
SHR
Logical Shift Left
SHL
Arithmetic Shift Right
SHRA
Arithmetic Shift Left
SHLA
Rotate Right
ROR
Rotate Left
ROL
Rotate Right through carry
RORC
Rotate Left through carry
ROLC
Frequently Asked Question
What are the different types of data manipulation?
Some basic types of data manipulation carried out in computers are carrying out logic operations on data, moving unchanged data, carrying out arithmetic operations on data, and testing data.
What are data transfer and data manipulation instructions?
Data transfer instruction causes data transfer from one location to another. Data manipulation performs arithmetic, logic, and shift operations. Program control instructions provide decision-making capabilities and change the path taken by the program when executed on the computer.
What are the different types of instructions in the 8086 microprocessor?
The different types of instructions in the 8086 microprocessor are String Instructions, Data Transfer Instructions, Bit Manipulation Instructions, Arithmetic Instructions, Iteration Control Instructions, Program Execution Transfer Instructions (Branch & Loop Instructions), Processor Control Instructions, Interrupt Instructions
Conclusion
In this blog, we have discussed Data Manipulation instruction with its subcategories like Arithmetic, Logical and bit manipulation instructions, and Shift instructions.