
Inside the ALU of the 8085 microprocessor - mariuz
http://www.arcfn.com/2013/01/inside-alu-of-8085-microprocessor.html
======
jevinskie
When I crafted my MIPS subset dual core CPU in a senior design class, I chose
the 6502 method. That is, perform ADD, OR, XOR, etc in parallel at word width
(that is 32 bits x the number of operations) and select the correct output
using a multiplexer. The 8085 method seems smaller but I wonder how much delay
it adds to the circuit.

[edit]

Here is my MIPS-- ALU in VHDL:
[https://github.com/jevinskie/mips--/blob/master/project4/sou...](https://github.com/jevinskie/mips--/blob/master/project4/source/alu_r.vhd)

Quite simple, really. The hard part is the control lines and the cache!

------
jonsen
It can also be enlightening to study 1-bit architectures. The lower limit of
processor complexity. This wiki-page
<http://en.wikipedia.org/wiki/Motorola_MC14500B> has links to the data sheet
and a high quality applications handbook.

~~~
kens
Wow, that MC14500B (from 1977) is interesting. It really is a 1-bit
microprocessor, with 1 input bit, one register bit, and 1 output bit. It's not
a bit-slice processor, intended as a building block for a larger processor,
but is designed for really simple industrial logic, such as "turn on pump if
inputs A, B, and C are closed". It normally works with input and output latch
chips, so you can use more that one input and output, and they get processed
one bit at a time. Strangely, the program counter is on a separate chip
(MC14516B), which is just a 4-bit binary counter. The application handbook
explains how to do addition with the chip - by the time you deal with carries,
single-bit addition takes 12 instructions! It's amazing that people actually
could do useful things with a one-bit processor.

~~~
jonsen
It is Turing complete. In principle it can do anything.

 _the program counter is on a separate chip_ so you can make it as big as your
program demands.

------
moccajoghurt
I decided to write a gnu as x86 interpreter, now 700 lines later, I realize
that I know nothing about assembly / CPUs and should have never started. I
keep going until "hello world!" works but it's really depressing to realize
that you underestimated the complexity of something. This picture reminds me
about the complexity.

~~~
revelation
Thats because x86 is an insanely complex architecture. Try one of the pseudo
RISCs, e.g. ARM.

~~~
StephenFalken
Check the _MIPS R4000 Microprocessor User's Manual_ by _Joe Heinrich_ to get a
glimpse of a truly inspiring processor architecture and its implementation:
[http://groups.csail.mit.edu/cag/raw/documents/R4400_Uman_boo...](http://groups.csail.mit.edu/cag/raw/documents/R4400_Uman_book_Ed2.pdf)

------
hurtmyknee
Building a CPU in a circuit simulation framework[1] was one of my favorite,
and most illuminating, projects I've done.

A great book to learn more: [http://www.amazon.com/Computer-Systems-
Programmers-Perspecti...](http://www.amazon.com/Computer-Systems-Programmers-
Perspective-Edition/dp/0136108040/)

[1] [http://tams-www.informatik.uni-
hamburg.de/applets/hades/webd...](http://tams-www.informatik.uni-
hamburg.de/applets/hades/webdemos/index.html)

~~~
jevinskie
Did you ever run the HDL on an FPGA? That is half the fun/battle/frustration!
=)

------
interconnector
Here's another ALU example in Verilog that I've found useful:
[http://lgjohn.ecen.ceat.okstate.edu/4243/lectures/aludesver....](http://lgjohn.ecen.ceat.okstate.edu/4243/lectures/aludesver.pdf)

