Mk-S 1.1. CPU
1 Stars     63 Views    

Author: Dylan Baer

Project access type: Public

Description:

This is an improved version of my previous CPU. Here are the improvements:

  • Added 13 more registers
  • Improved the instructions decoder
  • Added a second input
  • Revised some of the commands


+++ Register Documentation +++

Main Registers:

  • 0000: Register O
  • 0001: Register 1
  • 0010: Register 2

Open Registers:

  • 0011: Register A
  • 0100: Register B
  • 0101: Register C
  • 0110: Register D
  • 0111: Register E
  • 1000: Register F
  • 1001: Register G
  • 1010: Register H
  • 1011: Register I
  • 1100: Register J

Reserved Registers:

  • 1101: Register X
  • 1110: Register Y
  • 1111: Register Z


+++ Command Documentation +++

  • 00000 - No Operation
  • 00001 - Addition [Sets register O to the sum of registers 1 and 2]
  • 00010 - Subtraction [Sets register O to the difference of registers 1 and 2]
  • 00011 - Increment [Sets register O to register 1 plus one]
  • 00100 - Decrement [Sets register O to register 1 minus one]
  • 00101 - Not [Sets register O to not register 1]
  • 00110 - And [Sets register O to register 1 and register 2]
  • 00111 - Or [Sets register O to register 1 or register 2]
  • 01000 - Shift Left [Sets register O to register 1 shifted left]
  • 01001 - Shift Right Logically [Sets register O to register 1 shifted right logically]
  • 01010 - Shift Right Arithmetically [Sets register O to register 1 shifted right arithmetically]
  • 01011 - Greater Than [Sets register O to the truth value of register 1 is greater than register 2.   0 = False, 1 = True]
  • 01100 - Less Than [Sets register O to the truth value of register 1 is less than register 2.   0 = False, 1 = True]
  • 01101 - Is Zero [If register 1 is zero, register O is set to true. Otherwise, register O is set to false.   0 = False, 1 = True]
  • 01110 - Set [Sets the register with address of input 2 to the value of input 1]
  • 01111 - Copy [Copies the value in the register with address of input 2 to the register with address of input 1]
  • 10000 - Clear [Sets the register with an address of input 1 to zero]


+++ Notes +++

  • Reserved Registers are there to be used for future features that don't exist yet such as a stack pointer
  • Open Registers are just extra memory that can be accessed quickly
  • Register O can not have a value set or copied to it

Created: Aug 07, 2020

Updated: Jun 30, 2023


Comments

You must login before you can post a comment.