About digital circuit design - Page 1
Forum section: electronics / beginners

author: SatoruSatake
author_rank: Newbie
timestamp: January 07, 2015, 07:38:29 am
content: Help!!!!!I was given a hard problem and unfortunately I couldn't solve. The problem is said:A mealy sequential circuit has one input and one output. The circuit examines a string of 0's and 1's applied to its inputs and generates an output for fourth consecutive 1 bit arriving at the input. Design the circuit using JK flip-flops.

author: dannyf
author_rank: Super Contributor
timestamp: January 07, 2015, 11:48:45 am
content: AND the four flip-flops' output.

author: zapta
author_rank: Super Contributor
timestamp: January 07, 2015, 02:02:28 pm
content: You can build a shift register from an inverter and jk flip flops.

author: Skimask
author_rank: Super Contributor
timestamp: January 07, 2015, 03:34:11 pm
content: ...and inverters and flip-flops from a pile of 2N2222's...sounds like another "I'm a senior at blah-blah uni working on my 'insert requirement here'."...

author: DJohn
author_rank: Regular Contributor
timestamp: January 07, 2015, 10:00:25 pm
content: This smells a lot like homework. So, first of all, go back to your textbook. Read about Mealy machines and JK flip-flops. You'll probably have been given examples of similar (if simpler) designs. Look at them closely and understand how they work. Don't skip this bit.The thing that strikes me is the requirement to use JK flip-flops. Why these? What do they do that others don't? Well... they toggle, as well as clear and set. And what does this problem appear to need? Something that counts 1 bits, which can be cleared when a 0 is seen. Counting is basically toggling bits at different rates.That's how I'd approach it. The state is a counter of how many consecutive 1s we've seen (what is the maximum number this counter needs to store, how many bits does that need, and what should it do when it reaches the maximum?). Then for each value of the input and previous state, work out what inputs each flip-flop needs for its next state (remember that there might be more than one - if this bit was 0 and needs to be 1, you can do that by either setting or toggling). Work out the logic to do this, add an output decoder, and you're done.

author: free_electron
author_rank: Super Contributor
timestamp: January 07, 2015, 11:36:49 pm
content: Quote from: Skimask on January 07, 2015, 03:34:11 pmreal men refine their own silicon from sand....

author: max_torque
author_rank: Super Contributor
timestamp: January 07, 2015, 11:52:28 pm
content: Is this why so many young engineers i interview these days are franky hopeless, even with a raft of qualifications to their name? What would you all do without the internet eh?(probably have to go to an actual physical library, engage your brains and a for once learn something........ Ah, those were the days.......)

author: Skimask
author_rank: Super Contributor
timestamp: January 08, 2015, 03:48:12 am
content: Quote from: free_electron on January 07, 2015, 11:36:49 pmHaving trouble getting all those quarks to stick together...

author: free_electron
author_rank: Super Contributor
timestamp: January 08, 2015, 09:18:17 am
content: Quote from: Skimask on January 08, 2015, 03:48:12 amTry gluons. Works great !

author: lapm
author_rank: Frequent Contributor
timestamp: January 08, 2015, 05:11:30 pm
content: To OP, you make it sound like you have been asked to design simple 4 counter with output going high when 4 is reached...Yeah i'm generation that was tortured by electronics teacher in lab with breadboard, logic chips, wires and more then less clear descriptions of what we were supposed to make... Was fun tons of fun to see how different groups interpreted vague instructions...

author: free_electron
author_rank: Super Contributor
timestamp: January 08, 2015, 05:26:36 pm
content: you can solve this mulitple ways- an up counter that restes if a logic 0 is applied and counts when a 1 is applied. if counter reaches 4 : bingo so 3 flipflops is all you need- a 4 bit shifter. if all fliplfips contain a '1' : output high. requires 4 flipflops and a 4 input and gate.go for the counter. you can play with j an k to rest the flipflop and make it count

author: 22swg
author_rank: Frequent Contributor
timestamp: January 08, 2015, 09:03:33 pm
content: How are they teaching logic / electronics these days ? I started with truth tables , and simple gates ( DLT ) and a load of graph paper ! If you want to learn you will.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2015, 09:11:09 pm
content: Quotecounters wouldn't work here.

author: c4757p
author_rank: Super Contributor
timestamp: January 08, 2015, 09:15:12 pm
content: Quote from: dannyf on January 08, 2015, 09:11:09 pmI fail to see why not. Would you care to explain?

author: codeboy2k
author_rank: Super Contributor
timestamp: January 08, 2015, 10:11:27 pm
content: Quote from: max_torque on January 07, 2015, 11:52:28 pmI remember when we had to wake up at 5 am, eat cold porridge for breakfast, trudge 50 miles through the snow with nothing but a newspaper to keep us warm, and when we got to the library we had to clean the books with a single strand of hair before we could read 'em... Ha.. Kids these days have it easy with the Internet.(thanks go to Monty Python)

