Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 2.18 KB

README.md

File metadata and controls

55 lines (45 loc) · 2.18 KB

Computer Architecture Project

Project Overview

This project simulates a basic computer architecture, implementing key hardware and logic components. It is designed to execute assembly code provided in program.txt and coordinate the execution through a clock cycle loop.

Project Structure

/Project_Root
│
├── /src
│   ├── main.ext                # Entry point & Clock Cycle Loop
│   ├── /hardware
│   │   ├── RegisterFile.ext    # R0-R63 & SREG
│   │   ├── Memory.ext          # Instruction (1024x16) & Data (2048x8)
│   │   └── ProgramCounter.ext  # 16-bit PC
│   │
│   ├── /logic
│   │   ├── ALU.ext             # Arithmetic/Logic & Flag calculations
│   │   ├── Decoder.ext         # R-Format vs I-Format splitting
│   │   └── Pipeline.ext        # IF/ID/EX Stage coordination
│   │
│   └── /utils
│       └── Parser.ext          # File reader & bit-concatenator
│
├── program.txt                 # Your assembly code input
└── README.md                   # Documentation

Components

Hardware

  • RegisterFile.ext: Implements 64 general-purpose registers (R0-R63) and a status register (SREG).
  • Memory.ext: Contains instruction memory (1024x16) and data memory (2048x8).
  • ProgramCounter.ext: Manages the 16-bit program counter.

Logic

  • ALU.ext: Performs arithmetic and logic operations, including flag calculations.
  • Decoder.ext: Splits instructions into R-Format and I-Format.
  • Pipeline.ext: Coordinates the instruction fetch (IF), decode (ID), and execute (EX) stages.

Utilities

  • Parser.ext: Reads the assembly code from program.txt and concatenates bits for instruction processing.

Usage

  1. Write your assembly code in program.txt.
  2. Run the project using the entry point main.ext.
  3. The program will simulate the execution of the assembly code through the hardware and logic components.

Notes

  • Ensure the assembly code in program.txt adheres to the expected format.
  • Modify the components in /src as needed to extend functionality.

License

This project is open-source and available under the MIT License.