-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencoder.h
More file actions
73 lines (71 loc) · 1.69 KB
/
encoder.h
File metadata and controls
73 lines (71 loc) · 1.69 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#ifndef ENCODER_H
#define ENCODER_H
/* Binary Convolutional Codes Encoder */
class encoder{
public :
/*
Description: Binary Convolutional Codes Encoder Constructor.
Parameters:
- void
Returns:
- void
*/
encoder();
/*
Description: encode one bit of message and return encoded .
Parameters:
- bool (1: True, 0: False) input bit
Returns:
- __int8 encoded message
*/
__int8 const encode(bool bit);
/*
Description: encode one bit of message
return and print encoded bit detail.
Parameters:
- bool (1: True, 0: False) input bit
Returns:
- __int8 encoded message
*/
__int8 const encodeDetail(bool bit);
~encoder(); // class destructor
private :
/*
private var __int8 state:2
2 bit use for show state
*/
__int8 state : 2;
/*
Description: encode one bit of message and return encoded .
Parameters:
- const bool (1: True, 0: False) input bit pointer
- const __int8 state pointer
Returns:
- __int8 encoded message
*/
__int8 encodedMsg(const bool& bit, const __int8& state);
/*
get Next State
Parameters:
- const bool bit : input bit refrence
- const __int8 state refrence
Returns:
- __int8 state
*/
__int8 nextState(const bool& bit, const __int8& state);
/*
private func logLevel()
define print pattern for print
Machine state, input Bit
encoded bit and nextState
Parameters:
- const __int8 state pointer
- const bool bit : input bit pointer
- const __int8 decoded : decoded message pointer
- const __int8 nextState pointer
*/
void logLevel(const __int8& state, const bool& bit,
const __int8& decoded, const __int8& nextState);
};
#endif