Introduction to Computer Architecture

Direct Memory Access (DMA)

Direct Memory Access (DMA) is a feature of computer systems that allows hardware components to access the main memory (RAM) directly, without involving the CPU for every data transfer operation. This mechanism is crucial for efficient data handling, particularly in high-speed devices like hard drives, network cards, or graphics cards, where frequent data transfer is required.

Basic Concept of DMA

In a typical data transfer operation without DMA, the CPU manages every read and write operation between peripherals and memory. However, this creates bottlenecks, especially when handling large data volumes, as the CPU must spend time managing these transfers.

Working of DMA

The CPU initiates the DMA transfer by providing the DMA controller with the following information:

  • Memory address: The starting point in memory where data is to be written or read.
  • I/O device address: The address of the device that will send or receive data.
  • Direction of data transfer: Whether the data is to be read from or written to memory.
  • Amount of data: The total number of bytes to be transferred.

Types of DMA

  • Burst Mode DMA: The DMA controller takes full control of the system bus and transfers the entire block of data in one go. The CPU is temporarily halted during this transfer.
  • Cycle Stealing DMA: The DMA controller transfers one data word per bus cycle, temporarily pausing the CPU only for short durations, allowing it to share the bus.
  • Transparent DMA: DMA transfers occur only when the CPU is not using the system bus, making it almost invisible to the CPU’s performance.

Advantages of DMA

  • Efficiency: By offloading data transfer tasks from the CPU, DMA reduces CPU overhead, allowing it to focus on other processing tasks.
  • Faster Data Transfer: Direct communication between memory and peripherals ensures faster data handling, especially for high-speed I/O devices.
  • Multitasking: Since the CPU is not occupied with managing data transfers, it can execute other programs or processes concurrently.

Applications of DMA

DMA is widely used in areas where high-speed data transfer is critical. Examples include:

  • Disk drives: For reading/writing large data blocks from hard drives to RAM.
  • Network cards: For processing large volumes of network packets quickly.
  • Graphics processing: In rendering frames for high-end games or 3D applications, where significant data transfer between memory and the graphics card is required.
  • Audio/Video streaming: Ensuring real-time data transfer for seamless playback or recording.

8085 Addressing Modes

The 8085 microprocessor has several addressing modes, which define how the operands (data) for an instruction are specified. The different addressing modes in the 8085 are:

Immediate Addressing Mode

  • Description: The operand (data) is specified directly in the instruction itself.
  • Example: MVI A, 0x32 – In this instruction, the value 0x32 is loaded directly into the accumulator (register A).

Register Addressing Mode

  • Description: The operand is in one of the registers, and the instruction specifies the register where the data is stored.
  • Example: MOV B, C – This instruction copies the content of register C into register B.

Direct Addressing Mode

  • Description: The address of the operand (memory location) is specified directly in the instruction.
  • Example: LDA 2500H – The instruction loads the content of memory location 2500H directly into the accumulator.

Indirect Addressing Mode

  • Description: The address of the operand is indirectly specified through a register pair (HL, BC, DE).
  • Example: MOV A, M – This instruction moves the data from the memory location whose address is in the HL register pair into the accumulator (A).

Implicit Addressing Mode

  • Description: The operand is implied in the instruction itself, i.e., the instruction works on a specific register or accumulator by default.
  • Example: CMA – This instruction complements the content of the accumulator, and no operand is specified because the operation is implied to act on the accumulator.

Instruction Code Format

Instruction code format refers to the structure of a machine-level instruction, which the CPU can interpret and execute. It defines how different components of an instruction (like the operation code, source and destination operands, and addressing mode) are arranged within a binary representation.

A typical instruction consists of:

  1. Opcode: Specifies the operation (like ADD, SUBTRACT, LOAD, etc.).
  2. Operands: Specifies the data or addresses that the operation will act upon.
  3. Addressing mode: Defines how the operand’s location is determined.

Example of Instruction Code Format

Consider a 16-bit instruction format where:

  • 4 bits for the opcode
  • 6 bits for the first operand (destination register)
  • 6 bits for the second operand (source register or memory address)

Let’s say we have an instruction to add two numbers:

  • Opcode: 0001 (for ADD operation)
  • Destination Register: 001100 (Register 12)
  • Source Register: 010101 (Register 21)

Micro Operations

Micro-operations perform basic operations on data stored in one or more registers, including transferring data between registers or between registers and external buses of the central processing unit (CPU), and performing arithmetic or logical operations on registers. In a typical fetch-decode-execute cycle, each step of a macro-instruction is decomposed during its execution so the CPU determines and steps through a series of micro-operations. The execution of micro-operations is performed under control of the CPU’s control unit, which decides on their execution while performing various optimizations such as reordering, fusion and caching.

Hardware Implementation of x + yz: AR ← AR + BR

Block Diagram for Hardware Implementation

To implement the given statement “x + yz: AR ← AR + BR” using two n-bit registers (AR and BR) and control variables (x, y, and z), the following block diagram can be used:

ComponentDescription
ARn-bit register to store the value of AR
BRn-bit register to store the value of BR
AdderPerforms the addition operation
Control LogicGenerates control signals based on the values of x, y, and z
Multiplexer (MUX)Selects between the input values of AR and BR based on the control variables

The control logic will use logic gates to generate the control signals based on the values of x, y, and z. The control signals will determine the operation to be performed (addition in this case) and the selection of input values for the adder (AR and BR).

The block diagram will have connections between these components based on the control signals generated by the control logic.

This block diagram represents the hardware implementation of the given arithmetic operation using registers and control variables.

Box and Whisker Plot

A box and whisker plot is a graph that exhibits data from a five-number summary, including one of the measures of central tendency. It does not display the distribution as accurately as a stem and leaf plot or histogram does. But, it is principally used to show whether a distribution is skewed or not and if there are potential unusual observations present in the data set, which are also called outliers. Boxplots are also very useful when huge numbers of data collections are involved or compared.

Since the centre, spread and overall range are instantly apparent, using these boxplots the arrangements can be matched easily.

A box and whisker plot is a way of compiling a set of data outlined on an interval scale. It is also used for descriptive data interpretation.

Census and Sample Survey

Census and sample surveys essentially relate to the statistical collection of data across various areas and sectors pertaining to the particular subject matter or inquiry. These data collection exercises are undertaken on a cross-section of a targeted population. The information that is derived from the study of a population can be subsequently used for various purposes. Let us discuss the census and sampling. The Census Method is also known as a Complete Enumeration Survey Method. In this method each and every item in the universe is selected for the data collection. The selected data might constitute a particular place, a group of people, or any specific locality that is the complete set of items.