LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2009, 08:34 AM   #1
naveenisback
Member
 
Registered: Jun 2009
Posts: 80
Blog Entries: 1

Rep: Reputation: 16
How to implement state transition program


I want to implement the following diagram (link state diagram) using C in linux.

http://http://in.mc942.mail.yahoo.com/mc/welcome?.gx=0&.tm=1252330170&.rand=aj6riat49jjuf#_pg=showMessage&sMid=0&fid=forwarded&filterBy=&midI ndex=0&mid=1_20839_AMcQaMsAAIzkSqUCUgnn%2FhpZD7c&f=1&m=1_20839_AMcQaMsAAIzkSqUCUgnn%2FhpZD7c,1_176_A MQQaMsAAGm7SnrBmAXHU2M8P4w,1_1166_AMcQaMsAACBhSlbEngTNeV%2BxS2w,1_2353_AMUQaMsAAKipSlW2XQSmjXczNVw,1 _3504_AMoQaMsAAEu4SktKNg3q7hsByQA,1_4416_AMcQaMsAAWq2ShvIPQbZYnYMPtg,&sort=date&order=down&startMid= 0&pSize=25&hash=cb352c839bb75705fb0c7bff81ba14a9&.jsrand=6532503

or to this image http://en.wikipedia.org/wiki/State_diagram



give some ideas I mean program flow with a small example.. I surfed in the net for the c programs for stae transition table.. But i dint found

Last edited by naveenisback; 09-07-2009 at 08:40 AM.
 
Old 09-07-2009, 09:03 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You mean, write your coursework for you? No, that's for you to understand and complete yourself. Your tutor / lecturer should have provided you with information about mutex locks and such, and this is a really great project to see some object orientated things going on too, so ideal for a C++ proof of concept. We are not here to do your work for you though.
 
Old 09-07-2009, 09:43 AM   #3
jdines
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Rep: Reputation: 0
Post Finite State Machine

Try Googling "Finite State Machine"
 
Old 09-10-2009, 01:26 AM   #4
naveenisback
Member
 
Registered: Jun 2009
Posts: 80

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Hi acid,


basically Im electronics student. while Im reading about statemachines I decided to write state machine program . it was not assigned by any lecturer to me. anyway thanks for suggesting c++.

and thanks to jdines also.
 
Old 09-10-2009, 02:37 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
OK, fair enough. I actually nearly chose to implement this for my thesis project, but didn't in the end. A mini adventure there. Exciting.

Anyway, it'd be interesting to do something as theoretical as this in code, as you'd be able to seperately implement a number of seperate building blocks into a simple solution especially when you can asynchronously link a number of objects together to pass data between them without any intervention. C++ wouldn't be essential, if I were to start this tomorrow I'd look to do some object orientated python. You'd presumably start off with a base class for an object which is able to connected to other instances, as a producer or a consumer with a fifo buffering all inbound data. (giver and taker would work, but poncy language is more fun). Then inherit (or whatever the right word is for it) that base object into a simple 1 in one out module and then expand from then on to the additional functionality.
 
Old 09-10-2009, 04:03 PM   #6
karlatLQ
Member
 
Registered: Sep 2009
Posts: 67

Rep: Reputation: 19
Think that this is the correct link: Wikipedia State Diagram

There are several different state diagram examples in the reference that you gave above. Which one are you trying to implement?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set deadeyes Linux - Server 14 07-29-2009 04:30 AM
XP --> Slackware Transition RaptorX Slackware 13 07-01-2009 11:51 AM
How to implement a POSIX threaded program to solve producer/consumer problem cy163 Programming 3 09-13-2008 09:38 AM
not work: iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 3306 -j DROP abefroman Linux - Security 1 07-18-2007 08:19 AM
LXer: State by state, Microsoft responds to creeping threat LXer Syndicated Linux News 0 05-01-2007 07:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration