Git Product home page Git Product logo

cpu-architecture's Introduction

Introduction

This is a 16-Bit CPU architecture project, along with an assembler capable of accepting the commands listed below, separated by function within the programming.

The assembler is capable of converting from assembly to binary or hexadecimal; to use with Logisim it is necessary to convert to hexadecimal and place it inside the ROM memory that is in the main component.

OpCodes

Legend
  • AAAA = Address of an A register
  • BBBB = Address of an B register
  • XXXX = Will be ignored
  • CCCC CCCC = 8 bit C constant
  • LLLL LLLL LLLL = Label used for jumps in 12-bit code

ULA

inst OpCode Description
and 1111 0000 AAAA BBBB A = A & B
sub 1111 0001 AAAA BBBB A = A - B
mult 1111 0010 AAAA BBBB A = A * B
div 1111 0011 AAAA BBBB A = A / B (Integer Division)
nand 1111 0100 AAAA BBBB A = !(A & B)
rsh 1111 0101 AAAA BBBB A = A >> B
xnor 1111 0110 AAAA BBBB A = !(A ^ B)
inc 1111 0111 AAAA XXXX A = A + 1
dec 1111 1000 AAAA XXXX A = A - 1
xor 1111 1001 AAAA BBBB A = A ^ B
not 1111 1010 AAAA BBBB A = !A
nor 1111 1011 AAAA BBBB A = !(A | B)
lsh 1111 1100 AAAA BBBB A = A << B
add 1111 1101 AAAA BBBB A = A + B
ivt 1111 1110 AAAA BBBB A = -A
or 1111 1111 AAAA BBBB A = A | B

Jumps

inst OpCode Description
jump 0001 LLLL LLLL LLLL Jump
je 0010 LLLL LLLL LLLL Jump if equal
jne 0011 LLLL LLLL LLLL Jump if not equal
jg 0100 LLLL LLLL LLLL Jump if greater than
jge 0101 LLLL LLLL LLLL Jump if greater or equal
jz 0110 LLLL LLLL LLLL Jump if last value is zero

Movs

inst OpCode Description
movcosnt 1000 AAAA CCCC CCCC A = C
load 1001 0001 AAAA [BBBB] A = *B
store 1001 0010 [AAAA] BBBB *A = B
mov 1001 0011 AAAA BBBB A = B
push 1001 0100 AAAA XXXX Put value A on the stack
pop 1001 0101 AAAA XXXX Remove value from stack

Compare

inst OpCode Description
cmp 1100 XXXX AAAA BBBB Compare A with B
cmpcosnt 1110 AAAA CCCC CCCC Compare A with C

Functions

inst OpCode Description
call 1010 LLLL LLLL LLLL Call a function
ret 1011 XXXX XXXX XXXX Return a function

Others

inst OpCode Description
nop 0000 XXXX XXXX XXXX Does not do anything

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.