Hacker News new | past | comments | ask | show | jobs | submit login
My4TH – A minimalistic FORTH computer with discrete CPU (mynor.org)
221 points by incanus77 on March 28, 2023 | hide | past | favorite | 31 comments



My digital design class in the mid 1970s used the older RTL (resistor-transistor logic) gates. They had only 2 NOR gates per (TO-5) package; you can still buy these on Ebay for around $6.

At the time I wished that I could be using the much newer 7400 family of logic chips; the 7400 series by then had a full complement of chips available, everything from logic inverters to 4 bit arithmetic-logic chips (74181). The 7400 family is TTL and much better: higher density (4 NAND gates per chip for the 7400), easier to work with packaging (DIPS), higher speed, much greater variety of chips, and most importantly to me a higher fanout (each output signal can drive inputs on more downstream chips making designs simpler).

The 74HC family used in the featured article came along around 20 years later. Many families of 7400 have been introduced over the years[1]. The 74HC family was one of my favorites for personal projects. They where logically compatible--the 1960s 7400 and the 1980s 74HC00 chips are both four 2-input NAND gates having the same pinouts in the same packages (14 pin DIPs). The reason I liked 74HCs was the fact that they used CMOS transistors and hence required very little power and could run on a wide range of voltages allowing simple battery powered circuits. I still have a supply of these from the 1990s that I bought for home projects.

By now, half a century later, there are even more varieties. Some are suitable for hostile environments (like automotive applications--high temperature, wide voltage swings, electrical noise, and vibrations). Some will run on voltages under one volt and all run much faster. See [1] from Texas Instruments.

[1] https://www.ti.com/lit/sg/sdyu001ab/sdyu001ab.pdf?ts=1680318...


just don't leave the cmos inputs floating

plausibly today a cpld or lattice fpga is a better alternative for most of what you could use 74xx chips for?


I think you are right, at least from what I've read; I have to admit to no actual experience with actual, modern hardware construction.

Maybe some day I'll try tinkering with a hardware project again. I was in college when 555 timers, 741 op amps, and 7400 logic gates were the basic building blocks for simple projects. Electronics, even at the hobby level, is quite different now.

I never really lost interest in hardware after my EE college work, I just got more and more interested in software and did all of my graduate and professional work on the CS side.


I used all of those components in my undergrad less than 5 years ago. I can’t remember what we used a 555 timer for, but we built calculators, EKGs, and AM radios among other things in the labs. At the time I was mad that we were using TTL logic when it seemed so out of date, but when we moved on to FPGAs I was grateful for the physical intuition I gained from building the 74xx projects.


for undergrad labs ttl has a big advantage over cmos, it doesn't die when you touch it after walking across the floor


This is the real deal!

If I ever saw an autarkic computer, this is it.

It can be scaled both up and down. It could be implemented with discrete components in a small room with air conditioning, or it could be made into an FPGA or ASIC.


how big is the eprom, that might be too big for discrete components in a small room


The EPROM is 32 kilobytes.

Core rope memory could be "72 kilobytes per cubic foot" according to Wikipedia:

https://en.wikipedia.org/wiki/Core_rope_memory


256kb

Does discrete components literally mean packaged single transitors, or can it mean packaged general purpose electronic components?


I meant in a "starting civilization over again" sense, so anything which is easiest given what you have at hand. Core memory seems easier to massproduce without foundries compared to transistors.

But if you have worked your way up to transistors already, the step is probably not very far to start doing chips with many transistors on them, given you already knew this was feasible.


Functional core would be interesting without driver transistors.


people have built entire computers out of square-loop ferrite (the kind used in core memory) and diodes; ferrite/diode systems were especially popular in the ussr in the late 60s because their transistor fabrication technology was lagging

magamps are still a thing today in some atx power supplies

as i understand it the main problem is that you can't get them to run any faster than a few megahertz


i think they meant packaged single transistors or vacuum tubes from the 'small room with air conditioning' phrase

the board is already made of 'packaged general purpose electronic components', is quite a bit smaller than a room, and doesn't need air conditioning


So how many logic gates / transistors does it use in total? I tried to find this number in the article, but couldn't quite find it.


I didn't do the math, but not many. Here's the 74XX ICs from the BOM list with short descriptions of what they are:

  74HC74  Dual D Flip-Flop
  74HC161 4-bit binary counter
  74HC541 Octal Buffer 
  74HC574 Octal 3−State Noninverting D Flip−Flop
  74HC14  Hex Schmitt−Trigger Inverter
  74HC08  Quad 2-input AND gate
  74HC02  Quad 2-input NAND gate
  74HC273 Octal D-type flip-flop with reset
  74HC138 3-to-8 line decoder/demultiplexer
  74HC139 Dual 2-to-4 line decoder
Though it's not straightforward to map microcode lookup through an EPROM into "gates".


Ignoring the memory, probably a similar number to the MyNOR[1] computer it's based off of, which has an all transistor implementation, the TraNOR[2], which has 2495 transistors.

[1] http://mynor.org/mynor.htm

[2] http://mynor.org/tranor.htm


Oh... Suddenly then it impresses me less because it sounds like quite a lot for something that calls itself "minimalistic". The 6052 processor has 3510 transistors, 2495 isn't that much lower.


"The complexity of my design is somewhere between the Intel i4004 CPU (2250 transistors) and the 6502 (3218 transistors). The i8080 already has 4500 transistors and the Zilog Z80 even has 8500 transistors, so you get an idea how small my design still is."


In terms of transistors I think MCPU by Tim Boscke can be hard to beat - https://github.com/cpldcpu/MCPU , however how many transistors this 8 bit CPU has is not clear.


29% less transistors for similar capabilities would be good. How does the instruction set compare to 6502?


i always like articles about forth. i have written a couple of forths in my time, one on a z80 cp/m machine (though the forth implementation booted itself) for dealing with lab equipment (a coulter counter, hp plotter, up/dowload to our vax and stuff) and one for an adventure-writing language i did when i was learning c++. as this was long before git, sadly no code exists for them :-( but it was a lot of fun!


I do wonder how low the price and power consumption could be if this whole thing was put onto one chip.


As retro as you can get, great; amazing that 74 series chips are still available.


they are still heavily used and have many new process and voltage types. even with specialized purpose ICs for everything under the sun, always see a few on anything i open :) often, "glue" or shifting or a buffer here or there


How about this on an FPGA?


But where is the fun then? You can easily build rather fancy CPUs on an FPGA, fancy enough to boot a small Linux system in the end.


I already had that fun back in the 80s. Wirewrapped a lot of my own projects. Now I prefer to just use an FPGA.


Good for you? Not all of us were alive then and its still a worthwhile learning activity to do at least once and its okay to be excited about it and share. After all, someone had done it long before the 80s as well.


okay then what's the advantage of my4th over something like picorv32 for you


Tiny tapeout - 2 weeks until the next one closes, plenty of time





Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: