Skip to content

Projects written in C++ in windows and linux dual systems

License

Notifications You must be signed in to change notification settings

SGYSY/ManchesterBaby

Repository files navigation

Manchester Baby

Project used to simulate Manchester baby (Available on Windows and Linux)


This C++ project uses Qt5 for implementing GUI and is configured by QMake.

👏 Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have a Linux machine. This project has been tested on Ubuntu 18.04, but it should work on other distributions as well.
  • You have installed Qt5. Check your Qt and QMake version using the command qmake --version. This project has been tested with Qt version 5.9.5 and QMake version 3.1.
  • You have installed Qt Creator. This will provide a user-friendly interface for managing and compiling the project.

📦 Setup

Follow these steps to get this project ready for compiling and running:

  1. Open the project ManchesterBaby in Qt Creator. The ManchesterBaby.pro file in the project should be detected and selectable when navigating the project location.

  2. Qt Creator should prompt that the project has not been configured. Configure the project using the Desktop kit.

  3. If necessary (for usually this is automatically done, but it is always a good idea to double-check), manually set to use the Qt5 version of QMake:

    • Go to Tools > Options.

    • Navigate to the Build & Run section, and then the Qt Versions tab.

    • Click Add... and navigate to the location of the Qt5 QMake binary (usually /YOUR_PATH_TO/Qt5.x.x/gcc_64/bin/qmake).

    • Click Apply and OK.

  4. You should see all the C++ code files (FOUR .cpp files including main.cpp and THREE .h files) in Headers and Sources sections in the Projects view area on the left (Expand the ManchesterBaby folder first if you haven't). If not, check the ManchesterBaby.pro file and make sure the following part is correct:

    SOURCES += \
            main.cpp \
            widget.cpp \
            baby.cpp \
            assembler.cpp
    
    HEADERS += \
            widget.h \
            baby.h \
            assembler.h

​ Save the file (Ctrl + S) after every time you make a change to this file, or any other files.

✨ Starting the program

  1. Build the project (Ctrl + B). This will create a build-ManchesterBaby-Desktop-debug directory in your project root (The same level as the ManchesterBaby folder). Make sure you can find it.
  2. If you haven't done so, rename your assembly language file to assemble.txt and put the file into the build-ManchesterBaby-Desktop-debug directory. (There are three sample assembly program files are enclosed in the folder Assembler_Sample and ready to be used, do remember to rename if you want to use them).
  3. Compile and run the program (Ctrl + R). Make sure the Qt Creator is working on the correct project and is currently in Debug mode before running. These can be checked right above the Run button.

🧩 Operting the Assembler & Simulator

After the program starts, the assembler in the program will read the assemble.txt. A log file named log.txt will be generated by the assembler to record every step of the process of translating assembly language (including whether each of them is successful or not), in build-ManchesterBaby-Desktop-debug folder.

Then the GUI window for Manchester Baby simulator will automatically appear:

3cadf57822f63a9ff5c36690e5ef918

The large text display area on the left in the window represents the machine code generated by the assembler. If the window does not appear, or the machine code seems to differ from what should be translated from your assembly language program, it's likely that something is wrong with the assembler language file provided. Check the log.txt in these cases.

There are three buttons to interact with in the simulator window:

  • Reload MC: Refreshes the machine code display area. It's unlikely that you need to press this manually at any stage, for this will be done automatically when starting the program, and when the Manchester Baby simulator is running.
  • Run: Starts (or restarts) running the simulator. The program will execute each step at 1-second intervals. If you are using it for restarting, note that the memory could have been updated during the baby's last execution and restarting may lead to inconsistent results with expectations.
  • End: Stops the simulator, like manually giving a HALT instruction to the baby. This only works when the simulator is running.

The information panel on the right displays all the essential information during execution.

⚙️ Additional Information

Please ensure that your system does not have any overly dependencies that might conflict with the project. This project has been tested with GCC 7.5.0 and GNU Make 4.1.

😎 Thanks

Thanks to the team members for their long hours of investment in this project.Our main contributions are listed below:

  • Siyu Yan: Responsible for the construction of the basic main functions of simulator, project organization, and video recording.
  • Jason Cai: Responsible for the improvement of additional functions of simulator, the construction of GUI, and partial debugging.
  • Haoyang Lai: Responsible for the construction of assembler code and debugging of part code.
  • Siqi Peng: Responsible for assembler code packaging and video editing.
  • Zibang Nie: Responsible for environment configuration and report writing.

You can find our project video on bilibili at The Manchester Baby Demonstration-哔哩哔哩


License

MIT License

About

Projects written in C++ in windows and linux dual systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published