Simple Answers & Key Points · 19 Questions
An Array Processor (also called a SIMD processor) is a type of parallel computer that consists of multiple identical Processing Elements (PEs) operating synchronously under the control of a single Control Unit (CU). All PEs execute the same instruction at the same time, but each PE operates on its own different data from its own local memory.
Architecture:
Example:
Classification: Array processors fall under Flynn's SIMD (Single Instruction, Multiple Data) category, as one instruction stream operates on multiple data streams.
A Vector Processor is a CPU designed to operate on entire vectors (one-dimensional arrays of data) using a single instruction. Instead of using a loop to process each element one at a time (scalar processing), a vector processor issues one instruction like VADD V1, V2, V3 which adds every element of vector V2 to every element of vector V3, storing results in V1.
Architecture:
Key Application Area:
| Feature | Scalar Processing | Vector Processing |
|---|---|---|
| 1. Operand Type | Operates on one data element at a time. An ADD instruction adds two individual numbers. | Operates on entire vectors (arrays) at a time. A VADD instruction adds two arrays element-by-element. |
| 2. Loop Overhead | Requires an explicit software loop (with counter increment, comparison, and branch instructions) to process an array. This overhead (fetch, decode, branch for every element) is significant. | Processes the array with a single instruction. The loop is implicit in the hardware — the vector unit automatically iterates through all elements. This eliminates branch overhead entirely. |
| 3. Instruction Fetch | For N elements, N×(number of instructions per iteration) instructions must be fetched and decoded. | For N elements, only one instruction is fetched and decoded. This dramatically reduces instruction bandwidth requirements. |
| 4. Memory Access | Individual, scattered load/store instructions. May suffer from cache miss penalties on each access. | Streaming, pipelined memory access. Vector load units access memory in a predictable, sequential pattern, allowing the memory system to optimize prefetching. |
In vector processors, pipelining refers to the deep segmentation of the arithmetic functional units (like Floating-Point Adders, Multipliers) into multiple stages. This allows a new pair of vector elements to enter the pipeline every clock cycle, achieving a sustained throughput of one result per clock cycle after the initial startup latency.
How It Works:
VADD V3, V1, V2 — add 64 elements) is issued.Key Formula:
Significance: Without pipelining, 64 additions would take 64 × 6 = 384 cycles. With pipelining, it takes only 6 + 63 = 69 cycles. The throughput approaches 1 element/cycle for long vectors.
Speedup in vector pipelining is the ratio of the time taken by a scalar (non-pipelined) processor to process a vector operation compared to the time taken by a pipelined vector processor for the same operation.
Derivation:
Limiting Behavior:
Conclusion: Vector pipelining is most effective for long vectors, where the throughput approaches the theoretical maximum of one result per cycle.
A Mask Register (or Vector Mask Register) is a special hardware register in a vector processor that holds a vector of boolean values (0 or 1), one bit per vector element. It is used to implement conditional operations on individual elements within a vector instruction.
Why It's Needed:
Consider the scalar code:
for (i = 0; i < N; i++) {
if (A[i] > 0)
B[i] = A[i] + C[i];
}
In scalar processing, the if statement is a branch. In vector processing, there are no branches within a vector operation. Instead, the mask register selectively enables or disables the operation for each element.
How It Works:
VCMP.GT VM, V_A, 0) compares each element of V_A against 0 and sets the corresponding bit in the mask register VM. If A[i] > 0, VM[i] = 1; otherwise VM[i] = 0.VADD V_B, V_A, V_C, VM) only executes the addition for elements where VM[i] = 1. Elements where VM[i] = 0 are skipped (or their results are not written back).Significance: The mask register allows vector processors to handle if-else constructs without branches, maintaining the streaming pipeline efficiency of vector execution even for conditional computations.
1. ILLIAC IV (1972):
2. Connection Machine CM-2 (1987):
Modern Examples:
Both exploit data-level parallelism (DLP), but they do so through fundamentally different architectural approaches.
| Feature | Array Processor | Vector Processor |
|---|---|---|
| Parallelism Type | Spatial Parallelism: Multiple ALUs operating simultaneously on different data. | Temporal Parallelism: A single, deeply pipelined ALU processing elements sequentially but overlapping them in time. |
| Number of ALUs | Many (e.g., 64 or more simple ALUs). | Few (e.g., 1-4 deeply pipelined functional units). |
| Control | Single CU broadcasts one instruction to ALL PEs. All PEs operate in lockstep. | Single instruction sequentially feeds elements through a pipeline. No broadcast needed. |
| Memory | Each PE has its own local (distributed) memory. | Uses Vector Registers fed from a centralized shared memory system. |
| Synchronization | Implicit — all PEs execute the same instruction at the same time. | Implicit — the pipeline handles ordering automatically. |
| Best For | Massively parallel operations on independent data (image processing, cellular automata). | Regular, streaming computations (linear algebra, FFT, weather simulation). |
| Example | ILLIAC IV, Connection Machine, GPUs. | Cray-1, NEC SX series. |
Conceptual Block Diagrams:
Array Processor:
Control Unit (CU)
┌──────────────┐
│ Fetch & Decode │──── broadcasts instruction ────┐
└──────────────┘ │
┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ │
│ PE 0 │ │ PE 1 │ │ PE 2 │ │ PE N │ ◄─────┘
│ ALU │ │ ALU │ │ ALU │ │ ALU │ (all execute same op)
│ Mem │ │ Mem │ │ Mem │ │ Mem │
└──────┘ └──────┘ └──────┘ └──────┘
Vector Processor:
Scalar Unit ──► Vector Control Unit
│
┌──────────────┼──────────────┐
│ │ │
┌─────────┐ ┌─────────┐ ┌─────────────┐
│ V Reg 0 │ │ V Reg 1 │ │ V Reg N │
│ 64 elems│ │ 64 elems│ │ 64 elems │
└────┬────┘ └────┬────┘ └──────┬──────┘
│ │ │
└──► Pipelined FP Adder ◄──┘
[S1|S2|S3|S4|S5|S6]
──► 1 result/cycle after startup
A vector pipeline processes an entire vector of data through a deeply segmented functional unit, producing one result per clock cycle after an initial fill-up period.
Example: Vector Floating-Point Addition (VADD V3, V1, V2)
This instruction adds corresponding elements of vector registers V1 and V2, storing results in V3. The floating-point adder pipeline typically has 4-6 stages:
Pipeline Timing (Vector Length = 6, Stages = 4):
Cycle: 1 2 3 4 5 6 7 8 9
Stage 1: E0 E1 E2 E3 E4 E5
Stage 2: E0 E1 E2 E3 E4 E5
Stage 3: E0 E1 E2 E3 E4 E5
Stage 4: E0 E1 E2 E3 E4 E5
Output: V3[0] V3[1] V3[2] V3[3] V3[4] V3[5]
Total Cycles = 4 + 6 - 1 = 9 cycles (vs. 4 × 6 = 24 cycles without pipelining).
Speedup = 24/9 = 2.67x
Vector Chaining is an optimization technique in vector processors that allows the output of one vector functional unit to be fed directly into the input of another vector functional unit without waiting for the first operation to complete on the entire vector. It is the vector equivalent of data forwarding in scalar pipelines.
Example Without Chaining:
VMUL V3, V1, V2 ; V3 = V1 × V2 (takes k + N - 1 cycles)
VADD V5, V3, V4 ; V5 = V3 + V4 (must wait until VMUL finishes ALL elements)
Total time ≈ 2 × (k + N - 1) cycles. The VADD cannot start until the entire VMUL is done.
Example With Chaining:
Total time ≈ k_mul + k_add + N - 1 cycles (much less than the sequential sum).
Performance Improvement:
Data-Level Parallelism (DLP) is a form of parallelism that arises when the same operation is applied to multiple independent data elements simultaneously. Array processors are specifically designed to exploit DLP.
How Array Processors Exploit DLP:
if A[i] > 0), a mask register disables the PEs that don't meet the condition, while the active PEs proceed.Example — Vector Addition:
To compute C[i] = A[i] + B[i] for i = 0 to 63:
LOAD R1, [100] → All 64 PEs load their respective A[i].LOAD R2, [200] → All 64 PEs load their respective B[i].ADD R3, R1, R2 → All 64 PEs compute C[i] = A[i] + B[i] simultaneously.STORE R3, [300] → All 64 PEs store their C[i].4 instructions process 64 elements — a massive exploitation of DLP.
Given:
a) Total Clock Cycles Required:
Explanation: The pipeline takes 5 cycles to fill (startup latency for the first element). After that, one element completes every cycle for the remaining 99 elements.
b) Pipeline Efficiency:
Pipeline efficiency measures how well the pipeline utilizes its hardware compared to the ideal case.
Interpretation:
Problem: Multiply two 64×64 matrices: C = A × B, where C[i][j] = Σ(A[i][k] × B[k][j]) for k = 0 to 63.
Data Distribution:
Algorithm (Row-at-a-Time):
Data Flow Summary:
Total Steps: 64 (rows) × 64 (inner loop) = 4,096 multiply-accumulate steps. But since each step involves 64 PEs working in parallel, the effective work is 64 × 64 × 64 = 262,144 multiplications in 4,096 steps. Without the array processor, a scalar machine would need 262,144 sequential steps.
Given:
Note: A dot product involves two operations: element-wise multiplication followed by a summation (reduction). Let's calculate the time for the multiplication phase first.
Step 1: Vector Multiply Time (V3 = V1 × V2)
Step 2: Reduction (Summation)
After multiplication, we have 128 products that must be summed. A vector reduction (tree-based summation) takes log₂(N) passes:
Total reduction = 69 + 37 + 21 + 13 + 9 + 7 + 6 = 162 cycles.
With Vector Chaining: If chaining is supported, the multiply and the first reduction pass can overlap, saving significant time.
Total Time (without chaining): 133 + 162 = 295 cycles for the complete dot product.
If only multiplication is asked: 133 cycles.
An array processor (SIMD machine) is designed to execute a single instruction simultaneously across many data elements using multiple, identical Processing Elements.
Detailed Architecture:
Executing Arithmetic on Data Arrays:
To compute C[i] = A[i] + B[i] for all i:
LOAD R1, [100]: All PEs load A[i] from their local address 100 into register R1.LOAD R2, [200]: All PEs load B[i] into R2.ADD R3, R1, R2: All PEs compute A[i] + B[i] in parallel.STORE R3, [300]: All PEs store C[i] to address 300.All N additions are completed in the time of a single addition instruction.
The Cray-1 (1976) was a landmark vector processor. Its architecture featured Vector Registers and deeply pipelined functional units with vector chaining.
Cray-1 Architecture Highlights:
Example: Compute V3 = V1 × V2 + V4
Instruction 1: VMUL V3, V1, V2 (7-stage multiply pipeline)
Instruction 2: VADD V5, V3, V4 (6-stage add pipeline, chained to VMUL)
Timing Diagram (Vector Length = 8, simplified):
Cycle: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
VMUL: [--- 7 stages for E0 ---]
E0 E1 E2 E3 E4 E5 E6 E7 ← one element enters per cycle
Output: M0 M1 M2 M3 M4 M5 M6 M7
VADD (chained): [--- 6 stages for E0 ---]
M0 enters immediately when produced
Output: A0 A1 A2 A3 A4 A5 A6 A7
Without Chaining: VMUL finishes at cycle 14. VADD starts at cycle 15, finishes at cycle 14 + 6 + 7 = 27. Total = 27 cycles.
With Chaining: VADD starts at cycle 8 (when M0 is produced). VADD finishes at cycle 8 + 6 + 7 = 20. Total = 20 cycles. Saving 7 cycles (25% faster).
| Aspect | Array Processor | Vector Processor |
|---|---|---|
| Architecture | Multiple identical ALUs (Processing Elements), each with local memory, connected via an interconnection network. Exploits spatial parallelism. | Few deeply pipelined functional units operating on data stored in large Vector Registers. Exploits temporal parallelism. |
| Control Mechanism | Single Control Unit broadcasts one instruction to all PEs. All PEs execute in lockstep synchronization. Conditional execution via masking. | A control unit issues vector instructions. The pipeline hardware sequentially streams elements through the stages automatically. No broadcast needed. |
| Performance | Performance scales directly with the number of PEs. Adding more PEs = more parallelism. Best for massive, embarrassingly parallel problems where all elements need the same operation. Overhead: inter-PE communication and data distribution. | Performance depends on pipeline depth and vector length. Best for regular, streaming computations (linear algebra, FFTs). Overhead: pipeline startup latency for short vectors. |
| Application Domains | Image processing, cellular automata, neural network inference, database searching, cryptography. Any domain with massive, regular, independent data. | Scientific computing, weather forecasting, molecular dynamics, computational fluid dynamics (CFD), seismic analysis. Domains with heavy floating-point array arithmetic. |
Given:
a) Total Clock Cycles for Pipelined Vector Multiply:
b) Speedup over Scalar Execution:
Conclusion:
Advantages:
Limitations: