3 # Copyright 2002 Free Software Foundation, Inc.
5 # This file is part of GNU Radio
7 # GNU Radio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # GNU Radio is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Radio; see the file COPYING. If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street,
20 # Boston, MA 02110-1301, USA.
23 def output(input, state):
24 x2 = (input >> 1) & 0x1
25 x1 = (input >> 0) & 0x1
26 s = (state >> 2) & 0x1
27 t = (state >> 1) & 0x1
28 u = (state >> 0) & 0x1
33 return (z2 << 2) | (z1 << 1) | z0
36 def next_state(input, state):
37 x2 = (input >> 1) & 0x1
38 x1 = (input >> 0) & 0x1
39 s0 = (state >> 2) & 0x1
40 t0 = (state >> 1) & 0x1
41 u0 = (state >> 0) & 0x1
47 return (s1 << 2) | (t1 << 1) | u1
52 state = (i >> 2) & 0x7
54 print next_state (input, state)
57 print "@@@ OUTPUT @@@"
60 state = (i >> 2) & 0x7
62 print output (input, state)