Fazer Mini: working 8 bit CPU

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    I built a little cpu just to know if logic works fine while using few hundred gates and well, it's not
    the "server not responding" message appears almost every time I activate an activation module... :(
    I know that my cpu works as I have been building 16bit and 32bit cpu for years now ^^

    here are the screenshots:



    you can see the multiplexer of the ALU and the 4bit data bus going from the ALU output to the register bank (the 3 column in the back , each column is a 4bit D-flip flop register)




    this is a 4*10bit RAM



    it's a MIPS (microprocessor without interlocked pipeline stage ) and it was just a test I didn't wanted to start building a CPU starmade could not handle x)
    I hope schema will improve the logic system soon, I can't wait to start building my 32bit CPU \o/
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Why did you made a 4x10 bit register and not 4x 8 or 16 bit?

    How much experience do you have with building CPUs / Where did you got that from?

    I think all the pipes are a bit confusing (at least from these perspectives)

    Maybe I will build soon my own terminal emulator to give commands to my ship :D
    But first weapon system has to get fixed and I need more experience with ship interior and airflow+signal-pipe design anyway.
    (I never start building something if I don't know for what it will be useful except to try some interesting new mechanics out)
     
    Joined
    Aug 30, 2013
    Messages
    1,744
    Reaction score
    323
    Yeah, agree with WolfChild how bored do you even need to be to make this?

    Also WTF you made a 32 bit cpu? I hope you mean ingame, I'm not very good with circuits but I think you should work for Intel if you made one IRL...
     
    Last edited by a moderator:
    Joined
    Jul 25, 2013
    Messages
    529
    Reaction score
    137
    • Purchased!
    • Legacy Citizen 3
    ToyotaSupra Maybe he didn't get bored and just didn't have the materials to do it IRL? I couldn't do it in either. I struggled to make a simple airlock that had one NOT gate and three activators and that was the entire circuit. . . . :( Logic is not my strong suit.
     
    Last edited by a moderator:

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    NeonSturm it's a 3*4bit register bank (Ra,Rb,Rc) not 4*10bit wich is for the ram

    I'm using Logisim, an awesome software where you can use basic gates but also very complex part like ram, multiplexer/demultiplexer, shift function etc... you connect everything with wire (can be 1bit or be a bus with max size of 32bit, really good as you don't have hundred of wire going everywhere ) and it's pure logic not electronic , I can't afford a FPGA to do it IRL, also the design software to programm on fpga aren't user-friendly at all (it almost takes hours to create a working full adder when it takes 2 seconds in Logisim)

    on Logisim I've built around 12-13 CPUs (3 8bit CPUs, 3 16bit CPUs, 5 32bit CPUs and one 64bit CPUs but wasn't really good)
    I started logic with redstone on minecraft, I wanted to make a CPU so I searched on internet and find... well not much, just basic explanations (basic diagrams with the ram , alu , register but nothing on how to build them except full adder)
    and with help of information gathered everywhere and some courses from MIT, I built my first CPU (wich was aweful xD)

    my last CPUs has 64bit instruction, 15 32bit registers, 15 functions ALU (add,sub,mul,div,rem,XOR,left shift , right shift,not, random,comparator, intern memory), 16MB cache , a lot of input/output, the programm can call functions and I'm working on interrupts :)

    yeah sometimes I need C/V because I don't see where a pipe is going xD

    ToyotaSupra why should I be bored doing something I like to do ? anyways this cpu took
    only 1 day to be built :)
     
    Last edited by a moderator:
    Joined
    Sep 27, 2013
    Messages
    684
    Reaction score
    1,247
    Very awesome!

    NeonSturm also the design software to programm on fpga aren't user-friendly at all (it almost takes hours to create a working full adder when it takes 2 seconds in Logisim)
    Yes! I sometimes think those companies are doing that on purpose (Xilinx, damn you!)
     
    Last edited by a moderator:
    • Like
    Reactions: takethispie

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    With logisim (the flash based) I got issues with circuits working differently if you pack them into a custom component.

    Do you know http://de.wikipedia.org/wiki/RSA-Kryptosystem | http://en.wikipedia.org/wiki/RSA_(cryptosystem) ?

    p & q = prim numbers
    r = (p-1)*(q-1)
    n = p*q
    e = prim, (2^16+1) or just choose any other number with greatest shared divisor of e and r = 1

    e^d %n=1
    (source <n)^e %n = code
    (code <n)^d %n = source

    x^e %n = (x^(y<e) %n) * (x^(e-y) %n) %n
    This is the key to get d2 from e & n as you can check any exponent one after another in a loop
    Decode code to source and continue until you get source a second time. Remember number of loop runs to get

    d = d1 + (d2-d1)*x (x is unknown)
    Repeat with another source (->d3, d4)
    Merge (( d = d3 + (d4-d3)*x = d1 + (d2-d1)*x )) by taking the two smallest possible results as d5,d6 in:
    d = d5 + (d6-d5)x

    You will get closer to the real d with each step.


    Maybe it is possible to use a d created by this math to get r (which is (p-1)*(q-1) ) from n (which is p*q)

    7*13 = 91 with no factors except 1, 7, 13, 91 = prim.
    6*12 = 91 -13 -6 or 91 -12 -7 = 72

    If you have 72 and 91, but want to know the only factors, you can get something you can hopefully solve.
    72 / p +1 = 91 / (p+1)
    72 / q +1 = 91 / (q+1)


    Who wants to try to make a circuit for it? ;)
     
    Last edited:

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    NuclearFun thanks ! :)

    I'm sure they are ! (yeah Xilinx... but Altera sucks aswell )
    an open-source GNU licensed FPGA would be the best thing in this world

    NeonSturm nope never heard of that problem , what are you trying to do in logisim with RSA ?
     
    Last edited by a moderator:

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I try to make a logic system in starmade to decode, encode and hack messages :)
    If I can build it small enough for a ship, it will be a lot of fun ^^

    I am thinking of a keyboard-like array of activation blocks (only letters and numbers) -> encode -> enter random-looking letters into chat (RolePlay) instead of just speaking public _every_ time.
     

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    I think the easiest way is to make a CPU to do this or it will be too hard and/or long xD
    (because you need loop , comparison , division , modulo , addition , substraction, memory to store the differents results and loop and all these functions are in a CPU)


    I don't think using RSA encryption would be a good ideain starmade xD , you should rather try to create your own simple encryption/decryption system ^^
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    why not?
    With 128 bit n, 32 bit key, .... you will need 512 bit ram. 1024 to hack a public key.

    I is the only asymmetric I know jet
     
    Last edited:
    Joined
    Jun 28, 2013
    Messages
    92
    Reaction score
    7
    • Purchased!
    • Legacy Citizen 10
    You know....I get this sort of thing, and I find it interesting and entertaining, truly...but I've never had the gumption to bother constructing anything of this sort in-game. XDD Building anything more complex than timers, locks, meters and alarms of varying sorts from raw logic gates tends to drive me batty...I'd just as soon type something up in Lua or Python instead. XDD Props to you, though, for having the willpower, and knowledge, to pull this off, even if it isn't quite working so well yet due to game limitations. ^.=.^
     

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    NeonSturm because it won't work with the actual version of the logic... look, if my basic CPU, wich has almost four times less logic gates
    than your 512bit ram ONLY makes the game server not responding what do you think a whole RSA encryption/decryption system will do ? x)

    but yeah it can be done without big difficulties ^_^

    _TheRealAmeRicA programming robotic submarine is awesome ! :D

    DragonSoulSong well it took me few months JUST to understand the idea and principles of how a CPU work and just then and only then
    I was able to start building my first CPU , but dude , that feeling when it's done , you're like : "it's alive ! IT'S AAALLLLIIVVVEEEE " xD

    but if one day you have the willing to build CPUs (in logisim not starmade), I will give you every documents (PDF, diagrams) I found wich are really helpfull , just ask ;)
     
    Last edited by a moderator:

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    The difference between a program and StarMade logic is, your algorithm is hard-coded.

    It is easier to create a function which directly interacts with a ram part which is built for just 1 type of value and just 2-3 functions.
     

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    yeah it's easier but with all the operations you need to encrypt/decrypt you will end up with something really bigger than a CPU and at the same time it will almost be like a CPU :/
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    The most difficult thing would be the output of a 128*128 bit multiplication. I don't want a 20k bit ram and even with 64*64 it would be 4k bit ram just for the result.

    First, I need a way to add a modulo into a multiplication. My ability to make this will dictate how big the rest will be or if it is possible.