Decade Counter using Transistors experiment - Page 1
Forum section: electronics / beginners

author: higginsdj
author_rank: Contributor
timestamp: February 23, 2023, 03:57:26 am
content: I am a beginner. I understand some rudimentary basics about transistors and logic circuits so thought I would try to put together a decade counter using discreet components (4026B). My logic is to use the logic diagram in the 4026B datasheet as a guide. It starts with 5 D type flip flops so my first experiment was to build one (D Type Flip Flop) and it proved somewhat challenging. I have a working circuit (it hasn't blown up and the output seems to do what it is supposed to do) but I would love someone to cast their eyes over it and point out any flaws/issues. I tried various circuits I found online but many simply did not work as they relied of 'insufficient' voltage to light up and LED to work as a 'Low' indication. Anyway, here is the circuit and associate pictures. Oscilloscope output shows (from top down), Clk, D, Q Not and Q using 4kHz Clk and 1.6kHz Data square waves.Clock speed limit seems to be around 50kHz for this circuit.Edit - that 330R resistor between AND Gate and Flip Flop should read 4.7kEdit 2 - New schematic attached with the actual circuit.

author: Whales
author_rank: Super Contributor
timestamp: February 23, 2023, 05:28:48 am
content: Q and Qnot seem to be wired directly to 5V?

author: pqass
author_rank: Super Contributor
timestamp: February 23, 2023, 06:12:31 am
content: The breadboard shot doesn't match the schematic which doesn't make sense.How can the outputs of the FF be directly attached to +5V rails? They'll never move! The breadboard shows pullups (of unreadable resistance) to +5V with emitters grounded (not through 4.7K). And the base resistors look to be 220K; not 10K (minor quibble).Have a look at this transistor clock design for ideas on FFs, counters, and 7-segment decoders.https://www.nutsvolts.com/magazine/article/transistor_clockAlso, checkout these for RTL and DTL logic.https://en.wikipedia.org/wiki/Resistor%E2%80%93transistor_logichttps://en.wikipedia.org/wiki/Diode%E2%80%93transistor_logicDid you know you can build entire computers out of just one gate type; either NOR or NAND?See how to convert either of these into every other gate type you may need:https://www.allaboutcircuits.com/textbook/digital/chpt-3/gate-universality/Did you know the Apollo Guidance Computer (AGC) only used one gate type - the 3-input NOR - athough thousands of them:http://klabs.org/history/ech/agc_schematics/

author: pcprogrammer
author_rank: Super Contributor
timestamp: February 23, 2023, 07:29:30 am
content: I applaud your curiosity to learn the wonderful world of electronics from the ground up.QuoteI just looked at what google outputs when searching for "transistor based flip flop circuits" and what is shown under images look very similar to your circuit on the breadboard, but drawn in a more old fashioned better readable style than your schematic, which as Whales and pqass pointed out has some errors.To learn more about this I suggest to search the net a bit more. Sites likethis oneprovide some basic principles. A possible search term "digital logic with transistors the beginning" can be used to find more info. A bit of a problem with the internet though is the reliability of the information and ones capability of judging it. Maybe you can score some educational books about this near you.Thisalso explains the working, although in the first setup a resistor in the set/reset line is needed when connected to supply voltage. The video does show this.Other circuits found using capacitors are oscillators, which basically is the same principle but will go on and off on it's own.Have fun learning.

author: higginsdj
author_rank: Contributor
timestamp: February 23, 2023, 07:38:22 am
content: Quote from: Whales on February 23, 2023, 05:28:48 amYep -wrong circuit. I think this was one I looked up and first used rather than the one I eventually had - original schematic replaced with the correct version.

author: higginsdj
author_rank: Contributor
timestamp: February 23, 2023, 07:39:51 am
content: Quote from: pcprogrammer on February 23, 2023, 07:29:30 amYep, carelessness on my part - the schematic has been replaced with the version I actually used.Many thanks for the links.

author: higginsdj
author_rank: Contributor
timestamp: February 23, 2023, 07:51:20 am
content: Quote from: pcprogrammer on February 23, 2023, 07:29:30 amYep, I tried lots of different versions and found various shortcomings or they simply did not work as expected (or not at all). The emitter follower examples I tried bleed voltage when 'off' (albeit low but enough to turn on down stream circuits). Good enough for demonstration with mechanical switches and LEDs but not with downstream transistor circuits. BUT - I have a lot to learn.

author: pqass
author_rank: Super Contributor
timestamp: February 27, 2023, 12:09:30 am
content: Quote from: higginsdj on February 26, 2023, 06:36:47 amif Qout=L then Q2 is on and Q1 is off, Data_in=H yields Qout=H after clk toggle because 10K thru Q3 turns on Q1 and Q2 turns off.An NPN with E and C swapped is still a [poor/non standard] NPN transistor.See answer 1:https://electronics.stackexchange.com/questions/227319/why-does-the-transistor-work-with-collector-and-emitter-swappedif Qout=L then Q2 is on and Q1 is off, Data_in=L yields no change after clk toggle because Q1 is already off.if Qout=H then Q2 is off and Q1 is on, Data_in=H yields no change after clk toggle because Q1 is already on.if Qout=H then Q2 is off and Q1 is on, Data_in=L yields Qout=L after clk toggle because 10K thru Q3 turns off Q1 and Q2 turns on.QuoteThe 20pF cap needs to discharge when clk=L so when clk=H, it appears like a short to turn on the bases.Highlight to reveal answer:Without the 1M, the cap still has a charge of Vcc-0.7V (due to the lower NPN B-E diode drop) so when clk=L will turn off the bases (because it now appears as a -(Vcc-0.7V) on the bases) but that still won't discharge the cap (because B-E diode is reverse biased). On the next clk=H, it can't turn on the NPN because the cap still has a Vcc-0.7V charge.

author: ledtester
author_rank: Super Contributor
timestamp: February 27, 2023, 01:14:19 am
content: You might be interested in this video:All Transistor Clock -- Leo's Bag of Trickshttps://youtu.be/Y5kkgO5MPIAThe various counters used in the clock are talked about at these points in the video:9:00 - the divide by 3000 circuit14:53 - tens of minutes counter15:25 - minutes counter19:00 - hours counter

author: David Hess
author_rank: Super Contributor
timestamp: February 27, 2023, 02:08:31 am
content: Old datasheets from Signetics show the transistor level schematic for various 74 and 74LS series logic including various flip-flops.

author: RJSV
author_rank: Super Contributor
timestamp: February 27, 2023, 04:00:52 am
content: It appears like you've 'gone analog style' when focus is on getting that low-to-high portion of the clocking process...(that's OK I guess, for what your purpose is).But, obviously, a style stronger on digital / IC would not necessitate using those large capacitors.I think an approach closer to the counter IC would have (again, I'm not complaining)...would have approached the counter using an 'edge-triggered' digital approach:Classic, and very brief acting, is the waveform rising edge detect, using a logical 'AND' (NAND, actually), with several inverting gates simply used as very very short delay, into the two-input NAND, while the original signal, rising waveform source, is also routed to that NAND.That way, the NAND gate gets suddenly satisfied, when your input waveform rises,...but very soon the other, slightly delayed portion will switch off (the NAND gate). IC uses an odd number of those inverters, which gives the little circuit an odd look, and that's because, in a static mode, that gate would never be active. But it is, only briefly, and that gives the designer a transient signal, to accomplish the count-up, or down,that is 'Rising Edge Triggered'.Of course, if that's too fast (brief) a pulse, you have to assure that the pulse gets up above desired threshold, for a guaranteed 'one's state' to be recognized by f/f circuit it clocks.

author: RJSV
author_rank: Super Contributor
timestamp: February 27, 2023, 04:25:53 am
content: ...oops,Sorry, meant to say, the NAND gate used to generate a very brief pulse, (when clock input rises), will produce a brief LOW-GOING pulse.When the full counter has, like, four stages, you would have a separate rising edge detector at each stage.

author: David Hess
author_rank: Super Contributor
timestamp: February 27, 2023, 02:48:26 pm
content: Quote from: RJHayward on February 27, 2023, 04:00:52 amUsing RC delays makes perfect sense in a discrete design where transistors are more expensive than passives. A short RC delay on one input of any 2-input gate works perfectly fine.QuoteFor flip-flops, no extra delay is required to create the race condition, at least as shown in this Signetics datasheet where the delay is only through a 3-input NAND:https://www.tvsat.com.pl/pdf/7/74s74_sig.pdfOld TI datasheets also show transistor level schematics.

author: iMo
author_rank: Super Contributor
timestamp: February 27, 2023, 04:44:54 pm
content: Long time back people used to use the "DTL" logic - Diode-Transistor-Logic..https://en.wikipedia.org/wiki/Diode%E2%80%93transistor_logic

author: RJSV
author_rank: Super Contributor
timestamp: February 27, 2023, 05:17:09 pm
content: Yes, that was correct, an RC delay has very similar function, on one input leg of the AND. My context implies that the discrete transistor circuit is SAME as would be needed in an integrated circuit, kind of like a set of (legitimately serious) 'game' rules or criteria.I.E. investigating internal IC circuits, and thus a '20 ufd' device isn't available, if designer wants to pursue in that context.Also, I'm recalling school days, when there was a lot of complexity / subtlety in the 'master-slave' flip-flop layout...something about manipulating the switching threshold, in the IC sections. Maybe, it was the first stage (master) would function first, on that rising clock coming in. (?).Then, the second f/f would trigger or be enabled to switch, on the first section output, but at a higher threshold....something like that. (?). (?).But I do remember, the overall flip/flop switching particulars seemed a bit 'Much ADO about nothing', as I didn't understand the extra 'trickery' being explained.

author: EPAIII
author_rank: Super Contributor
timestamp: February 28, 2023, 09:45:46 am
content: Yep, we sure did.And guess what. It worked. But we have better types now and no one misses the past.Quote from: imo on February 27, 2023, 04:44:54 pm

author: David Hess
author_rank: Super Contributor
timestamp: February 28, 2023, 11:57:50 pm
content: Later TTL families replaced the common base input transistors with diodes, so might be considered DTL.