
A working, transistor-scale replica of the MOS 6502 microprocessor - cmod
http://monster6502.com/
======
cubano
Great job guys, and this project really brings back some cobbed-web memories.

One of the first software projects I ever developed was a real microcode/bus
simulation of the 6502 for a required CP class I took what seems life
lifetimes ago. I remember the prof telling the class that if anyone was
interested in a project where they didn't have to come to class and still get
an A, talk to him after class.

Sure I'll go for that I thought...who wants to sit in a boring class when you
can create.

So I built the opcode simulator, which took the individual bits on the various
internal busses and propagated them through the "chip", on a pretty kickass
Atari ST that I owned, which at the time (1985 or so) represented cutting edge
PC technology. What I remember most about it was finding a bug in the damn
Turbo-C (or whatever I can't remember exactly) compiler I was using that, in
some cases, always gave the output of "50" during an bin-to-hex conversion or
something.

I did everything I could to try to fix this bug, but no matter what it kept
popping up, fouling up the results of my otherwise slick simulation. I was
terrified to show the prof, but he was relatively impressed with my use of a
PC instead of the school's timeshared VAX and totally disregarded the bug
after reviewing my code.

And yes...I got my A. I sure wish I still had that program.

~~~
pstuart
Mark Williams C -
[https://en.wikipedia.org/wiki/Mark_Williams_Company](https://en.wikipedia.org/wiki/Mark_Williams_Company)

In reading the linked article the founder is Aaron Swartz's dad.

------
madengr
It's cool just for the blinking lights alone. Computers are so boring these
days, at least from my growing up with 60-70s SciFi.

It'd be cool to build a blinken lights bus expander for the C64, or other
8-bit computers of that era. Complete with switches for data and register
access, like a PDP or Altair.

~~~
danellis
You wouldn't see much, though, would you? It's nice to look at here because of
the very slow clock speed. At 2MHz, I expect it would just be like looking at
dimly lit LEDs.

~~~
rbanffy
> At 2MHz, I expect it would just be like looking at dimly lit LEDs.

Maybe. Or maybe other patterns would emerge - some LEDs would be dimmer, some
brighter, then the pattern would change, as the program progresses. Let's try
it.

------
CamperBob2
It's a shame they didn't mimic CMOS construction instead of NMOS. A 65C02 made
from discrete parts could have run at full speed, wouldn't have required dual-
gate MOSFETs or other weird parts, and could have plugged right in to the
original 6502 microcomputers.

As a bonus, it could have operated statically -- not clear if this one can or
not, but I'd guess not, if they were truly faithful to the original 6502
schematic.

Still a cool hack, though!

~~~
userbinator
AFAIK no one has reverse-engineered the 65C02 publicly, so that would have to
be done first; it'd also require approximately twice the number of transistors
and area, so the speed won't be much better.

~~~
CamperBob2
The speed will certainly be better, due to the way NMOS works.

NMOS is pretty terrible.

------
amelius
> No. The MOnSter 6502 is relatively slow compared to the original, thanks to
> the much larger capacitance of the design. The maximum reliable clock rate
> is around 60 kHz. The primary limit to the clock speed is the gate
> capacitance of the MOSFETs that we are using, which is much larger than the
> capacitance of the MOSFETs on an original 6502 die.

60 kHz? Surely these MOSFETs can do better than that! And even simple modern
PCBs can run at much higher speeds.

Anyway, at this speed, I can probably run it in a full SPICE simulation on my
PC and still outperform it :)

~~~
Filligree
> 60 kHz? Surely these MOSFETs can do better than that! And even simple modern
> PCBs can run at much higher speeds.

Any single MOSFET can. The slow clock is due to propagation time across
multiple MOSFETs.

~~~
mrob
NMOS logic is made from a passive pull-up resistor on top of an active pull-
down network. An NMOS gate can switch from high to low very quickly, because
the pull-down network connects the output to ground via only its very small
on-resistance. The input capacitance of the subsequent gate discharges through
that small resistance quickly. But NMOS switches from low to high much slower,
because that gate capacitance has to charge through the higher resistance of
the pull-up resistor. The pull-up resistance has to be relatively high,
because otherwise the voltage would be divided roughly evenly when the pull-
down network is turned on, which means the output voltage would be in the
undefined region between low and high and the gate wouldn't work. There's also
a trade-off between pull-up resistance and power consumption, with a stronger
(lower resistance) pull-up using more power.

With CMOS, both the pull-up and pull-down parts are active, so one can be
switched on while the other is off. There's always a low resistance path to
Vdd or ground, and the subsequent gate capacitance can both charge and
discharge quickly. The drawback is that it's harder to manufacture a chip with
both N-channel and P-channel transistors.

~~~
psykotic
The 6502 chip design used precharging for exactly that reason. You precharge
to Vdd in phase 1 through a path with high drive strength and then in phase 2
only the fast pull-down network has to do any work if needed. The pull-up
network is still there to prevent floating and hence needs to be ratioed
against the pull-down on-resistance to pass a strong 0, but the pull-up
resistance no longer sets the low-to-high switching time. The main limitation
is that it can only handle monotonic logic, so you may need to interpose
static inverting logic stages between your precharge logic stages.

And in standard chips nowadays, you can still find transmission gate logic
(complementary pass transistors so you can pass both strong 1s and strong 0s),
pseudo-NMOS logic (using a boring old enhancement mode PMOS transistor tied
off to ground as a pull-up resistor) and domino logic (precharge logic with
interleaved CMOS stages) in critical datapath circuits, so even in a bog
standard CMOS process there's room for trickery.

> The drawback is that it's harder to manufacture a chip with both N-channel
> and P-channel transistors.

Yeah, and CMOS wasn't competitive for higher speed chips until the 80s (the
68000 was NMOS based until 1985 and some higher end processors eschewed MOS
and used bipolar ECL). CMOS had been around for a good while at that point but
was mainly used for applications like battery-powered watches and calculators
where static power draw was more important than speed. The 65C02 (a CMOS
version of the 6502 with a few other features thrown in) came out in 78 and
was competitive in speed to the original 6502, though it was originally
designed for a customer for use in calculators, but of course ended up being
used in numerous home computers.

