-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState4sdds.pm
More file actions
57 lines (39 loc) · 949 Bytes
/
State4sdds.pm
File metadata and controls
57 lines (39 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Author(s): David Murrugarra & Seda Arat
# Name: Having all properties needed for a state in SDDS
# Revision Date: 11/28/2011
package State4sdds;
#use Data::Dumper;
use strict;
use warnings;
use Class::Struct
(
value => '@',
decimal_rep => '$',
str_state => '$',
nextstate_tt => '@',
);
=pod
$state = get_value_and_strState($node);
Gets the array value of the given state.
=cut
sub get_value_and_strState {
my $state = shift;
my $node = shift;
@{$state->value()} = @$node;
$state->str_state(join (' ', @{$state->value()}));
}
############################################################
=pod
$state = get_nextstate_tt($table);
Returns the next state of the given state in the truth table.
=cut
sub get_nextstate_tt
{
my $state = shift;
my $table = shift;
my ($key);
$key = $state->decimal_rep();
@{$state->nextstate_tt()} = @{$$table{$key}};
}
############################################################
1;