My first CPU

  • iamdumb
    30th Jul 2014 Member 5 Permalink

    I've made a CPU. 

    It's my first one, so I'm probably going to get a lot of comments saying how badly I did some things, but it works, so I'm happy.

     

     

    Bits: NNNNNNIIIIIDDDDDD N=address of next instruction, I=Instruction, D=data to be appended to the buffer.

    Instruction set (I'm new to processor architecture and everything like that):

    10000 = Clear A ALU data
    10001 = Clear B ALU data
    10010 = Invert A ALU data
    10011 = Invert B ALU data
    10100 = If A jump to first line.
    10101 = Copy A ALU data to B input data
    10110 = Read buffer into A
    10111 = Add input data into A and B
    11000 = left shift A
    11001 = left shift B
    11010 = Clear A input data
    11011 = Clear B input data
    11100 = Open input
    11101 = Close input
    11110 = Print B AND append to buffer
    11111 = Append B into the buffer.

     

    Credit to @arK for the buffer.

     

    The fibonacci program:

     

    000000 00000 100000 // Append 1 to the buffer and move to address 1

    100000 10110 000000 // Read buffer into A and move to address 2

    010000 10111 000000 // Add input data into A and B and move to address 3

    110000 10101 000000 // Copy A ALU data to B input data and move to address 4

    001000 11010 000000 // Clear A input data and move to address 5

    101000 10111 000000 // Add input data into A and B and move to address 6

    011000 11110 000000 // Print B and append to buffer and move to address 7

    111000 11010 000000 // Clear A input data and move to address 8

    000100 11011 000000 // Clear B input data and move to address 9

    100100 10101 000000 // Copy A ALU data to B input data and move to address 10

    010100 10111 000000 // Add input data to A and B and move to address 11

    110100 10000 000000 // Clear A and move to address 12

    001100 10110 000000 // Read buffer into A

    101100 11011 000000 // Clear B set data

    101000 10111 000000 // Add input data to A and B

     

    :D

     

     

    Edited once by iamdumb. Last: 30th Jul 2014
  • levonchic
    30th Jul 2014 Member 0 Permalink

    cool :)

  • VladislavMotkov
    1st Sep 2014 Member 0 Permalink

    +1

  • h4zardz1
    1st Sep 2014 Member 0 Permalink
    no +1 posts plz.
  • Dumpling
    4th Jan 2015 Member 0 Permalink

    Congrats! Now to make mine :P

  • Klus
    4th Jan 2015 Member 0 Permalink

    I have no idea what any of this even means so I like it.