BORIS CPU's

BORIS CPU's

Using My CPU

My CPU ASSEMBLY Python Compiler BINARY Input ↓ to bottom ↓

My CPU

here i will explain how to use my CPU, how it works(surface lvl), and inner workings(surface lvl)


a few things to note about this CPU

there are 4 general purpose registers(denoted by "R_") that you can apoint: "R0", "R1", "R2", "R3".

this CPU has the following CPU cycle: Fetch -> Decode&Execute / Store -> Increment PC / Store -> Wait

each of these are 2 clock cycles ( 1 clock cycle is: clock ON(1), clock OFF(0) )


 clock OFF ( 0 )          clock ON ( 1 )




ASSEMBLY


u will need to know the CPU intruction set (aka the operations that my CPU can perform)

and thats about it


here it is in short

the following is a tree of all posibilities and all the assembly intructions converted into binary, its a bit easier to comprehend


if we wanted to write a line of assembly it would look a bit like this:
"ALU SUB R2 R3" and the binary equivalent would be: "11 10 01 00"
so "ALU SUB R2 R3" = "11 10 01 00"

here are a few examples:





Making a Python compiler

the CPU cannot read assembly therefore we need to convert it to binary

the way we do this is through compilers

while manually in ur head turning the assembly into binary is fine, a python compiler is much faster and u can think less

i have made a python compiler specific to my CPU intruction set that will turn the assembly inputed into binary

im not going to explain how the python compiler actually works im just gonna give u the python script and tell you how to use it

you can use the online python website below

after paste-ing the code below you can click run and the program will start

it will ask u to input assembly

all u need to write is one of the options




BINARY Input

now we need to input the intructions into memory

at the very top of the monstrosity that is my CPU below, there is a place for manual input into memory(look at the image below)

in the manual input there are a few buttons and inputs, the image below describes them