Author Topic: About digital circuit design  (Read 8447 times)

0 Members and 1 Guest are viewing this topic.

Offline SatoruSatakeTopic starter

  • Newbie
  • Posts: 7
  • Country: jp
About digital circuit design
« on: January 07, 2015, 07:38:29 am »
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.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: About digital circuit design
« Reply #1 on: January 07, 2015, 11:48:45 am »
AND the four flip-flops' output.
================================
https://dannyelectronics.wordpress.com/
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: About digital circuit design
« Reply #2 on: January 07, 2015, 02:02:28 pm »
You can build a shift register from an inverter and jk flip flops.
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: About digital circuit design
« Reply #3 on: January 07, 2015, 03:34:11 pm »
...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'."...
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline DJohn

  • Regular Contributor
  • *
  • Posts: 103
  • Country: gb
Re: About digital circuit design
« Reply #4 on: January 07, 2015, 10:00:25 pm »
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.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: About digital circuit design
« Reply #5 on: January 07, 2015, 11:36:49 pm »
...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'."...

real men refine their own silicon from sand....
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1272
  • Country: gb
    • bitdynamics
Re: About digital circuit design
« Reply #6 on: January 07, 2015, 11:52:28 pm »
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.......   :-DD  )
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: About digital circuit design
« Reply #7 on: January 08, 2015, 03:48:12 am »
real men refine their own silicon from sand....
Having trouble getting all those quarks to stick together...
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: About digital circuit design
« Reply #8 on: January 08, 2015, 09:18:17 am »
real men refine their own silicon from sand....
Having trouble getting all those quarks to stick together...

Try gluons. Works great !
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: About digital circuit design
« Reply #9 on: January 08, 2015, 01:21:27 pm »
 :-DD
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline lapm

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: fi
Re: About digital circuit design
« Reply #10 on: January 08, 2015, 05:11:30 pm »
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...
Electronics, Linux, Programming, Science... im interested all of it...
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: About digital circuit design
« Reply #11 on: January 08, 2015, 05:26:36 pm »
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
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: About digital circuit design
« Reply #12 on: January 08, 2015, 09:03:33 pm »
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.
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: About digital circuit design
« Reply #13 on: January 08, 2015, 09:11:09 pm »
Quote
counter

counters wouldn't work here.
================================
https://dannyelectronics.wordpress.com/
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: About digital circuit design
« Reply #14 on: January 08, 2015, 09:15:12 pm »
Quote
counter

counters wouldn't work here.

I fail to see why not. Would you care to explain?
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: About digital circuit design
« Reply #15 on: January 08, 2015, 10:11:27 pm »
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.......   :-DD  )

I 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)
 

Offline gnif

  • Administrator
  • *****
  • Posts: 1672
  • Country: au
Re: About digital circuit design
« Reply #16 on: January 08, 2015, 10:14:33 pm »
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.......   :-DD  )

I 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)

Don't forget to mention it was uphill both ways and you had to wrap barbed wire around your bare feet for traction.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: About digital circuit design
« Reply #17 on: January 09, 2015, 02:02:42 pm »
Quote
counter

counters wouldn't work here.

I fail to see why not. Would you care to explain?

Of 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.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: About digital circuit design
« Reply #18 on: January 09, 2015, 02:05:55 pm »
I 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)

You had newspaper to warm yourselves? Lucky you.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: About digital circuit design
« Reply #19 on: January 09, 2015, 03:54:06 pm »
Quote
counter

counters wouldn't work here.

counter works perfectly fine.

input signal controls resetn line.

clock in controls clock in.

if the input is low the counter is in reset
if 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.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: About digital circuit design
« Reply #20 on: January 09, 2015, 04:03:26 pm »
Quote
counter

counters wouldn't work here.

counter works perfectly fine.

input signal controls resetn line.

clock in controls clock in.

if the input is low the counter is in reset
if 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.

1. 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.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: About digital circuit design
« Reply #21 on: January 09, 2015, 04:26:00 pm »
Quote
counter

counters wouldn't work here.

counter works perfectly fine.

input signal controls resetn line.

clock in controls clock in.

if the input is low the counter is in reset
if 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.

1. 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.

who 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 q3
the reset then does the rest.

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: About digital circuit design
« Reply #22 on: January 09, 2015, 05:36:37 pm »
Quote
counter works perfectly fine.

Draw up a schematic and we will see if it works, :0
================================
https://dannyelectronics.wordpress.com/
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: About digital circuit design
« Reply #23 on: January 10, 2015, 01:05:16 am »
You had newspaper to warm yourselves? Lucky you.

They 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 !
 

Offline steve_w

  • Regular Contributor
  • *
  • Posts: 190
  • Country: au
Re: About digital circuit design
« Reply #24 on: January 10, 2015, 02:04:45 am »
Luxury, you had tissues, all we had were used cigarette papers......

and you tell the kids today and they wont believe you
So long and thanks for all the fish
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16272
  • Country: za
Re: About digital circuit design
« Reply #25 on: January 10, 2015, 05:06:23 am »
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.
 

Offline steve_w

  • Regular Contributor
  • *
  • Posts: 190
  • Country: au
Re: About digital circuit design
« Reply #26 on: January 10, 2015, 08:48:45 am »
Of course when I say cigarette papers I meant dried up pieces of leaves coated in razor sharp prickles coated in cyanide

So long and thanks for all the fish
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16272
  • Country: za
Re: About digital circuit design
« Reply #27 on: January 10, 2015, 10:06:27 am »
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.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: About digital circuit design
« Reply #28 on: January 10, 2015, 01:02:45 pm »
Luxury, you had tissues, all we had were used cigarette papers......

and you tell the kids today and they wont believe you

These 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.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: About digital circuit design
« Reply #29 on: January 10, 2015, 04:05:36 pm »
Re original post .... Did the design test  say ONLY using jk flip flops ?
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf