BitCruncher v1

  • KBD2
    14th Jul 2019 Member 1 Permalink

    My first full computer. Been working on it for a couple of months.

     

     

    The specs:

    • Variable size: 10 bits 
    • ROM size: 512 bytes
    • 16 commands, including a random number generator
    • 8 registers

    Commands (R is a register, C is a constant value):

     

    MOV R, R/C: Moves B into A
    ADD R, R/C: Adds B to A, stores in A
    INC R: Increments A, stores in A, wraps 1023 around to 0
    DEC R: Decrements A, stores in A, wraps 0 around to 1023
    AND R, R/C: Performs AND on A and B, stores in A
    OR R, R/C: Performs OR on A and B, stores in A
    XOR R, R/C: Performs XOR on A and B, stores in A
    LSH R, R/C: Shifts A left LSSB of B bits, stores in A
    RSH R, R/C: Shifts A right LSSB of B bits, stores in A
    JMP R/C: Jumps to index A of ROM
    JEZ R/C, R: Jumps to index A of ROM if B is equal to zero, else continues
    JOV R/C: Jumps to index A of ROM if the last ADD operation resulted in an overflow, else continues
    IN R: Halts until an input signal is given, then moves the input bus to A
    OUT R/C: Moves A to the output bus and gives a signal
    RND R: Moves a random number from 0 to 1023 into A
    HLT: Halts program

     

    INC and DEC is much faster than adding and subtracting due to the adder design.

     

    FILT ctype layout:

    DCBA9876543210FEDCBA9876543210
    MUUUCCCCr1111111111r2222222222
    M: Must be set
    U: Unused
    C: Command
    r: Sets whether arg 1 is a register value or a constant (1 for register, 0 for constant)
    1: Arg 1
    r: Sets whether arg 2 is a register value or a constant (1 for register, 0 for constant)
    2: Arg 2

     

    Compiler and ROM loader scripts

    ^Definitely a work in progress!

     

    The biggest bottlenecks in this computer are the circuits that load arguments A and B (which may include fetching from registers). I'd love to be able to do this in parallel instead of one after the other in my next computer.

    Edited 2 times by KBD2. Last: 27th Feb 2022