A web-based CPU simulator built with React and TypeScript. This project visually demonstrates the working of a simple CPU, RAM, and Bus system, allowing users to load and run sample programs in a simulated environment.
- Visual representation of CPU, RAM, and Bus components
- Load and run sample programs into simulated memory
- Step through program execution and observe register/memory changes
- Modular React component structure
- State management using React Context API
- Node.js (v16 or above recommended)
- npm or yarn
- Clone the repository:
git clone https://github.com/mohitShahiT/CPU-simulator.git cd cpu-simulator
- Install dependencies:
npm install # or yarn install
Start the development server:
npm run dev
# or
yarn dev
Open http://localhost:5173 in your browser to view the simulator.
src/
App.tsx # Main app entry point
components/ # UI components (CPU, RAM, Bus, etc.)
context/ # React Contexts for state management
utils/ # Utility functions and sample programs
index.css # Global styles (Tailwind CSS)
- Click the controller to open the program list.
- Select a sample program to load it into memory.
- Use the provided controls to step through execution and observe how the CPU, RAM, and Bus interact.
- Add new sample programs in
src/utils/programs.ts
. - Modify or extend components in
src/components/
for custom CPU/RAM/Bus logic.
MIT