GokselOnal / ProjectCPU

Project of CS240-Computer Architecture course at Özyeğin University

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ProjectCPU

16-bit Instruction Word (IW) of ProjectCPU

                                IW
               |----------------------------------
  bit position |15    13| 12                    0|
               |----------------------------------
    field name | opcode |           A            |
               |----------------------------------
     bit width |   3b   |          13b           |
               |----------------------------------
			   

i: Every instruction can operate in indirect addressing mode, if A==0, replace *A above with **2.


Instruction Set of ProjectCPU

ADD -> unsigned Add

    opcode = 0
    W = W + (*A)
    write(readFromAddress(A) +W) to W
    *A = value, address A = mem[A]

NAND -> bitwise NAND

    opcode = 1
    W = ~(W & (*A))

SRRL -> Shift Rotate Right or Left

    opcode = 2
    if((*A) is less than 16) W = W >> (*A)
    else if((*A) is between 16 and 31) W = W << lower4bits(*A)
    else if((*A) is between 32 and 47) W = RotateRight W by lower4bits(*A)
    else W = RotateLeft W by lower4bits(*A)

GE -> Unsigned Greater Equal

    opcode = 3
    W = W >= (*A)

SZ -> Skip on Zero

    opcode = 4
    PC = ((*A) == 0) ? (PC+2) : (PC+1)

CP2W -> Copy to W

    opcode = 5
    W = *A

CPfW -> Copy from W

    opcode = 6
    *A = W

JMP -> Jump

    opcode = 7
    PC = lower13bits(*A)

About

Project of CS240-Computer Architecture course at Özyeğin University


Languages

Language:Verilog 80.4%Language:Assembly 19.6%