HDL Final Project

256-Bit Matrix Soft Processor

A modular application-specific processor designed to move an entire 4 × 4 matrix in one bus transaction and execute matrix and integer operations through a shared 256-bit datapath.

SystemVerilogAMD VivadoXSim256-Bit DatapathFinite-State MachinesMatrix Processing
Vivado waveform showing the execution engine state and shared-bus activity

Project Type

HDL Final Project

Datapath

256-Bit Shared Bus

Matrix Format

4 × 4, 16-Bit Elements

Verification

Vivado / XSim

Overview

One datapath connecting a complete processor

This project implements a soft processor in SystemVerilog with separate instruction memory, main memory, matrix ALU, integer ALU, execution engine, and simulation modules. Every component communicates through one address-decoded, 256-bit tri-state bus.

The wide datapath is the defining architectural choice: all sixteen elements of a 4 × 4 matrix fit in a single word. The execution engine controls which module owns the bus, sequences each transfer, and routes completed results back to memory or its internal registers.

Architecture

Modular compute, memory, and control blocks

The upper address nibble selects a processor module, while lower address bits select a local memory location or register. A selected source drives the bus; all other modules remain in a high-impedance state until the controller authorizes them to transmit.

Execution Engine

Fetches and decodes 32-bit instructions, coordinates bus transfers, selects the correct ALU, and advances a multi-cycle control state machine.

Matrix ALU

Treats each 256-bit operand as a complete 4 × 4 matrix of sixteen 16-bit elements and performs arithmetic and transformation operations.

Integer ALU

Provides addition, subtraction, multiplication, and division using the same shared 256-bit source and result registers.

Memory Subsystems

Separate instruction and main memories store the program, matrices, integer values, intermediate values, and completed results.

Instruction Cycle

A multi-cycle fetch, decode, execute workflow

Each 32-bit instruction identifies an opcode, destination, and two operand sources. The controller fetches and decodes the instruction, moves each operand to the selected ALU, starts the operation, waits for its result, and writes that result to its destination before fetching the next instruction.

Matrix opcodes are routed to the matrix ALU, while opcodes beginning with hexadecimal 1 select the integer ALU. Opcode 0xFF cleanly stops processor execution and allows the test environment to check results.

Vivado timing waveform for the processor execution state machine
Vivado waveform capture used to inspect state transitions, address selection, read/write control, and shared-bus transfers.

Compute Capabilities

Matrix operations alongside integer arithmetic

Implemented matrix operations

  • 4 × 4 matrix multiplication
  • Element-by-element addition and subtraction
  • Matrix transpose
  • Bus-supplied matrix scaling
  • Immediate-value matrix scaling

Integer operations

The integer ALU supports addition, subtraction, multiplication, and division. Its operands and result use the same 256-bit transfer path, allowing both compute units to share the memory and control system.

Verification

An end-to-end program with automated result checks

The included program exercises matrix addition, scaling, subtraction, transpose and multiplication, as well as all four integer operations and transfers through internal registers.

  • Generates a reset pulse and a 10 ns simulation clock.
  • Exercises matrix, integer, memory, and internal-register operations.
  • Stops execution when the processor decodes opcode 0xFF.
  • Compares final memory and register values against expected results.
  • Reports a passing memory check after the complete instruction sequence.
1625 nsRecorded simulation completion
256 bitsShared data-bus width
11Operations plus processor stop
PassedAutomated memory check

Design Highlights

What this project demonstrates

  • Application-specific processor architecture and instruction design.
  • Address decoding and coordinated ownership of a shared tri-state bus.
  • Finite-state-machine control of multi-cycle data movement and execution.
  • Parallel representation and processing of complete 4 × 4 matrices.
  • Integration of independent memory, control, and arithmetic modules.
  • Self-checking behavioral simulation in AMD Vivado and XSim.

Explore the Project

Review the SystemVerilog source and full documentation