Working 8-bit CPU =D

    Joined
    Apr 29, 2015
    Messages
    17
    Reaction score
    16
    • Purchased!
    Hi there,

    Not sure where to post this, since it's not really a ship; I've been working on this build for ~10 days, finished it today. Thought peeps might be interested in it.


    This is fully functional, I've implemented everything I wanted except MUL & DIV, cos those are just tedious.

    Edit: Copied and pasted from the YouTube description. The full instruction set and listing are given there also.

    Final stats for the build (logic only):
    DELAY-Signal: 2264
    Activation Module: 6280
    AND-Signal: 9250
    NOT-Signal: 1003
    OR-Signal: 3461

    Grand Total: 23,258 Logic Blocks, including those in the display.

    NeonSturm kindly noted that it would use a lot less blocks if I weren't using Stable. Ah well.

    Cheers, Neil.
     
    Last edited:

    takethispie

    Titan-class builder
    Joined
    Oct 3, 2012
    Messages
    239
    Reaction score
    103
    • Purchased!
    • Wired for Logic
    • Legacy Citizen 9
    some stats maybe ? ^^
    what is the architecture of this one ?
    'cause I built one as soon as logic was implemented and another one few months ago but couldn't make them work correctly
    because of a strange behavior of the logic :/
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    Today, an 8 bit processor. Tomorrow, in-game Super Mario Bros!
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Perhaps we can build a compiler.
    I am currently learning more stuff about creating a language and compilers.

    Variable:

    Using a .variable yields the variable with a .function if required.

    -> Using a .variable is using a function of the previous expression.


    :Variables may ommit the dot in exchange for a double-dot.

    -> Double-dotted :Variables are functions of the current block and recursively.


    The function may be the default function.

    -> The call is optimized or simplified at compile time.


    Undeclared variables may appear exactly 2 times in the same block.



    Dynamics:

    Dynamics are heaps and stacks which can be used like variables and which yield many values.

    -> They may be stacks (-> stacks LIFO ).
    -> They may be heaps (-> heaps FIFO streams pipelines buffers).

    -> They may yield just one value.
    -> They may yield nothing.



    Function:

    Functions come in 3 different flavours : Prefix, Infix, Sufix (aka Postfix)

    -> Inbuild functions are: _prefixed_fn, _infixed_fn and _sufixed_fn.
    -> Inbuild dynamics are: _Prefix, _Infix and _Sufix and (if used) _Result.

    -> _Prefix is a Stack
    -> The first read will create a function-wide stack iterator.
    -> Any read will yield a function-wide stack iterator.
    -> Copy on demand. Preserve iterator coherence.

    -> _Sufix is a Heap
    -> The first read will create a function-wide heap iterator.
    -> Any read will yield a function-wide heap iterator.
    -> Copy on demand. Preserve iterator coherence.

    -> _Infix yields the function Statement itself.

    -> the side (left, right) where the variables are called is clearly visible by a dot.

    -> .prefix
    -> .infix.
    -> sufix.

    .function. :: _infixed_fn >> r1, r2

    _Prefix >> a1, a2
    _Infix >> fn
    _Sufix >> b1, b2

    printf. "Expressions are:\n %s \n %s \n %s \n %s \n %s"
    _ a2, a1, fn, b1, b2

    return r1, r2
    //fn

    r1, r2 := a2 a1 .function. b1 b2
     
    Joined
    Sep 4, 2013
    Messages
    723
    Reaction score
    200
    • Purchased!
    • Legacy Citizen 5
    Perhaps we can build a compiler.
    I am currently learning more stuff about creating a language and compilers.

    Variable:

    Using a .variable yields the variable with a .function if required.

    -> Using a .variable is using a function of the previous expression.


    :Variables may ommit the dot in exchange for a double-dot.

    -> Double-dotted :Variables are functions of the current block and recursively.


    The function may be the default function.

    -> The call is optimized or simplified at compile time.


    Undeclared variables may appear exactly 2 times in the same block.



    Dynamics:

    Dynamics are heaps and stacks which can be used like variables and which yield many values.

    -> They may be stacks (-> stacks LIFO ).
    -> They may be heaps (-> heaps FIFO streams pipelines buffers).

    -> They may yield just one value.
    -> They may yield nothing.



    Function:

    Functions come in 3 different flavours : Prefix, Infix, Sufix (aka Postfix)

    -> Inbuild functions are: _prefixed_fn, _infixed_fn and _sufixed_fn.
    -> Inbuild dynamics are: _Prefix, _Infix and _Sufix and (if used) _Result.

    -> _Prefix is a Stack
    -> The first read will create a function-wide stack iterator.
    -> Any read will yield a function-wide stack iterator.
    -> Copy on demand. Preserve iterator coherence.

    -> _Sufix is a Heap
    -> The first read will create a function-wide heap iterator.
    -> Any read will yield a function-wide heap iterator.
    -> Copy on demand. Preserve iterator coherence.

    -> _Infix yields the function Statement itself.

    -> the side (left, right) where the variables are called is clearly visible by a dot.

    -> .prefix
    -> .infix.
    -> sufix.

    .function. :: _infixed_fn >> r1, r2

    _Prefix >> a1, a2
    _Infix >> fn
    _Sufix >> b1, b2

    printf. "Expressions are:\n %s \n %s \n %s \n %s \n %s"
    _ a2, a1, fn, b1, b2

    return r1, r2
    //fn

    r1, r2 := a2 a1 .function. b1 b2
    I think Your dreams came too far. It would be terribly slow if even work.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I think Your dreams came too far. It would be terribly slow if even work.
    True, StarMade isn't ready for that. (HAHA :D)

    It just takes 20 seconds per user-input even if you use parallel processors and keep the internal representation updated instead of doing all after it's requested.
     

    Asvarduil

    Builder of Very Small Ships
    Joined
    Apr 17, 2015
    Messages
    272
    Reaction score
    133
    • Community Content - Bronze 1
    • Purchased!
    Can you upload this 8bit computer as a ship please? As a programmer, I'd be VERY interested to look at this.

    Alternatively, could this 8bit computer be added to the game as a single block? It'd be awesome to have computer science happening in a space game, because I'm a super-geek (but, not as super as the OP! Holy heck.)
     
    Last edited:
    Joined
    Apr 29, 2015
    Messages
    17
    Reaction score
    16
    • Purchased!
    some stats maybe ? ^^
    what is the architecture of this one ?
    'cause I built one as soon as logic was implemented and another one few months ago but couldn't make them work correctly
    because of a strange behavior of the logic :/
    Yes, I did see that. I have edited the original post with some stats related to the logic block counts.
    Regarding architecture, it is my own design. You could classify it as either MISC or RISC if you wanted.
    I was initially going to implement an ARM Thumb processor, but decided it was still too complex for the given time frame I had allowed myself (two weeks).

    For the most part, it is single cycle, however uses two cycles for LOAD/STORE, thanks to having only one data path. The instruction set was designed to be simple, and the whole thing was built as modules so I could test each part/instructions functionality as it was made.


    Can you upload this 8bit computer as a ship please? As a programmer, I'd be VERY interested to look at this.

    Alternatively, could this 8bit computer be added to the game as a single block? It'd be awesome to have computer science happening in a space game, because I'm a super-geek (but, not as super as the OP! Holy heck.)
    I have uploaded it to Community Content, with some basic instructions, just now. Hopefully it will be approved, I guess.
    It wouldn't be that hard to program either a logic block like this, which would certainly be much much faster, and a compiler. It would be interesting having a block with such properties.

    Cheers, Neil.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Flip-Flop power - 4 clocks, 8 blocks -> connected to one flipper = 0.125sec per outgoing pulse.
     

    Keptick

    Building masochist
    Joined
    Sep 26, 2013
    Messages
    4,062
    Reaction score
    1,841
    • Councillor 2 Gold
    • Railman Gold
    • Thinking Positive Gold
    Here I am, feeling proud, sitting on my little gravity tube hub that contains 130-150 logic blocks.

    And then there's you, with a flippin' computer made up of TWENTY THOUSAND TWO HUNDRED AND TWENTY EIGHT FUCKING LOGIC BLOCKS. I lift my hat to you good sir, this is truly amazing.
     

    Thalanor

    CEO Snataris Colonial Fleetyards
    Joined
    Sep 10, 2013
    Messages
    818
    Reaction score
    708
    • Master Builder Bronze
    • Thinking Positive
    • Legacy Citizen 3
    <3 CPUs in voxel games. Starmade can apparently even have an 8-bit CPU without requiring an entire server like minecraft.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Power to bend space and travel between the stars, 8 bit computers still take up entire warehouses...
     
    • Like
    Reactions: Chaosinflesh

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I guess the memory and (de-)multiplexers.
    How many of those do you have?

    I need about +20% control logic for RAM at 10x10y2z and +10% for 18x18y2z logic.
    Then again 1/n (n=?x?x2 chips) for the RAM controller.

    Where else do you need so much serial<-->parallel conversion?
    For a display? Just handle it with a RAM-duping frame-buffer.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    Where else do you need so much serial<-->parallel conversion?
    That entirely depends on how the CPU is constructed. (I didn't look at the blueprint yet, so that is an unknown variable from my perspective)
    Sometimes a (de-)multiplexer is hidden within a bigger structure. (Basically any parallel circuit of ANDs, that are connected to a common OR acts as a 1-bit demultiplexer; and any output, that splits into a series of parallel ANDs atcs as a 1-bit multiplexer, but I think you know that already)
    And as the size of a (de-)multiplexer not only grows with it's number of in-/outputs, but also with the "size" of each in-/output, a multiplexer can grow pretty fast, even if we were to exclude a decoder for binary signals from the selection-input.
     

    Asvarduil

    Builder of Very Small Ships
    Joined
    Apr 17, 2015
    Messages
    272
    Reaction score
    133
    • Community Content - Bronze 1
    • Purchased!
    Power to bend space and travel between the stars, 8 bit computers still take up entire warehouses...
    Yep. We're definently in the Star Wars universe.

    Remember, kids: If it looks like a moon, moves like a moon, but has TIE Fighters and lasers, that's no moon...