An interactive educational tool that demonstrates computer architecture concepts through two main modules: Memory Hierarchy and CPU Pipeline.
This project provides visual simulations of key computer architecture concepts to help students understand:
- How data flows between different levels of memory hierarchy
- How instructions are processed through a CPU pipeline
Link- https://comp-archi-visz.netlify.app/
- Memory Hierarchy Visualization: Interactive visualization showing data flow between memory levels
- Data Flow Simulation: Simulate different memory access patterns with customizable scenarios
- Memory Components State: Real-time view of data contents in each memory layer (Registers, Cache, RAM, Disk)
- Memory Performance: Display of access times for different memory components
- Memory Hierarchy Relationships: Interactive diagram showing how components interact during memory operations
- Memory Concepts: Educational content explaining key memory hierarchy concepts with quizzes
- 5-Stage Pipeline Visualization: Visual representation of the classic 5-stage RISC pipeline (IF, ID, EX, MEM, WB)
- Pipeline Control Panel: Controls for executing instructions through the pipeline
- Pipeline Information Panel: Detailed information about pipeline execution and hazards
- Hazard Detection: Visualization of data, control, and structural hazards
- Performance Statistics: Real-time metrics on pipeline performance
- React with TypeScript
- Framer Motion for animations
- Zustand for state management
- Node.js (v14+)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/computer-architecture-visualization.git cd computer-architecture-visualization -
Install dependencies
npm install
-
Start the development server
npm start
-
Open your browser and navigate to
http://localhost:3000
- Select a Simulation: Choose from predefined simulation scenarios
- Start Simulation: Click the Start button to begin the visualization
- Watch Data Flow: Observe how data moves between memory components
- View Component States: See the current data contents in each memory layer
- Explore Memory Operations: Click on operations in the Memory Interconnections section to see different data paths
- Learn Concepts: Study the educational content in the Memory Concepts section
- Add Instructions: Use the control panel to add instructions to the pipeline
- Execute Pipeline: Step through execution cycles or run continuously
- Observe Hazards: Watch for pipeline hazards (data, control, structural)
- View Performance: Monitor statistics about pipeline efficiency
- Analyze Behavior: Study how different instructions interact in the pipeline
src/
├── components/
│ ├── memory/ # Memory hierarchy components
│ │ ├── MemoryHierarchy.tsx
│ │ ├── EnhancedControlPanel.tsx
│ │ ├── EnhancedHardwareComponents.tsx
│ │ ├── MemoryMetrics.tsx
│ │ ├── MemoryInterconnections.tsx
│ │ ├── MemoryEducation.tsx
│ │ └── MemoryComponents.css
│ └── visualization/ # Pipeline visualization components
│ ├── PipelineVisualization.tsx
│ ├── PipelineControlPanel.tsx
│ ├── PipelineInfoPanel.tsx
│ └── DataFlow.tsx
├── store/ # State management
│ ├── dataFlowStore.ts # Memory hierarchy state
│ └── pipelineStore.ts # Pipeline state
├── utils/ # Utility functions
│ └── simulationUtils.ts
└── App.tsx # Main application with tab navigation
This visualization tool aims to help students and educators understand:
- Memory hierarchy organization and characteristics
- Cache hit and miss scenarios
- Page faults and virtual memory
- Write-back and write-through policies
- Memory access time differences across components
- Instruction pipelining fundamentals
- Pipeline stages and their functions
- Pipeline hazards and their resolution
- Performance implications of pipelining
- Advanced concepts like data forwarding and branch prediction
- Developed as a Computer Architecture and Organization project
- Inspired by the need for interactive educational tools in computer science education