------
InclinedPlane
One of the neat things about this is that it shows just how much of a
technological leap integrated circuits and micro-processors were. Back in the
1950s all processors were built with individual transistors, even in the 1960s
they were primarily built in the same way, with any use of integrated circuits
only ganging together a small handful of transistors onto a single chip.
Except today we have tremendous advantages in being able to build multi-
layered printed circuit boards using layouts created on computers while
placing the components automatically using pick and place machinery. The
MOnSter 6502 would be a marvel of miniaturization for the 1960s and yet it
relies on 21st century technology to attain a size of only 7000x the original
1975 part. And as they point out, more modern chips that were built only a few
years later like the 68k (built in 1979) would translate to enormous board
dimensions (19 square feet). So much of our world is built on the technology
of microprocessors, it's easy to take it for granted.

------
monocasa
It's really neat that you can visibly see the bits of the PLA sequencer ROM
across the top thirdish just like you can in 6502 die shots.

------
Quequau
I know it would be a major undertaking but I can't help but think that
building a similarly dis-integrated but complete computer would be a really
interesting project.

~~~
timthorn
You mean the Megaprocessor?
[http://www.megaprocessor.com/index.html](http://www.megaprocessor.com/index.html)

~~~
Quequau
Well sort of but scale is different, yeah?

~~~
6nf
What do you mean by that?

~~~
krallja
The MOnSter 6502 is using surface-mount parts, which are quite a bit smaller
than the individual gate boards used in the Megaprocessor.

> How big would the MOnSter 6502 be if it were made with through-hole parts
> instead of surface mount parts?

> About 19 square feet (1.7 square meters).

------
intrasight
Got a laugh out of this:

How big would a 68000 microprocessor be at the scale of the MOnSter 6502?

Also about 19 square feet (1.7 square meters).

Are you going to make a 68000 next?

No.

~~~
chx
One wonders whether he is making a Dark Tower joke there.

------
mschuster91
I wonder why this is so expensive to build - is the board too huge for common
pick-and-place machines or solder ovens?

~~~
joshvm
I estimate it would cost around $300-500 to get assembled depending on volume.
That's just the assembly price. This is based on some online quotes with 15k
pads (I checked 25-100 boards).

Then you have actual BOM cost which is maybe another $150-200. A 2N7002 is
about $0.02 even at 100k volume. Resistors and small passives are often free,
and the remaining bits are cheap.

The board is probably $100 each in small volume. Big four layer beast, not
cheap.

I used www.7pcb.co.uk and Mouser/Farnell for prices.

So we're looking at a cost of up to $700-800 plus taxes and shipping. That's
without any kind of profit for the designer, distributor cuts and so on. At
$1k they're breaking even, $2-3k would be standard markup to cover overheads
etc.

~~~
mschuster91
Ah, okay. I thought it 'd be more like a typical PC motherboard with the
hundreds of tiny components and iirc a dozen layers.

So basically, when I understand you correctly, a PC motherboard is only as
cheap as it is due to scale advantages and lots of the parts on a motherboard
being resistors etc.?

~~~
joshvm
Motherboards are cheap almost solely because of scale - they're sold by the
tens of thousands, if not hundreds of thousands. They're also sold at a much
lower margin (I would imagine). They also benefit from having an in-house
production chain, e.g if you're Foxconn you have an entire city working just
for you. As a hobbyist you need to pay someone else to make things for you
(and pay their salaries +overheads too).

My comment about resistors was that most assembly houses will give you certain
components for free because they're an insignificant fraction of the price.
Also because almost _every_ digital PCB will use e.g 0.1uF capacitors, they
can buy enormous quantities. If you look at the link below you see that most
of the cost is in the few specialised parts like the North/southbridge, sound
card and connectors.

Here's a teardown and BOM analysis for a motherboard:
[http://electronics360.globalspec.com/article/3280/asus-p5kpl...](http://electronics360.globalspec.com/article/3280/asus-p5kpl-
cm-desktop-motherboard-teardown) . Note the BOM cost is essentially the sale
price.

This is partly why Apple's stuff costs so much, because they actually price
their devices reasonably (from a business sense). Everyone else works on razor
thin margins to give you the illusion that hardware is cheap.

------
shiblukhan333
You can see this in person at the Bay Area Maker Faire today. Now someone hook
this up to a BEEB and run those decryption cycles at the beginning of Elite.
Web: [http://itvstream.info/](http://itvstream.info/)

------
jacquesm
Finally. Now someone hook this up to a BEEB and run those decryption cycles at
the beginning of Elite.

------
JKCalhoun
Saw this beauty at the Vintage Computer Festival last Fall in Silicon Valley.
These guys are awesome:

[http://www.evilmadscientist.com](http://www.evilmadscientist.com)

------
grandalf
You can see this in person at the Bay Area Maker Faire today.

------
obstinate
How big would the equivalent Kaby Lake device be?

~~~
Klinky
In the FAQ they compared to an Apple A8X and noted it would be 885,000 square
feet if built in similar fashion.

~~~
obstinate
That's incredible. For anyone who doesn't think in terms of square feet,
that's a square with a 270 meter edge.

~~~
jacquesm
No, that's perfectly credible. What _is_ incredible is that the real thing
actually exists!

------
faragon
Ok, it doesn't work int the Apple ][ because of timming, but could it work
connected to an Atari 2600?

~~~
sehugg
Even worse; the 2600 CPU must run at exactly 1/3 the pixel clock.

------
mempko
Wow, that's just gorgeous

~~~
hyperdunc
It is. I'm very impressed by the attention to detail and neatness in the
visual presentation of this project.

