I wanted to revive my project to build a computer in minecraft. I decided that i should redo the CPU. Unlike last time, i kinda want to use an instruction set that already exists, and maybe has a C compiler. I would like to use an instruction set that has an instruction for basically every possible action, as less instructions to accomplish something = more speed. (eg i dont want to wast time to move registers about like you have to on the z80).

Or maybe i should just do ez80 or something?

I will use this topic to post progress

Ps: Although with command blocks doing maths on 32 bit numbers is a piece of cake, there is no easy way to get 2 individual bits from a number, so something like add a,b and add b,c would have to be built as too completely different circuits.
I don't know why, but the idea of doing just this was floating around in my head today keeping me from studying. I've built some basic components in the past, but never actually finished a whole cpu.

c4ooo wrote:
there is no easy way to get 2 individual bits from a number

Yes there is, just divide by a power of 2 to remove the rightmost bits and modulo by a power of 2 to remove the leftmost bits.

If you want, we can work together on this after the exams
lennartVH01 wrote:
I don't know why, but the idea of doing just this was floating around in my head today keeping me from studying. I've built some basic components in the past, but never actually finished a whole cpu.

c4ooo wrote:
there is no easy way to get 2 individual bits from a number

Yes there is, just divide by a power of 2 to remove the rightmost bits and modulo by a power of 2 to remove the leftmost bits.

If you want, we can work together on this after the exams

Well, doing division and then modulation would work, but its 2 command blocks, and that's two ticks
Anyways, i have already built a semi-working command block computer, i just want to rebuild it with better instruction set, and also a better GPU. (The last one had a 64*64, 15 colour gpu, but it was kinda useless >_> )
c4ooo wrote:
Well, doing division and then modulation would work, but its 2 command blocks, and that's two ticks

I don't see why they can't be ran in the same tick, if you just put them in the same chain.

Code:
```scoreboard players operation A value /= 64 const scoreboard players opperation A value %= 128 const```

Unless..., Are you using purely commandblocks or are there some comparators and other redstone mixed in as well?
lennartVH01 wrote:
c4ooo wrote:
Well, doing division and then modulation would work, but its 2 command blocks, and that's two ticks

I don't see why they can't be ran in the same tick, if you just put them in the same chain.

Code:
```scoreboard players operation A value /= 64 const scoreboard players opperation A value %= 128 const```

Unless..., Are you using purely commandblocks or are there some comparators and other redstone mixed in as well?

What do you mean same chain? How will you know if they are executed in the correct order?

Anyways, comparators / redstone are kinda needed The cpu clock (featuring "computer on/off (reset)", "cpu clock on/off", and "manual tick") is done with traditional redstone logic gates.

I started envisioning an instruction set:
load n = load a number, n into accumulator
read n / register = reads from memory address pointed by n / the register, into the accumulator
write n / register = writes the accumulator to the pointed memory address
mov <register> = moves acc into <register> / vice versa
swap <register> = swaps acc and <register>
<math opp> n / [n] - performs a math function with the accumulator and number n, or number stored in memory pointed to by n.

One thing to note, is if when an instruction does not imminently know what register to use (eg the register is provided as an parameter to the instruction and not encoded into it) then reading / writing it will be same speed as reading / writing from memory.
I\O is memory mapped. GPU I/O is also memory mapped, but actual graph commands are separate CPU instructions.

Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
» All times are GMT - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum