473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

debounce state diagram FSM

I'm designing a debounce filter using Finite State Machine. The FSM
behavior is it follows the inital input bit and thinks that's real
output until it receives 3 consecutive same bits and it changes output
to that 3 consecutive bit until next 3 consecutive bits are received.
A reset will set the FSM to output 1s until it receives the correct
input and ouput.

This is the test sequence with input and correct output.

1 0 0 1 0 1 0 0 0 1 0 1 1 1 (input)
1 1 1 1 1 1 1 1 0 0 0 0 0 1 (output)

The state diagram I came up has 6 states and it's named SEE1, SEE11,
SEE111, SEE0, SEE00, SEE000. I am getting stuck at 11th bit, a 0 in
the input. Because it just came from SEE1 and before SEE1, it came
from SEE000, so at SEE1 it can not change ouput to 1 which is what I
have specified that state's ouput to be.

Anyone knows how to solve this problem? Or maybe there's other better
ways to design the state diagram?

Thanks,

Anson

Apr 29 '07
70 4242
Jim Lewis wrote, On 02/05/07 21:24:
Keith,
A few minutes of breathing, adopting a forgiving attitude,
and forgoing the concerned posts about the cross-posting
would reduce the net traffic by 30% (accurate yesterday -
includes replies - probably increased today).
A little consideration by those continuing to cross-post after it has
been pointed out would reduce traffic more. After al, the requests were
polite.
Of course it would be nice if people did not cross-post
potentially irrelevant topics (which this may or may not
be),
Since no one from comp.lang.c has come in to say it is topical on
comp.lang.c and the thread has so far had one post with C in it, from
someone saying basically "you are complaining so here is some C" I think
it is fairly conclusive.
however, if you have a threaded news reader, close
the thread and the clutter is gone.
The additional time downloading is not, and some people are still on
slow dial-up *and* paying per minute. Also, if it is OK for one it is OK
for all, so we get loads more off topic cross-posting and matters become
worse.
It seems to me that the only difference it makes is to
the people who are following the thread. I have to flip
through the posts without content (your complaints).
If people would stop the cross-posts when it was pointed out that would
be one or two posts not lots. Therefore, the thing that will reduce it
most is if people stop inappropriate cross-posts when it is pointed out.

Why do you think it reasonable for us to have to put up with
inappropriate cross-posts and not for you to put up with polite requests
to stop the cross-posts?
--
Flash Gordon
May 2 '07 #51
On Tue, 01 May 2007 19:25:22 -0700, Keith Thompson wrote:
John Larkin <jj******@highNOTlandTHIStechnologyPART.comwrite s:
>On Tue, 01 May 2007 17:29:11 -0700, Keith Thompson <ks***@mib.org>
>>>So repeated requests to redirect this discussion away from
comp.lang.c, where it's completely off-topic, have not worked. Does
anybody have any suggestions for what *would* work?

Programming embedded systems, things that interface to the real world,
are off-topic to c programmers? Why am I not surprised?

Questions which have nothing to do with programming in C are off-topic
in comp.lang.c. (If the original poster had asked for a C solution,
it might have been different, but I don't think I've seen a single
line of C source code in this thread.)

I'm getting the impression that once someone posts an inappropriately
cross-posted discussion, there's just no way to keep it from
continuing on all the newsgroups to which it was originally posted,
because most people posting followups just don't pay attention to the
Newsgroups: header. Oh, well.
Well, you could have removed comp.lang.c from your own followups, rather
than perpetuating it. After all, you only want to bitch at the people in
the other groups, right?

And you _do_ know how to set "followups-to", don't you?

I envision a squad of about a half-dozen people, back-to-back-to-back, etc.,
trying to fend off the onslaught of C++, perl, assembler, etc, etc,
etc...

Good Luck!
Rich

May 2 '07 #52
On Tue, 01 May 2007 19:14:27 -0700, Keith Thompson wrote:
CBFalconer <cb********@yahoo.comwrites:
>Keith Thompson wrote:
>>>
So repeated requests to redirect this discussion away from
comp.lang.c, where it's completely off-topic, have not worked. Does
anybody have any suggestions for what *would* work?

Set follow-ups.

I did, but it didn't do any good. I could only set followups in my
own followup; other direct replies to the original message retained
the full cross-posting.
You _could have_ set followups in this very post, but you failed to
do so.

Ergo, your continuing crossposting of your pissing and moaning just
perpetuates the problem. Trying to make other people responsible for
fixing stuff that you don't like is always doomed to failure.

Cheers!
Rich

May 2 '07 #53
On Tue, 01 May 2007 20:45:07 -0700, Keith Thompson wrote:
No, not on this one. In my initial message, I redirected followups in
an attempt to divert the discussion away from comp.lang.c. In my
later message, I was trying to find out why that didn't work and what
might work instead, so I didn't bother redirecting followups.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then, you're acting like a fool.

Cheers!
Rich

May 2 '07 #54
Rich Grise wrote:

Well, you could have removed comp.lang.c from your own followups,
rather than perpetuating it. After all, you only want to bitch at the
people in the other groups, right?

And you do know how to set "followups-to", don't you?
People keep saying this like it's some sort of magic. All that does
direct replies to THAT message to certain groups. It has jack to do
with the thread.

It's also the case that topicality IS on-topic in comp.lang.c, as in
all groups, so there's really no need to set follow-ups in those cases.
In fact, I'd argue that it's the wrong thing to do.
I envision a squad of about a half-dozen people,
back-to-back-to-back, etc., trying to fend off the onslaught of C++,
perl, assembler, etc, etc, etc...
This demonstrates that you have little familiarity with C or
comp.lang.c.


Brian
May 2 '07 #55
On Wed, 02 May 2007 08:02:40 +0100, Flash Gordon wrote:
Note I've not set followups this time because discussions about
topicality *are* topical.
And you're still following up to the group that you want the crosspost
removed from.

Are you C people all that lame?

Here's a clue: Set your followups to:
comp.lang.vhdl,comp.arch.fpga,sci.electronics.desi gn,comp.lang.verilog
for your whining and bellyaching - you might be surprised!

Of course, in this case, I've already repaired it. And threads like
this usually die soon anyway.

Good Luck!
Rich

May 2 '07 #56
Rich Grise wrote:

Are you C people all that lame?
Yeah, that's plonk time.

Brian
May 2 '07 #57
On Wed, 02 May 2007 13:24:58 -0700, in comp.lang.c , Jim Lewis
<ji*@synthworks.comwrote:
>Keith,
A few minutes of breathing, adopting a forgiving attitude,
and forgoing the concerned posts about the cross-posting
would reduce the net traffic by 30% (accurate yesterday -
includes replies - probably increased today).
Bollocks. Not redirecting people would result in vast heaps of
steaming drivel being posted to all sorts of inappropriate places.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
May 2 '07 #58
Rich Grise wrote, On 02/05/07 23:41:
On Wed, 02 May 2007 08:02:40 +0100, Flash Gordon wrote:
>Note I've not set followups this time because discussions about
topicality *are* topical.

And you're still following up to the group that you want the crosspost
removed from.

Are you C people all that lame?

Here's a clue: Set your followups to:
comp.lang.vhdl,comp.arch.fpga,sci.electronics.desi gn,comp.lang.verilog
for your whining and bellyaching - you might be surprised!
That does sod all good because the off topic posts are not in response
to it being redirected.
Of course, in this case, I've already repaired it.
In the wrong direction since you directed it at the one group we can all
be reasonably sure you do not read, so I've redirected it back to the
groups where people have been inconsiderate enough not to restring
cross-posts after polite requests and are getting upset about some
people not liking it.
And threads like
this usually die soon anyway.
They die a lot faster when people take note when it is pointed out the
thread is off topic in one or more groups.
--
Flash Gordon
May 2 '07 #59
CBFalconer <cb********@yahoo.comwrites:
[...]
Your first post, dated 2007-05-01 17.29.11 -0700 had no follow-ups
set as received here.
[...]

That wasn't my first post; details to follow by e-mail. Followups set.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
May 3 '07 #60
On Wed, 02 May 2007 22:59:08 +0100, Flash Gordon
<sp**@flash-gordon.me.ukwrote:
>Jim Lewis wrote, On 02/05/07 21:24:
>Keith,
A few minutes of breathing, adopting a forgiving attitude,
and forgoing the concerned posts about the cross-posting
would reduce the net traffic by 30% (accurate yesterday -
includes replies - probably increased today).

A little consideration by those continuing to cross-post after it has
been pointed out would reduce traffic more. After al, the requests were
polite.
>Of course it would be nice if people did not cross-post
potentially irrelevant topics (which this may or may not
be),

