# aryanneoroy-cpu/ram architecture

> Architecture diagram of the GitHub repository aryanneoroy-cpu/ram, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aryanneoroy-cpu/ram
- Repository: https://github.com/aryanneoroy-cpu/ram

## Overview

This repository is a minimal Java memory-model foundation, not yet a full computer simulation. Its runtime behavior is concentrated in `Ram`: construction allocates byte-addressable storage, reads and writes validate an address, and invalid accesses throw a segmentation-fault-style bounds exception. The `main` method demonstrates a write followed by a read. The README mentions a future memory manager and terminal/shell, but those are not implemented here. The graph reflects the single sampled source file.

Main entry points: [`src/Ram.java`](https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java) (RAM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_memory["Memory model"]
  node_ram["RAM<br/>[Ram.java]"]
  node_storage[("Byte storage<br/>[Ram.java]")]
  node_validation["Address validation<br/>[Ram.java]"]
  node_bounds_error["Bounds error<br/>[Ram.java]"]
end

node_caller(("Program caller"))

node_caller -->|"constructs"| node_ram
node_ram -->|"allocates"| node_storage
node_ram -->|"validates access"| node_validation
node_validation -->|"throws"| node_bounds_error
node_ram -->|"reads and writes"| node_storage

click node_ram "https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java"
click node_storage "https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java"
click node_validation "https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java"
click node_bounds_error "https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ram,node_storage,node_validation,node_bounds_error toneBlue
class node_caller toneIndigo
```

## Components

### Memory model

- [RAM](https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java): `src/Ram.java`
- [Byte storage](https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java): `src/Ram.java`
- [Address validation](https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java): `src/Ram.java`
- [Bounds error](https://github.com/aryanneoroy-cpu/ram/blob/master/src/Ram.java): `src/Ram.java`

### Other components

- **Program caller**

## Connections

- Program caller → RAM: constructs (evidence: `src/Ram.java`)
- RAM → Byte storage: allocates (evidence: `src/Ram.java`)
- RAM → Address validation: validates access (evidence: `src/Ram.java`)
- Address validation → Bounds error: throws (evidence: `src/Ram.java`)
- RAM → Byte storage: reads and writes (evidence: `src/Ram.java`)
