Here's another, like the circuit I built:
https://wiki.analog.com/university/courses/electronics/electronics-lab-24
Under D type FF, it uses one more transistor to give D and D/, and then only 2 transistors for the FF, but a few additional diodes, resistors and caps, but those can be REALLY small today. Modern fast transistors can make this FF run pretty fast.
Jon
Hi Jon,
I don't like this style too much:
- 17 components! I plan to use SOT-723 transistors and 0201 resistors (based on JLCPCB availability) and even 0201 is relatively large compared to SOT-723.
- Where are the component values coming from? Why 100 pF and not 50 or 200? There is a lot of dependency on transistor parameters and drive waveform here. OK for a breadboard build. But I am looking for ordering a board with a few 1000 (probably poorly specified, depending on JLCPCB availability) generic transistors and obviously hand tuning the components is out of the question
- Does this allow for synchronous logic (like in an FPGA)? Means input hold time must be smaller than clock-output delay (+clock delay)? Or - would a shift register built of those work?
Thinking of it, the best way to get rid of tco/th/clock delay issues is to use a two phase clock. I wonder if the missing transmission gate could be replaced by a back-to-back MOSFET pair? Gate drive would best be a bit above logic level, which could easily be implemented for a global clock network. Like 3.3 V logic, 5 V clock drive. See schematic.
So with some additional functions (reset, output enable) this would make around 14 transistors per bit. Together with clock drivers, LED drivers etc. a 16 bit register would amount to 250 transistors. This would make a nice module that could be plugged into a mainboard and tested/produced on its own.
BTW I was thinking of the simplest possible CPU that would make any sense. See data flow diagram. This makes a total of four registers, plus one extra for load-modify-write commands (INC $22 or so). There would be three command types:
- JMP cond.
- LDA/STA
- ALU op (add, sub, not, and, or, inc, dec, shift, cmp, test)
Adressing style for all three commands:
- immediate #33
- absolute $33
- indirect ($33)
What would be missing is JSR/RET, indexed adressing, relative jumps, stack... I guess for emulating subroutine calls some way of acessing the PC would be necessary.
Development environment: How do I test this - logic analyzer, clock generation...? As I'd install Quartus anyway (I'm an Altera guy) for ModelSim, I'd probably use some Cyclone dev board
https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=167&No=921 with an interconnecting board (and optional level shifters) for emulating the memory, SignalTap as logic analyzer... which is kind of weird as such a primitive CPU would be implemented with a few lines of VHDL in the FPGA.
16 bit: Looking through the 6502, a lot of complexity is coming from having 8 bit of data, but adressing 16 bit. Like page overflow in $33,Y indexed adressing. I am tempted to make the whole thing 16 bit: 256 bytes of address space is not enough for even a simple CPU like this so to be of any use. I'd have to expand to 12...16 bits. Going to 16 bit removes the associated complexity altogether as all registers, arithmetic, PC and address bus can be 16 bit. I remember darkly that I implemented my FPGA CPU this way (>20 years ago). Of course this doubles the transistor count in the data path, but with a modular approach for the registers, this might still be feasible.
Martin