Since no one from comp.lang.c has come in to say it is topical on
comp.lang.c and the thread has so far had one post with C in it, from
someone saying basically "you are complaining so here is some C" I think
it is fairly conclusive.
however, if you have a threaded news reader, close
the thread and the clutter is gone.

The additional time downloading is not, and some people are still on
slow dial-up *and* paying per minute. Also, if it is OK for one it is OK
for all, so we get loads more off topic cross-posting and matters become
worse.
>It seems to me that the only difference it makes is to
the people who are following the thread. I have to flip
through the posts without content (your complaints).

If people would stop the cross-posts when it was pointed out that would
be one or two posts not lots. Therefore, the thing that will reduce it
most is if people stop inappropriate cross-posts when it is pointed out.

Why do you think it reasonable for us to have to put up with
inappropriate cross-posts and not for you to put up with polite requests
to stop the cross-posts?

You're right, engineers and programmers should communicate as seldom
as possible.

John

May 3 '07 #61
Flash Gordon wrote:
Jim Lewis wrote, On 02/05/07 21:24:
.... snip ...
>
>however, if you have a threaded news reader, close
the thread and the clutter is gone.

The additional time downloading is not, and some people are still
on slow dial-up *and* paying per minute. Also, if it is OK for one
it is OK for all, so we get loads more off topic cross-posting and
matters become worse.
>It seems to me that the only difference it makes is to
the people who are following the thread. I have to flip
through the posts without content (your complaints).

If people would stop the cross-posts when it was pointed out that
would be one or two posts not lots. Therefore, the thing that will
reduce it most is if people stop inappropriate cross-posts when it
is pointed out.

Why do you think it reasonable for us to have to put up with
inappropriate cross-posts and not for you to put up with polite
requests to stop the cross-posts?
What baffles me is that here is a whole list of people complaining,
and not one of them sets the follow-up marker (except me). I am
wondering if there is something in the readers or servers involved.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

May 3 '07 #62
CBFalconer wrote, On 03/05/07 01:03:
Flash Gordon wrote:
<snip>
>Why do you think it reasonable for us to have to put up with
inappropriate cross-posts and not for you to put up with polite
requests to stop the cross-posts?

What baffles me is that here is a whole list of people complaining,
and not one of them sets the follow-up marker (except me). I am
wondering if there is something in the readers or servers involved.
Asking why they post to a C group is topical on the C group. My simple
"please post in another group" message did IIRC have followups set. I
have also made some of my posts ONLY to the other groups where I really
did not want to see responses.
--
Flash Gordon
May 3 '07 #63
CBFalconer wrote:
What baffles me is that here is a whole list of people complaining,
and not one of them sets the follow-up marker (except me). I am
wondering if there is something in the readers or servers involved.

As I mentioned elsewhere, I don't feel it's appropriate. The only
reason I see to set follow-ups is when attempting to move a thread to a
new group (not in the original distribution).

Setting follow-ups does nothing for where YOUR post appears. If it's
not appropriate for replies to yours to appear in group X, then your
post wasn't appropriate either.

The correct action is to remove group X from your post's distribution.
That's what I did in a couple of early, "please don't post replies to
clc" messages.

These, where we're discussing what I consider to be metatopics, retain
clc (I added it back).

Brian
May 3 '07 #64
On Wed, 02 May 2007 22:40:10 +0000, Default User wrote:
Rich Grise wrote:
>Well, you could have removed comp.lang.c from your own followups,
rather than perpetuating it. After all, you only want to bitch at the
people in the other groups, right?

And you do know how to set "followups-to", don't you?

People keep saying this like it's some sort of magic. All that does
direct replies to THAT message to certain groups. It has jack to do
with the thread.
OK, then take comp.lang.c out of the crosspost in the "Newsgroups" box;
this might be "To" or something on your news client.

Look and see which newsgroup I've posted this very message to.

You can do the same thing, except you'd want to do the inverse for
your bitching posts, so that the replies don't go back to your NG.

Make Sense?
Rich

May 3 '07 #65
On Thu, 03 May 2007 00:13:04 +0100, Flash Gordon wrote:
Rich Grise wrote, On 02/05/07 23:41:
>On Wed, 02 May 2007 08:02:40 +0100, Flash Gordon wrote:
>>Note I've not set followups this time because discussions about
topicality *are* topical.

And you're still following up to the group that you want the crosspost
removed from.

