This is a redstone CPU that I've been building over the last month. You can write up to 16 lines of code to memory, then have it execute that code, and even print the result in hexadecimal onto 7 segment displays.
VIDEOS:
SPECIFICATIONS:
32-Bytes of program memory (can hold 16x 2-Byte instructions)
2-Byte instruction words
14-Bytes of RAM (14x 1-Byte registers)
2-Bytes of user input (2x 1-Byte input registers)
8-Bit ALU (add, subtract, and, or, not, xor, left/right shift/rotate, random number)
0.208 Hz (4.8s period/ 24 clock)
4x 7-Segment Displays (with 4x 4-Bit display registers)
Carry Select adder/subtractor (faster than ripple carry, and carry look ahead)
Can load 8-bit values into registers
Can branch conditionally
Can print 2-Bytes to the display in hexadecimal.
instruction word format: AAAABBBBCCCCDDDD
$ - means a memory location in RAM.
# - means a line in the program memory.
op-code (A):
0000 - ADD($B+$C)->$D
0001 - SUBTRACT($B-$C)->$D
0010 - LEFT SHIFT($B )->$D
0011 - LEFT ROTATE($B )->$D
0100 - RIGHT SHIFT($B )->$D
0101 - RIGHT ROTATE($B )->$D
0110 - AND($B,$C)->$D
0111 - OR($B,$C)->$D
1000 - NOT($B,$C)->$D
1001 - XOR($B,$C)->$D
1010 - PRINT($B,$C,D)->screen (D specifies if a screen can be changed or not, 1 = writable, 0 = no change)
1011 - LOAD(BC)->$D
1100 - IF($B,$C)->#D (branches if B == 0, and C == 0)
1101 - RAND()->$D
1110 - DELETE()->$D
1111 - DELETE()->$D
*i permit anyone to use the designs i have made, as long as i am given some credit, and they are used for non-commercial purposes. what i want to avoid is people claiming that they made this cpu, when they really didn't.
if anyone finds errors or bugs follow these steps:
1)make sure your code WORKS!
2)send me a pm or post in this thread; the code you tried to use (1's and 0's), what it is meant to do, the input you gave it (if any), the output it gave, and the output you expected.
and when coding, remember that it can only hold 16 lines of code, and can only perform 8-bit operations.
This CPU was made with extensive use of INVedit, MCedit and peaceful difficulty, and wouldn't have been possible without them.
I likethe 1st computer in RL.... gigantic. hopefully with advancements in MC redstone technology (i've been thinking about a "redstone workbench" used to make diffent gates like not, or, nor, and, xand, xnor etc, fit into one block of space. and maybe put the "not gate item" onto the bench with a "xor" to make an xnor) but that's another topic altogether.
add, subtract, and, or, not, xor, left/right shift/rotate, random number
Wow. What part of memory is actually displayed on the screen? Or is there only 1 value in Ram?
This is cool. Implement an random auto-counter, take a video of it, please????
Start at 0, then add a random number, every 5 seconds. :smile.gif:
the print operation just loads values into the display registers, which in turn automatically display the values on the screen. if you look at the top down view of the whole cpu you can see that i've made all the registers out of mossy cobblestone, so they are easy to point out. the registers in the display section of the cpu hold the values. the first register displays the 4 most significant bits stored in memory location $B, the second is the least significant of $B, the third is the most significant of $C and the fourth is the least significant of $C.
the RAM can hold up to fourteen 8-bit values, there are also two input registers that can be read like the RAM, but cannot be written to, which makes up a total of 16 different addresses.
the random number generator is just 8 different prime clocks (clocks based on prime numbers) that needs to be switched on manually before running the program (if it was activated automatically, it would produce the same 'random' numbers every time).
here's the random number output from when i was testing it:
48,176,75,237,14,148,51,235,77,245,54,128,107,233,201,41,135,20,246,73,137,56,177,7,228,106,153,57.
I've plotted these on a line, and there seems to be a little bit of clumping, but is so small that it could just be bad luck.
Quote from brendanan »
I likethe 1st computer in RL.... gigantic. hopefully with advancements in MC redstone technology (i've been thinking about a "redstone workbench" used to make diffent gates like not, or, nor, and, xand, xnor etc, fit into one block of space. and maybe put the "not gate item" onto the bench with a "xor" to make an xnor) but that's another topic altogether.
Nice work, and see if you can make it better.
I've been thinking about expanding the ALU to 16-bits, and trying to synchronize it better from the start for a faster clock rate. however these things would require me to start basically from scratch, and would take me another month to finish.
MineCraft itself makes use of random numbers in a few places. Look out for those and find one that can be implemented into your CPU for really random numbers.
For example, when a block is destroyed, the item that is spawned has a random direction and speed. Have a small cactus farm popping out random cacti on random pressure pads or something, and you have a RNG using Java's RNG. :smile.gif:
Wow, that looks pretty cool. What exactly can it do? I don't know that much about computers. :tongue.gif:
Could you play Minecraft in Minecraft? :ohmy.gif: Fun.
c'mon. you already know the answer to that question.
the only 'real' program i've got it to run so far is multiplication, where it takes 2x 8-bit numbers from the user, and multiplies them. as long as the result is less than 255 it should give the correct answer. unfortunately it can take up to 3 minutes to get that answer.
MineCraft itself makes use of random numbers in a few places. Look out for those and find one that can be implemented into your CPU for really random numbers.
For example, when a block is destroyed, the item that is spawned has a random direction and speed. Have a small cactus farm popping out random cacti on random pressure pads or something, and you have a RNG using Java's RNG. :smile.gif:
even real computers can't make 'true' random numbers. in my system, the 'random' factor, is a combination of prime clocks, and the time it take a player to walk from the random number switch to the 'ON' switch, i gave an example of the numbers it makes in a previous post.
i thought about using cactus, but they are too slow and big to be worth it. my prime clocks method produces sufficiently random numbers for my cpu, is very fast, and doesn't take up much space.
You know its funny seeing these PC's inside of MC, because in the 60s and 70s when PCs were in their infancy, The Ops' post was about the size of a PC then.. only difference is I think his PC had more power and memory...(The last part is a half ass joke..)
Totally sick. Everytime I see one of these, or a short youtube clip, they're never finished and they always say they just need to add ram or a display or a bridge of some sort. Yours looks full and legit so PLEASE give us a youtube display of its awesomeness!
plus I cracked a big 'ole smile at the .208 Hz for the speed. That is just special.
I wonder if there will be a time, where you can make computers in a single block, which can compete with the computer running minecraft itself...
I know nothing of the magic you used to make the cpu, reccomend books/resources to read up? (keeping in mind im a total beginner)
i only had a basic understanding of logic gates, flipflops, and adders before starting this project. i built it step by step, adding whatever i thought it need. i didn't follow any existing cpu architecture, so it is possible that mine is completely unique.
what i did:
1. decide on instruction word size (mine is 16-bit), and ALU size (mine is 8-bit)
2. build a giant block of memory, and a way to write values to each one. this can be a LOT of levers, or a counter that selects which line you are writing to.
3. build a bus along the outputs of your memory flip flops, and use another counter (i actually used D flip flops feeding into each other) to select only 1 instruction to be sent onto the bus at any one time. the counter activates a heap on AND gates on only 1 of the memory slots, meaning all the other slots are having their output blocked from getting onto the bus.
4. ...keep going until it does stuff. i also recommend testing every part as you implement it.
just simple steps, one at a time. i had no idea how it would turn out in the end, how long it would take, or if i would even succeed.
in other peoples cpu's i hear about lots of specific registers, 'flags', and other things i don't understand. mine really only has general registers that it uses as ram and has no flags, but it can run a program saved to its memory, so i'm happy. :biggrin.gif:
key words to google: bit wise logic, flip flop, sum of products, Arithmetic Logic Unit, bus, combinational logic, sequential logic, mux, encoder, decoder, adder, and, or, not, xor (useful for controlling whether a bus is inverted or not).
hope that helped a little.
i may try to make a gate diagram of my CPU in the future, to show how it works in better detail.
Quote from Etherel15 »
Totally sick. Everytime I see one of these, or a short youtube clip, they're never finished and they always say they just need to add ram or a display or a bridge of some sort. Yours looks full and legit so PLEASE give us a youtube display of its awesomeness!
plus I cracked a big 'ole smile at the .208 Hz for the speed. That is just special.
yeah, i built mine in this order: program memory -> RAM -> ALU -> display
doing the ALU before the RAM... well that would just leave your buses a mess! my buses follow straight lines out from the RAM, and the ALU functions just sit perpendicular to them, and attach to the side. neat and easy.
another thing that i've done, but i don't know if it's unique, is that my buses are verticle. this means that they are only 1 block wide, but it does make my cpu very high and i died many times by falling from the top. xD
oh by the way, if you noticed in my first post, there are 2 op-code commands to delete the value stored in a register. they only do that because they don't do actually do anything, and leave the bus at all 0's when it is time to write. if anyone has any ideas for 2 other practical operations for the ALU to perform, please tell me.
i was thinking maybe a counter connected to a 10 clock, so the CPU would be able to know how many seconds had passed since it was turned on. but i was leaning away from the idea, because the CPU is so slow, that the value would be at least 5 sec old before it could be displayed on the screen.
and please don't suggest anything that would be too complex to build or too slow to compute a result.
Note: Next time you feel like bringing up Herobrine, just delete Minecraft, your worlds, convince them to delete your forum account. Hell, melt down your computer, send it through a shredder, and scatter the flakes in the ocean.
Note: Next time you feel like bringing up Herobrine, just delete Minecraft, your worlds, convince them to delete your forum account. Hell, melt down your computer, send it through a shredder, and scatter the flakes in the ocean.
what? are you saying the links don't work, or are you insulting me by saying i have no life? :/
Quote from Herobrine197 »
Download?
and i half expected you to say "STOP". :biggrin.gif:
i am still testing the cpu for errors, and i also want to write my name all over it so it is thief proof first.
VIDEOS:
SPECIFICATIONS:
32-Bytes of program memory (can hold 16x 2-Byte instructions)
2-Byte instruction words
14-Bytes of RAM (14x 1-Byte registers)
2-Bytes of user input (2x 1-Byte input registers)
8-Bit ALU (add, subtract, and, or, not, xor, left/right shift/rotate, random number)
0.208 Hz (4.8s period/ 24 clock)
4x 7-Segment Displays (with 4x 4-Bit display registers)
Carry Select adder/subtractor (faster than ripple carry, and carry look ahead)
Can load 8-bit values into registers
Can branch conditionally
Can print 2-Bytes to the display in hexadecimal.
instruction word format: AAAABBBBCCCCDDDD
$ - means a memory location in RAM.
# - means a line in the program memory.
op-code (A):
0000 - ADD($B+$C)->$D
0001 - SUBTRACT($B-$C)->$D
0010 - LEFT SHIFT($B )->$D
0011 - LEFT ROTATE($B )->$D
0100 - RIGHT SHIFT($B )->$D
0101 - RIGHT ROTATE($B )->$D
0110 - AND($B,$C)->$D
0111 - OR($B,$C)->$D
1000 - NOT($B,$C)->$D
1001 - XOR($B,$C)->$D
1010 - PRINT($B,$C,D)->screen (D specifies if a screen can be changed or not, 1 = writable, 0 = no change)
1011 - LOAD(BC)->$D
1100 - IF($B,$C)->#D (branches if B == 0, and C == 0)
1101 - RAND()->$D
1110 - DELETE()->$D
1111 - DELETE()->$D
example code:
_MULTIPLICATION_
00: 1011000000000000 load(0)->$0
01: 1011000000001111 load(user input 2)->$15
02: 1011000000001110 load(user input 1)->$14
03: 1011000000010001 load(1)->$1
04: 1011000000000011 load(0)->$3
05: 0111111100000100 or($15,$0)->$4
06: 0111111000000101 or($14,$0)->$5
07: 0110010000010010 and($4,$1)->$2
08: 1100001000101010 if($2,$2)->#10
09: 0000010100110011 add($5,$3)->$3
10: 0100010000000100 right_shift($4)->$4
11: 1100010001001111 if($4,$4)->#15
12: 0010010100000101 left_shift($5)->$5
13: 1100010101011111 if($5,$5)->#15
14: 1100000000000111 if($0,$0)->#7
15: 1010000000111111 print($0,$3)->to all screens
SAVE FILES:
Original Release<- broken by repeater patchMost recent release (1.7.3 compatible) <- get this one
selfdestruct <- when you run it, the computer displays a countdown, then destroys itself. this was just for fun.
*i permit anyone to use the designs i have made, as long as i am given some credit, and they are used for non-commercial purposes. what i want to avoid is people claiming that they made this cpu, when they really didn't.
if anyone finds errors or bugs follow these steps:
1)make sure your code WORKS!
2)send me a pm or post in this thread; the code you tried to use (1's and 0's), what it is meant to do, the input you gave it (if any), the output it gave, and the output you expected.
and when coding, remember that it can only hold 16 lines of code, and can only perform 8-bit operations.
This CPU was made with extensive use of INVedit, MCedit and peaceful difficulty, and wouldn't have been possible without them.
if anyone has any questions, feel free to ask.
Wow. What part of memory is actually displayed on the screen? Or is there only 1 value in Ram?
This is cool. Implement an random auto-counter, take a video of it, please????
Start at 0, then add a random number, every 5 seconds. :smile.gif:
Nice work, and see if you can make it better.
the print operation just loads values into the display registers, which in turn automatically display the values on the screen. if you look at the top down view of the whole cpu you can see that i've made all the registers out of mossy cobblestone, so they are easy to point out. the registers in the display section of the cpu hold the values. the first register displays the 4 most significant bits stored in memory location $B, the second is the least significant of $B, the third is the most significant of $C and the fourth is the least significant of $C.
the RAM can hold up to fourteen 8-bit values, there are also two input registers that can be read like the RAM, but cannot be written to, which makes up a total of 16 different addresses.
the random number generator is just 8 different prime clocks (clocks based on prime numbers) that needs to be switched on manually before running the program (if it was activated automatically, it would produce the same 'random' numbers every time).
here's the random number output from when i was testing it:
48,176,75,237,14,148,51,235,77,245,54,128,107,233,201,41,135,20,246,73,137,56,177,7,228,106,153,57.
I've plotted these on a line, and there seems to be a little bit of clumping, but is so small that it could just be bad luck.
I've been thinking about expanding the ALU to 16-bits, and trying to synchronize it better from the start for a faster clock rate. however these things would require me to start basically from scratch, and would take me another month to finish.
Could you play Minecraft in Minecraft? :ohmy.gif: Fun.
Hey. =D
That looks insane.
For example, when a block is destroyed, the item that is spawned has a random direction and speed. Have a small cactus farm popping out random cacti on random pressure pads or something, and you have a RNG using Java's RNG. :smile.gif:
c'mon. you already know the answer to that question.
the only 'real' program i've got it to run so far is multiplication, where it takes 2x 8-bit numbers from the user, and multiplies them. as long as the result is less than 255 it should give the correct answer. unfortunately it can take up to 3 minutes to get that answer.
this is the code:
_MULTIPLICATION_
00: 1011000000000000 load(0)->$0
01: 1011000000001111 load(user input 2)->$15
02: 1011000000001110 load(user input 1)->$14
03: 1011000000010001 load(1)->$1
04: 1011000000000011 load(0)->$3
05: 0111111100000100 or($15,$0)->$4
06: 0111111000000101 or($14,$0)->$5
07: 0110010000010010 and($4,$1)->$2
08: 1100001000101010 if($2,$2->#10
09: 0000010100110011 add($5,$3)->$3
10: 0100010000000100 right_shift($4)->$4
11: 1100010001001111 if($4,$4)->#15
12: 0010010100000101 left_shift($5)->$5
13: 1100010101011111 if($5,$5)->#15
14: 1100000000000111 if($0,$0)->#7
15: 1010000000111111 print($0,$3)->to all screens
even real computers can't make 'true' random numbers. in my system, the 'random' factor, is a combination of prime clocks, and the time it take a player to walk from the random number switch to the 'ON' switch, i gave an example of the numbers it makes in a previous post.
i thought about using cactus, but they are too slow and big to be worth it. my prime clocks method produces sufficiently random numbers for my cpu, is very fast, and doesn't take up much space.
I know nothing of the magic you used to make the cpu, reccomend books/resources to read up? (keeping in mind im a total beginner)
plus I cracked a big 'ole smile at the .208 Hz for the speed. That is just special.
Vid #1 Zombie Death by Minecart Bludgeoning
Vid #2 Slime Infestation - When Slimes Attack!
Vid #3 Advanced Automatic Wheat Harvesting System
Please check it out for some good stuff.
i only had a basic understanding of logic gates, flipflops, and adders before starting this project. i built it step by step, adding whatever i thought it need. i didn't follow any existing cpu architecture, so it is possible that mine is completely unique.
what i did:
1. decide on instruction word size (mine is 16-bit), and ALU size (mine is 8-bit)
2. build a giant block of memory, and a way to write values to each one. this can be a LOT of levers, or a counter that selects which line you are writing to.
3. build a bus along the outputs of your memory flip flops, and use another counter (i actually used D flip flops feeding into each other) to select only 1 instruction to be sent onto the bus at any one time. the counter activates a heap on AND gates on only 1 of the memory slots, meaning all the other slots are having their output blocked from getting onto the bus.
4. ...keep going until it does stuff. i also recommend testing every part as you implement it.
just simple steps, one at a time. i had no idea how it would turn out in the end, how long it would take, or if i would even succeed.
in other peoples cpu's i hear about lots of specific registers, 'flags', and other things i don't understand. mine really only has general registers that it uses as ram and has no flags, but it can run a program saved to its memory, so i'm happy. :biggrin.gif:
key words to google: bit wise logic, flip flop, sum of products, Arithmetic Logic Unit, bus, combinational logic, sequential logic, mux, encoder, decoder, adder, and, or, not, xor (useful for controlling whether a bus is inverted or not).
hope that helped a little.
i may try to make a gate diagram of my CPU in the future, to show how it works in better detail.
yeah, i built mine in this order: program memory -> RAM -> ALU -> display
doing the ALU before the RAM... well that would just leave your buses a mess! my buses follow straight lines out from the RAM, and the ALU functions just sit perpendicular to them, and attach to the side. neat and easy.
another thing that i've done, but i don't know if it's unique, is that my buses are verticle. this means that they are only 1 block wide, but it does make my cpu very high and i died many times by falling from the top. xD
tell me what you think.
i was thinking maybe a counter connected to a 10 clock, so the CPU would be able to know how many seconds had passed since it was turned on. but i was leaning away from the idea, because the CPU is so slow, that the value would be at least 5 sec old before it could be displayed on the screen.
and please don't suggest anything that would be too complex to build or too slow to compute a result.
This is crazy, amazing and... Amazing!
this video is the first one that shows my CPU running a program.
what? are you saying the links don't work, or are you insulting me by saying i have no life? :/
and i half expected you to say "STOP". :biggrin.gif:
i am still testing the cpu for errors, and i also want to write my name all over it so it is thief proof first.