Forums - Open Redstone Engineers
behemoth diary: sort-of-a-tutorial - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: ORE General (https://forum.openredstone.org/forum-39.html)
+--- Forum: Tutorials (https://forum.openredstone.org/forum-24.html)
+---- Forum: Advanced Tutorials (https://forum.openredstone.org/forum-26.html)
+----- Forum: Devices (https://forum.openredstone.org/forum-27.html)
+----- Thread: behemoth diary: sort-of-a-tutorial (/thread-5922.html)



behemoth diary: sort-of-a-tutorial - fuirippu - 03-06-2015

This is more of a “Projects & Inventions / Completed Projects” post, but I don't think it's worthy of that forum. I'm calling it a “sort of tutorial” because I wrote it hoping to inspire or instruct redstoners like myself who are beginning to explore CPU or computer construction.

TL;DR: fuirippu built a machine; it's big, slow and not very adaptable

with pictures


My first Computer (the behemoth)
First some specs...
  • embarrassingly high ticks per cycle
  • 8-bit processor
  • 8 bytes RAM, 8 bytes data ROM
  • 4 bit program counter (16 bytes PROM)
  • fixed 8-bit instruction set
  • conditional branch


Background
Yeah, I know: it's not gonna win any prizes like that. And wait til you see it: it's huge. Also, it took me probably a month and a half to build (I have a few no good excuses). Despite all this, I'm pleased with the result and I got to have fun learning stuff along the way.

At the start of 2015, I had got back into Minecraft after a long break. I had just started redstoning and built a few devices for survival mode. I had heard that people had built computers with redstone, and I had seen some YouTubes without really studying them. I wanted to build a general computing machine of redstone. I had built sequential logic circuits and knew roughly how these could combine into a computer (it's all NAND or NOR gates, right?).


Project Goals
I would base it on a simple processor I knew a bit about, and give it a simple task...
a Motorola 68000 tribute, capable of executing a recursive subroutine

This goal was too ambitious, so it got downgraded to...
a Zilog Z80 clone, capable of executing a routine to calculate factorials

Later this became...
a computer based on the MOS Technology 6502, capable of executing a multiply routine[/i]


First Steps
Things moved along and I made a 1-bit memory cell using the classic torch-based RS latch from the Minecraft Wiki...

4/1/15 [Image: anopLS2.png]

It was rubbish, I re-designed it...

4/1/15 [Image: qJjdKrp.png]

It was still rubbish, but I didn't know any better. It was at least stackable, 2 blocks high. I stacked bits vertically to make a 4-byte cell wired to an elementary decoder...

9/1/15 [Image: bDclcWw.png]

After another two weeks or so, I had 8x 4-byte cells all wired up to a decoder, and I was starting to group input and output into busses...

22/1/15 [Image: r85sTzI.png]

It was only in the last week that I thought: there is no way people are building these machines without at least some kind of copy and paste. Wiki taught me the commands /clone and /fill: they were awkward to use, and I made plenty of simple geometry mistakes, but compared to what I had been doing before, they were heaven-sent.


Inspiration or Plagiarism
At this time /clone and /fill were rocking my world, but bussing my memory cells was a nightmare. I started watching YouTubes, and followed the playlist “Building a Minecraft Computer Tutorial” by bennyscube. This led to a total re-design of memory cells (use bennyscube's), and to the design of an adder (use bennyscube's).

It had taken me a month to make 4 bytes each of RAM and ROM without de-mux, connected to an 8-bit adder with three registers. Luckily I wasn't in a hurry.

[2/2/15] [Image: 377bWVO.png]

More geometry mistakes with /clone, along with a painful experience rotating the adder by hand, caused me to decide it was worth investigating mods: Forge, WorldEdit, revert to previous version. Boom! Suddenly just with //copy, //rotate and //paste, I had god like power to build my computer. It would be another week before I learnt //stack and //schematics.


Finishing Up
After five weeks the memory had been extended and the end was in sight. I had a ToDo list. There were two big items: program memory/clock, and branching. Bennyscube's tutorial doesn't use a register for a Program Counter, instead each operation embeds a goto statement into its code. This gives his machine branching, but not conditional branching. I wanted a counter with parallel load. Google showed me Hans Lemurson's PC – noisy but functional and extremely compact.

One final problem solved – transient signals on control lines because I hadn't accounted for the need to clock the current instruction into a register before the next instruction was fetched – and my computing machine was finished. It was about the 16th of February. It had taken about 6 weeks, and has rubbish specs, but I'm still a little fond of it.

I haven't tested the clock speed: the components are so slow and the architecture so basic, that I run it at 32ticks – 16 to fetch and decode, 16 to execute (mumble-mumble pipeline). It seems to do OK multiplying 8-bit values in a loop with no overflow handling.

There's a gallery here if you haven't seen it with my ORE application.


For the Next Build
The main lessons I started my next build with are
  • have more program memory
  • a tiny amount of RAM is probably enough (unless you want to execute code from it, or use it as a stack during recursion)
  • speeds might never be truly satisfactory without pipelining


YouTubes...

Building a Minecraft Computer Tutorial
bennyscube

Program Counter (with branching!)
HansLemurson


RE: behemoth diary: sort-of-a-tutorial - Apocryphan - 03-07-2015

(03-06-2015, 06:42 PM)fuirippu Wrote: Project Goals
I would base it on a simple processor I knew a bit about, and give it a simple task...
a Motorola 68000 tribute, capable of executing a recursive subroutine

This goal was too ambitious, so it got downgraded to...
a Zilog Z80 clone, capable of executing a routine to calculate factorials

Later this became...
a computer based on the MOS Technology 6502, capable of executing a multiply routine

Hmmm... sounds all too familiar. I too "put the cart before the horse" sometimes and aim a bit too high for a first step. I'll definitely be watching the videos you recommended later.


RE: behemoth diary: sort-of-a-tutorial - LordDecapo - 03-11-2015

(03-07-2015, 05:47 AM)Apocryphan Wrote:
(03-06-2015, 06:42 PM)fuirippu Wrote: Project Goals
I would base it on a simple processor I knew a bit about, and give it a simple task...
a Motorola 68000 tribute, capable of executing a recursive subroutine

This goal was too ambitious, so it got downgraded to...
a Zilog Z80 clone, capable of executing a routine to calculate factorials

Later this became...
a computer based on the MOS Technology 6502, capable of executing a multiply routine

Hmmm... sounds all too familiar. I too "put the cart before the horse" sometimes and aim a bit too high for a first step. I'll definitely be watching the videos you recommended later.


That's not a bad thing at all Big Grin I started that way and slowly my I became able to accurately give estimatea of speeds and functions of new IizR version... of course using The same architecture and just refining it over time, helps a lot.. I still use my original IS, I just change it as wanted/needed)

Love your ideas and design style a lot so far fuir Big Grin can't wait to see what you accomplish. .. the CPY design theory clicked with u quick.. took me like 6 months to realize how to actually control anything at all xD


RE: behemoth diary: sort-of-a-tutorial - greatgamer34 - 03-11-2015

I think thats how we all started. My first CPU was a simple 8 bit CLE with like 8 registers. xD