Are you C people all that lame?

Here's a clue: Set your followups to:
comp.lang.vhdl,comp.arch.fpga,sci.electronics.des ign,comp.lang.verilog
for your whining and bellyaching - you might be surprised!

That does sod all good because the off topic posts are not in response
to it being redirected.
So, change the "Newsgroups" field in the post that you're actually
posting, and to hell with the followups!

See what I've done here? Look at my headers. See? No crosspost.

I also had to put that in by hand, since your "followups to" did,
in fact, default to everything but comp.lang.c - you simply have
to be smarter than your newsreader.

Sheesh!
Rich

May 3 '07 #66
On Wed, 02 May 2007 22:38:08 GMT, in comp.lang.c , Rich Grise
<ri**@example.netwrote:
>On Tue, 01 May 2007 20:45:07 -0700, Keith Thompson wrote:
>No, not on this one. In my initial message, I redirected followups in
an attempt to divert the discussion away from comp.lang.c. In my
later message, I was trying to find out why that didn't work and what
might work instead, so I didn't bother redirecting followups.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Then, you're acting like a fool.
If you have nothing better to add than such comments, please feel free
to desist from posting.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
May 3 '07 #67


CBFalconer wrote:
petrus bitbyter wrote:

... snip ...

Obviously wrong.
Right- it doesn't take a minute to synthesize an actual logic circuit
for this pathetically trivial requirement which then demands no more
than a simian brain development to produce a so-called state diagram.
The OP is that aggravating wog muslim, Meetul, a sorry-assed excuse for
an engineering practitioner , so I did not bother expanding any further.

May 5 '07 #68
Fred Bloggs said:
The OP is that aggravating wog muslim
Well well well, another entry for the killfile. Racism is a clear sign
of stupidity. Were stupidity curable by reason, that might be another
matter, but it isn't, so it isn't.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
May 5 '07 #69


Richard Heathfield wrote:
Fred Bloggs said:

>>The OP is that aggravating wog muslim


Well well well, another entry for the killfile. Racism is a clear sign
of stupidity. Were stupidity curable by reason, that might be another
matter, but it isn't, so it isn't.
Stupidity is more often demonstrated by those who claim to see "a clear
sign" all the time...

May 5 '07 #70
On Apr 29, 7:32 pm, Anson.Stugg...@gmail.com wrote:
I'm designing a debounce filter using Finite State Machine. The FSM
behavior is it follows the inital input bit and thinks that's real
output until it receives 3 consecutive same bits and it changes output
to that 3 consecutive bit until next 3 consecutive bits are received.
A reset will set the FSM to output 1s until it receives the correct
input and ouput.

This is the test sequence with input and correct output.

1 0 0 1 0 1 0 0 0 1 0 1 1 1 (input)
1 1 1 1 1 1 1 1 0 0 0 0 0 1 (output)

The state diagram I came up has 6 states and it's named SEE1, SEE11,
SEE111, SEE0, SEE00, SEE000. I am getting stuck at 11th bit, a 0 in
the input. Because it just came from SEE1 and before SEE1, it came
from SEE000, so at SEE1 it can not change ouput to 1 which is what I
have specified that state's ouput to be.

Anyone knows how to solve this problem? Or maybe there's other better
ways to design the state diagram?
Just describe the states in C first: "output" is the debounced output
value; "contradictions" is the number of bits that were input that
could convince you to switch the output state.

int output = 1; // 0 or 1
int contradicitions = 0; // 0, 1, or 2

for (;;) {
int input = get_input ();
if (input == output) contradictions = 0;
else if (contradictions < 2) ++contradictions;
else { output = input; contradictions = 0; }
}

Clearly there are six states; fill in the transitions according to
what the algorithm does.

May 5 '07 #71

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maria | last post by:
Heya, I am doing some background reading about the database and i am a little bit confused, i would appreciated any help.... Assume been asked to draw the ER diagram for the following...
0
by: ashokkumarrsp | last post by:
how to generate a state transition diagram in c.. give me the implementation steps or the required algorithm
3
by: Pete | last post by:
Please can anyone recommend products that will take a state machine diagram and generate code for C#? Its for a comms protocol. thanks in advance Pete.
67
by: Rui Maciel | last post by:
I've been delving into finite state machines and at this time it seems that the best way to implement them is through an intense use of the goto statement. Yet, everyone plus their granmother is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.