All About Circuits Forum Divide by 2 flipflop with 3 NAND gates?
 User Name Remember Me? Password
 Register Blogs FAQ Members List Today's Posts Search Today's Posts Mark Forums Read

 Notices Welcome to the All About Circuits forums.Our forum is a place where thousands of students, hobbyists and professionals from around the world share knowledge and ideas. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us.

 General Electronics Chat Discussion forum for general chat about anything electronics related, including asking questions about material in the All About Circuits E-book, Worksheets, and Videos.

#1
02-05-2012, 03:05 PM
 THE_RB Senior Member Join Date: Feb 2008 Posts: 5,247
Divide by 2 flipflop with 3 NAND gates?

Hi, I need a divide by 2 "flip flop" logic device, and rather than add an entire new flip flop IC to the design I have 3 spare NAND gates.

Does anyone know if it is possible to make a divide by 2 type flip flop using just the 3 NAND gates?

The input is a logic level 0v-5v square wave with a duty of 40-60%, somewhere around 10kHz and I need an output at half the frequency and 50% duty cycle. It doesn't matter if it triggers from the / edge or the \ edge of the input signal, as long as it divides by 2 and gets exactly 50% duty.

I have made S/R flip flops from NAND gates, which just takes 2 gates, so maybe it's possible to add another NAND gate and make it a toggle type (divide by 2) flip flop? I've been working with PICs for so many years that I'm rusty on the fine details of working with discrete logic gates, I think the last time I tried to make something complex out of gates was in the late 70's.

Thank you.
__________________
Roman Black - PICs and electronics. Author of BTc PIC-sound encoder, Shift1-LCD project, the TalkBotBrain talking PIC controller, LiniStepper open-source microstepping motor driver, the Black Regulator 2-transistor SMPS, and probably some other stuff; www.RomanBlack.com
#2
02-05-2012, 03:26 PM
 Bill_Marsden Super Moderator Join Date: Mar 2008 Location: Dallas, TX (GMT-5 w/ DST) Posts: 19,024 Blog Entries: 5

Any other logic at all? I cut my teeth on Master/Slave FF, it might be possible to do something with diode steering.
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
#3
02-05-2012, 03:26 PM
 crutschow Senior Member Join Date: Mar 2008 Location: L.A. USA Posts: 6,337 Blog Entries: 1

I believe you would need more gates. Here's a reference discussing the various types of FFs.
__________________
Zapper
Curmudgeon Elektroniker
#4
02-05-2012, 04:18 PM
 praondevou Senior Member Join Date: Jul 2011 Location: Canada Posts: 2,887

Can any other components be used too? Like capacitor, resistor, diode?
__________________

#5
02-05-2012, 04:19 PM
 Bill_Marsden Super Moderator Join Date: Mar 2008 Location: Dallas, TX (GMT-5 w/ DST) Posts: 19,024 Blog Entries: 5

That is what I was asking in post #2.
__________________
..
"Good enough is enemy of the best." An old engineering saying, Author unknown.

General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie.
#6
02-05-2012, 08:55 PM
 SgtWookie Expert Member Join Date: Jul 2007 Location: In the vast midwest of the USA; CST Posts: 22,032

You would need six NAND gates, and one of them would need to have three inputs.

__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
#7
02-05-2012, 10:06 PM
 holnis Member Join Date: Nov 2011 Posts: 50

I think it's possible with using just 3 NAND gates, Take a look to the link given on the post #3, From there on the diagram of the D- flip-flop we can Conclude this equation:

C= Clock
D= Data
Q= Output

Q(t+1) = ((DC)' + (Q + (D'C)' )' )'

After Simplification:

Q(t+1) = ((DCQ)' . ( DC (D + C') )' )'

Q(t+1) = ((DCQ)' . (DC)' )'

So I think it's possible With just 3 NAND, one of them would need to have three inputs.

Maybe I'm wrong!
#8
02-06-2012, 06:21 AM
 crutschow Senior Member Join Date: Mar 2008 Location: L.A. USA Posts: 6,337 Blog Entries: 1

To divide by two you need an edge-triggered FF and that requires more than three gates.
__________________
Zapper
Curmudgeon Elektroniker
#9
02-06-2012, 12:05 PM
 SgtWookie Expert Member Join Date: Jul 2007 Location: In the vast midwest of the USA; CST Posts: 22,032

Quote:
 Originally Posted by holnis I think it's possible with using just 3 NAND gates, Take a look to the link given on the post #3, From there on the diagram of the D- flip-flop
Unfortunately, that D-type FF schematic in that link isn't correct. If Q\ is connected to D, and then CP goes high, the circuit will oscillate at high frequency.

As crutschow mentioned, it needs to be edge-triggered, and that takes more gates.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
#10
02-06-2012, 03:50 PM
 THE_RB Senior Member Join Date: Feb 2008 Posts: 5,247

Thank you Crutschow for the great link on flip-flops! Ok so I don't feel so bad now that my couple of quick attempts to make a /2 circuit out of 3 NAND gates didn't work.

The circuit has three 2-input NAND gates spare. They are schmidt trigger input type. The other NAND gate is used as an oscillator, and the desired result from the one chip is to get a rough frequency output but at exactly 50% duty (hence the /2 idea).

I don't want to add other chips but maybe it can be done with a couple of extra discretes? Since the oscillator is a fixed freq (say +/-10% freq accuracy) it might be possible to use an RC timed circuit on the output to cause the /2 toggling?

I also considered using a dual flipflop IC with one FF being the oscillator and the other FF as the /2, but I could not find an easy source for a FF with a schmidt trigger input as the oscillator needs to be fairly reliable so a schmidt input is desired.

If it starts getting too parts-heavy I can always use a \$1 PIC, but I prefer if possible to use a 15 cent quad NAND gate. Any suggestions appreciated.
__________________
Roman Black - PICs and electronics. Author of BTc PIC-sound encoder, Shift1-LCD project, the TalkBotBrain talking PIC controller, LiniStepper open-source microstepping motor driver, the Black Regulator 2-transistor SMPS, and probably some other stuff; www.RomanBlack.com

 Tags divide, flipflop, gates, nand

 Related Site Pages Section Title Worksheet Counters Worksheet Flip-flop circuits Video Lecture Sequential Logic - Digital Textbook Ring counters : Shift Registers Textbook Serial-in/serial-out shift register : Shift Registers Textbook Finite State Machines : Sequential Circuits Counters Textbook Asynchronous counters : Sequential Circuits Counters Textbook Asynchronous flip-flop inputs : Multivibrators Textbook The J-K flip-flop : Multivibrators Textbook NAND gate S-R flip-flop : Digital Integrated Circuits

 Similar Threads Thread Thread Starter Forum Replies Last Post frankpc The Projects Forum 18 09-12-2011 07:15 PM anamta Homework Help 3 12-30-2010 01:52 PM KMK The Projects Forum 13 12-24-2010 10:43 PM elRey General Electronics Chat 3 09-05-2009 03:09 AM peterlan General Electronics Chat 14 09-14-2008 03:46 PM

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Electronics Forums     General Electronics Chat     The Projects Forum     Homework Help     Electronics Resources Software, Microcomputing, and Communications Forums     Programmer's Corner     Embedded Systems and Microcontrollers     Computing and Networks     Radio and Communications Circuits and Projects     The Completed Projects Collection Abstract Forums     Math     Physics     General Science All About Circuits Commmunity Forums     Off-Topic     The Flea Market     Feedback and Suggestions

All times are GMT. The time now is 02:25 AM.

User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.