[geeks] Crackpot project, need some guidance

Mark Benson md.benson at gmail.com
Thu Aug 11 16:56:45 CDT 2011


On 11 Aug 2011, at 21:15, Mouse wrote:

>> I just thought I'd let you guys know how my ongoing project was
>> progressing.
>
> Thank you.  I, for one, am interested.
>
>> My task after I've proven my ALU
>
> One of the things I did in university was to build a small 4-bit CPU
> from discrete logic;

Do you still have any notes from that exercise? I have a working 16-bit ALU
but I am struggling to see the 'bigger picture' as far as integrating the
instruction set with the ALU and registers and memories. I'll probably read
something and have another 'aha' moment at some stage, but at the moment I am
confused... Going from a machine code instruction to a practical operation is
something I'm still wrapping my head around. I understand that  there is some
sort of clocked input and I know how to decode instructions using a microcode,
a ROM-based lookup table, but how to practically implement that is beating me
currently.

> the most complex package we used was a 4-bit ALU
> chip (4 bits input A, 4 bits input B, 1 bit in for things like carry
> in, 4 bits output plus a fifth bit for things like carry out, and
> three? four? bits that specified what operation to perform).  It was
> great fun.

It is once you work out the mechanics of it.

> If you want to do a 16-bit CPU in discrete logic you may find it
> easiest to do it serially, one bit at a time.  It will divide your
> effective clock rate by 16, but for what you're doing that may not be a
> problem, and it will greatly reduce the amount of hardware needed at
> many points.

That's pretty much what I did. I built a 1-bit ALU, then used 16 linked
carry-out to carry-in in a serial line. The effect is a parallel system that
adds up all the bits at once but passes the carry down the line to the end. Of
course working a in a simulator it still all happens instantly. That wouldn't
be the case in a real TTL logic construction, I know.

>> This has been the single most enlightening project I've done in a
>> very long time.
>
> I agree: playing with hardware is tremedously fun and incredibly
> educational.  I like to understand everything I work with at as many
> levels as I can; it's (almost) always fun and occasionally even useful!

Logisim is a great tool, the way it allows you to build on a multi-part,
multi-level system, import previous projects seamlessly to use your previous
work. It makes it all very accessible to just sit down and play with. Saves
burning your fingers too :P

--
Mark Benson

My Blog:
<http://markbenson.org/blog>
Follow me on Twitter:
http://twitter.com/mdbenson

"Never send a human to do a machine's job..."


More information about the geeks mailing list