Sponsored Content
Top Forums Programming Bitwise operation for state machine Post 302880853 by anand.shah on Tuesday 24th of December 2013 04:23:16 AM
Old 12-24-2013
Bitwise operation for state machine

Hello All,
I am writing basic state machine which maintains 8 different states and there is posibility that system may be in multiple states at a time (Except for state1 to state3. menas only once state can be active at a time from state1 to state3).
I have declared enum like one below

Code:
enum
{
   state1 1
   state2 1 << 1
   state3 1 << 2
   state4 1 << 4
    ....
    ....
}

Now my requirement is that state1 to state3 can not be active at a given instance.
Example if machine is in state1 then; state variabale would be -->
Code:
 xxxx x001

... then when system changes its state to to state3 ... state variable should become
Code:
xxxx x100.

.

Note :- "x'" indicates other state variable which should not get affected because of above operations.

Thank you very much in advance.

Regards,
Anand Shah
 

2 More Discussions You Might Find Interesting

1. AIX

Open firmware state to running state

Hi Admins, I am having a whole system lpar in open firmware state on HMC. How can I bring it to running state ? Let me know. Thanks. (2 Replies)
Discussion started by: snchaudhari2
2 Replies

2. Shell Programming and Scripting

Vim function to generate RTL Code(finite state machine) in verilog

Hi I wanted to call the AutoFsm function (given below) in vim to generate a code something like: **********verilog code to generate ************* always @(posedge clk or negedge rst_n) begin if(!rst_n) begin state_r <= #1 next_stateascii_r; ... (0 Replies)
Discussion started by: dll_fpga
0 Replies
XMLRPC::Lite(3pm)					User Contributed Perl Documentation					 XMLRPC::Lite(3pm)

NAME
XMLRPC::Lite - client and server implementation of XML-RPC protocol SYNOPSIS
Client use XMLRPC::Lite; print XMLRPC::Lite -> proxy('http://betty.userland.com/RPC2') -> call('examples.getStateStruct', {state1 => 12, state2 => 28}) -> result; CGI server use XMLRPC::Transport::HTTP; my $server = XMLRPC::Transport::HTTP::CGI -> dispatch_to('methodName') -> handle ; Daemon server use XMLRPC::Transport::HTTP; my $daemon = XMLRPC::Transport::HTTP::Daemon -> new (LocalPort => 80) -> dispatch_to('methodName') ; print "Contact to XMLRPC server at ", $daemon->url, " "; $daemon->handle; DESCRIPTION
XMLRPC::Lite is a Perl modules which provides a simple nterface to the XML-RPC protocol both on client and server side. Based on SOAP::Lite module, it gives you access to all features and transports available in that module. See t/26-xmlrpc.t for client examples and examples/XMLRPC/* for server implementations. DEPENDENCIES
SOAP::Lite SEE ALSO
SOAP::Lite CREDITS
The XML-RPC standard is Copyright (c) 1998-2001, UserLand Software, Inc. See <http://www.xmlrpc.com> for more information about the XML- RPC specification. COPYRIGHT
Copyright (C) 2000-2001 Paul Kulchenko. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Paul Kulchenko (paulclinger@yahoo.com) perl v5.12.4 2011-08-18 XMLRPC::Lite(3pm)
All times are GMT -4. The time now is 05:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy