Git Product home page Git Product logo

final-project-computer-architecture's Introduction

Final Project Computer Architecture

This is a CPU Emulator of a custom architecture designed for a class. We are a group of 3 Computer Science Students at CETYS Universidad, and are proud to present this final project.

Instalation

The emulator is hosted online at the github pages asociated with this repository: Here is the link for the live demo.

There are no additional setup needed for it to get working

Usage

There are two ways of "loading" programs to the CPU:

1.- The first one is to manually change the bits on the ROM, by clicking on individual bits they alternate between 1 (True) and 0 (False).

2.- The second one is to write in the text area provided to interpret a set of instructions to perform.

Once the memory is set up, feel free to click on "Start Clock" to see it running.

Technical Details about the architecture

Instruction Set Summary

Currently, the CPU supports the following instructions:

  • ADD#: 0 0 0 0 - Addition inmediate mode
  • SUB#: 0 0 0 1 - Sustraction inmediate mode
  • AND#: 0 0 1 0 - Logical AND inmediate mode
  • OR#: 0 0 1 1 - Logical OR inmediate mode
  • LDA#: 0 1 0 0 - Load to Accumulator innmediate mode
  • MVA: 0 1 0 1 - Move from Accumulator to specified address
  • MVR: 0 1 1 0 - Move from register to Accumulator
  • ADD: 1 0 0 0 - Addition direct mode
  • SUB: 1 0 0 1 - Substraction direct mode
  • AND: 1 0 1 0 - Logical AND direct mode
  • OR: 1 0 1 1 - Logical OR direct mode
  • NOP: 1 1 1 1 - No operation

instruction-set

The virtual Memory, Registers

The CPU works with the following memory/registers:

  • PC - Typical program counter.
  • MAR - Register to store the address to check next.
  • ROM - For store the information of the program.
  • RAM - To store values.
  • MDR - To store the output from the memories.
  • MIR - To store the operation to perform on the ALU.
  • ACCUMULATOR - The register where operations results are stored.

Data format

We followed the Big Endian format consistenly, registers other than the ROM only store numeric values, so there is no need to parse there.

On ROM, there are 8 bits, the first 4 are for the OPCODE of the instruction, meanwhile the other 4 represent a value or an address, depending on the OPCODE

Timing issues and Performance

Keeping everything synchronized was a priority for the emulator to work, but thanks to clever code architecture, we were able to make an event-based code, not allowing things to work out of the order they were supposed to.

Performance-wise, the emulator can do the provided operations almost inmediately, the delay is meant to allow users to see the execution cycle.

final-project-computer-architecture's People

Contributors

fangoh avatar imgbotapp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.