author: gnif
author_rank: Unknown
timestamp: January 08, 2015, 10:14:33 pm
content: Quote from: codeboy2k on January 08, 2015, 10:11:27 pmDon't forget to mention it was uphill both ways and you had to wrap barbed wire around your bare feet for traction.

author: zapta
author_rank: Super Contributor
timestamp: January 09, 2015, 02:02:42 pm
content: Quote from: c4757p on January 08, 2015, 09:15:12 pmOf course counters will work but you need to be careful with asynchronous reset it the input value is valid only near the clock transition. Shift register doesn't have this problem but is less scalable for large counts.

author: zapta
author_rank: Super Contributor
timestamp: January 09, 2015, 02:05:55 pm
content: Quote from: codeboy2k on January 08, 2015, 10:11:27 pmYou had newspaper to warm yourselves? Lucky you.

author: free_electron
author_rank: Super Contributor
timestamp: January 09, 2015, 03:54:06 pm
content: Quote from: dannyf on January 08, 2015, 09:11:09 pmcounter works perfectly fine.input signal controls resetn line.clock in controls clock in.if the input is low the counter is in resetif input is high the counter will count. since we use a 3 flipflop counter : if the count value is 100 binary we have 4 consecutive bits. so the Q output of the third flipflop is your qualifier.set the j and k lines so that you get an upcounter .wire the input to the reset lines of the jk flipflop.bob's your uncle.

author: zapta
author_rank: Super Contributor
timestamp: January 09, 2015, 04:03:26 pm
content: Quote from: free_electron on January 09, 2015, 03:54:06 pm1. Asynchronous reset may result in unwanted resets (if the input signal is valid only during clock transitions).2. What will happen with 20 1's in row? The third ff will keep toggling up and down.Danny's shift register and AND solution addresses all these points.

author: free_electron
author_rank: Super Contributor
timestamp: January 09, 2015, 04:26:00 pm
content: Quote from: zapta on January 09, 2015, 04:03:26 pmwho says the reset is asynchronous ? use a jk flipflop with synchronous resets.The task is to detect 4 bits in a row. Nobody talks about 20 bits in a row. There are no other conditions set like ' the output should not reset when more than 4 are received'and even then , feeding back the output of the third fliplfop output could set the J and K lines such that the flipflops are in 'hold mode' so you can ram in a billion ones. no flipflop will toggle. not unless at least one 0 zero comes in to clear the counter.so you need to set the j and k lines so a single signal toggles between 'count up' and 'hold' mode. that signal is the output of q3the reset then does the rest.

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2015, 05:36:37 pm
content: QuoteDraw up a schematic and we will see if it works, :0

author: codeboy2k
author_rank: Super Contributor
timestamp: January 10, 2015, 01:05:16 am
content: Quote from: zapta on January 09, 2015, 02:05:55 pmThey weren't actually newspapers... more like used tissues we collected from the dump with some daily writings on them. But to us they were newspaper !

author: steve_w
author_rank: Regular Contributor
timestamp: January 10, 2015, 02:04:45 am
content: Luxury, you had tissues, all we had were used cigarette papers......and you tell the kids today and they wont believe you

author: SeanB
author_rank: Super Contributor
timestamp: January 10, 2015, 05:06:23 am
content: You had paper, LUXURY. All we had were leaves, and the most common were either poison ivy, castor oil bush or thistle. If you were lucky you got nice soft palm fronds.

author: steve_w
author_rank: Regular Contributor
timestamp: January 10, 2015, 08:48:45 am
content: Of course when I say cigarette papers I meant dried up pieces of leaves coated in razor sharp prickles coated in cyanide

author: SeanB
author_rank: Super Contributor
timestamp: January 10, 2015, 10:06:27 am
content: You had tobacco? All we had was dried out buck droppings, if the dung beetles did not get to them first. Wrapped in dried out leaves and then if you were lucky you had some piece that was very grassy to act as a filter.Lit with an ember from the fire, which you had to keep going or else you had to knap flint or use a fire bow to restart it.Only thing we had plenty of was dry sand.

author: zapta
author_rank: Super Contributor
timestamp: January 10, 2015, 01:02:45 pm
content: Quote from: steve_w on January 10, 2015, 02:04:45 amThese kids will have their own 'when I was at your age' stories to their grandchildren. For example, I had to route manually my PCBs and then wait a week (!) for them to arrive.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 10, 2015, 04:05:36 pm
content: Re original post .... Did the design test say ONLY using jk flip flops ?