Microprocessor and Computer Architecture

  1. Home
  2. Docs
  3. Microprocessor and Comput...
  4. Central Processing Unit a...
  5. Data Transfer and Manipulation

Data Transfer and Manipulation

Here is the explanation of Data Transfer and Manipulation:

Data transfer refers to the process of moving data from one location to another.

• This could involve transferring data between different computer systems, storage devices, databases, or network nodes.

• Data transfer can occur over various communication channels, such as wired or wireless networks, and may involve different protocols and technologies depending on the requirements of the transfer.

Data manipulation involves performing operations on data to transform, organize, analyze, or modify it according to specific requirements or objectives.

•This process is essential for extracting insights, making decisions, and generating useful information from raw data.

  • Data Transfer Instructions
  • Data Manipulation Instructions
  • Program Control Instructions

» Data transfer instruction causes transfer of data from one location to another.

» Data manipulation instruction performs arithmetic, logic and shift operations.

» Program control instruction provides decision making capabilities
and change the path taken by the program when executed in

Data transfer instructions move data from one place to another in the computer without changing the data content.

  • The most common transfers are between memory and processor registers, between processor registers and input or output, and between the processor registers themselves.
  • LD » Load : transfer from memory to a processor register, usually an AC (memory read)
  • ST » Store : transfer from a processor register into memory (memory write)
  • MOV » Move : transfer from one register to another register
  • XCH » Exchange : swap information between two registers or a register and a memory word
  • IN/OUT » Input/Output : transfer data among processor registers and input/output device
  • PUSH/POP » Push/Pop : transfer data between processor registers and a memory stack
Screenshot 2024 03 10 214020

Data Manipulation Instructions perform operations on data and provide the computational capabilities for the computer.

  • Arithmetic instruction
  • Logical and Bit manipulation instruction
  • Shift instruction

Arithmetic instructions are fundamental operations performed by a computer processor or arithmetic logic unit (ALU) to manipulate numerical data.

• These instructions involve basic mathematical operations such as addition, subtraction, multiplication, and division.

Screenshot 2024 03 10 215448

Logical and bit manipulation instructions are fundamental operations performed by a processor to manipulate binary data at the bit level.

• These instructions are commonly found in assembly language programming and are often used in low-level programming tasks such as bitwise operations, data encoding, cryptography, and optimization algorithms.

Screenshot 2024 03 10 215605

A shift instruction in computer programming is a type of operation that moves the bits of a binary number left or right.

• Shifting is commonly used in low-level programming, such as assembly language, and also in high-level programming languages for various purposes, including data manipulation, arithmetic operations, and optimization.

Screenshot 2024 03 10 215749
  • Program Control Instructions specify conditions for altering the content of the program counter.
Screenshot 2024 03 10 220613
  • It is sometimes convenient to supplement the ALU circuit in the CPU with a status register where status bit conditions can be stored for further analysis.
Screenshot 2024 03 10 221209

Conditional branch instructions typically involve evaluating a condition and then deciding whether to jump to a different location in the program based on the outcome of that evaluation.

• The condition is usually expressed as a comparison between two values, such as the contents of registers or memory locations.

Screenshot 2024 03 10 221544
  • Bit C (carry) : set to 1 if the end carry C8 is 1. It is cleared to 0 if the carry is 0.
  • Bit S (sign) : set to 1 if the highest order bit F7 is 1 otherwise 0
  • Bit Z (zero) : set to 1 if the output of the ALU contains all 0’s otherwise 0. In other words Z=1 if the output is zero and z=0 if output is not zero.
  • Bit V (overflow) : set to 1 if the exclusive-OR of the last two carries (C8 and C7) is equal to 1
  • Flag Example : A – B = A + ( 2’s Comp. Of B ) : A =11110000, B = 00010100
Screenshot 2024 03 10 221831

A subroutine call is the self- contained sequence of instructions that performs a given computational task.

  • When a subroutine is called, the control flow of the program jumps to the beginning of the subroutine’s code.
  • Any arguments or parameters needed by the subroutine are passed to it, and local variables may be initialized.
  • The subroutine executes its code, performing the necessary operations, calculations, or tasks.

The last instruction of every subroutine commonly known as subroutine return.

  • Once the subroutine has completed its tasks, it returns control back to the point in the program from where it was called.
  • Any return values that need to be passed back to the calling code are usually provided at this point.
  • The program continues executing from where it left off before the subroutine call.

Program interrupts are signals that can be generated by either hardware or software to indicate that an event has occurred that requires attention from the CPU.

•These events could include hardware errors, user requests, or other conditions that need to be handled by the operating system or the running program.

The Program Status Word (PSW) is a special register in the CPU that stores various pieces of information about the current state of the processor and the running program.

• This information typically includes flags indicating conditions such as arithmetic overflow, carry, or zero results, as well as status bits related to the CPU mode (such as supervisor mode or user mode).

• The PSW is used by the CPU during the execution of instructions to determine how to handle certain operations and to control.

Supervisor mode, also known as kernel mode or privileged mode, is a mode of operation in which the CPU has access to all resources and privileges of the underlying hardware and operating system.

• In supervisor mode, the CPU can execute privileged instructions, access system memory and I/O devices directly, and perform other operations that are not permitted in user mode.

• Typically, only the operating system kernel and trusted system components run in supervisor mode, while user applications run in a more restricted user mode. This helps to ensure system stability, security, and protection of system resources from unauthorized access or misuse.

There are three type of interrupts that cause a break in the normal execution of a program.

Group 9

External interrupts are generated by external hardware devices to signal the CPU that they need attention.

• Examples include signals from keyboards, mice, disk drives, network adapters, etc.

• When an external interrupt occurs, the CPU typically saves the current state of execution, services the interrupt request, and then resumes the interrupted program.

Internal interrupts, are generated internally by the CPU in response to exceptional conditions encountered during the execution of instructions.

• These conditions include arithmetic errors (like division by zero), accessing invalid memory addresses, attempting to execute privileged instructions in user mode, etc.

• When an internal interrupt occurs, the CPU transfers control to a predefined exception handling routine.

Software interrupts are deliberate instructions inserted into a program by the programmer to cause an interrupt.

• They are often used to request services from the operating system, such as system calls.

• When a software interrupt instruction is encountered, the CPU suspends the current program, transfers control to the operating system’s interrupt handler, and executes the requested service.

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *