IB-COM
40
Converting bits to bytes
Some DCC decoders do not accept the “bit-wise” programming mode. When programming
a single bit of a configuration variable it could be necessary to convert the 8 bits of a CV to
a complete byte.
CV
Address
Bit
0
Bit
1
Bit
2
Bit
3
Bit
4
Bit
5
Bit
6
Bit
7
0
0 0 0 0 0 0 0 0
1
1
0
0
0
0
0
0
0
2
0 1 0 0 0 0 0 0
3
1
1
0
0
0
0
0
0
4
0 0 1 0 0 0 0 0
5
1
0
1
0
0
0
0
0
6
0 1 1 0 0 0 0 0
7
1
1
1
0
0
0
0
0
8
0 0 0 1 0 0 0 0
9
1
0
0
1
0
0
0
0
10 0 1 0 1 0 0 0 0
11
1
1
0
1
0
0
0
0
12 0 0 1 1 0 0 0 0
13
1
0
1
1
0
0
0
0
14 0 1 1 1 0 0 0 0
15
1
1
1
1
0
0
0
0
16 0 0 0 0 1 0 0 0
17
1
0
0
0
1
0
0
0
18 0 1 0 0 1 0 0 0
19
1
1
0
0
1
0
0
0
20 0 0 1 0 1 0 0 0
21
1
0
1
0
1
0
0
0
22 0 1 1 0 1 0 0 0
23
1
1
1
0
1
0
0
0
24 0 0 0 1 1 0 0 0
25
1
0
0
1
1
0
0
0
26 0 1 0 1 1 0 0 0
27
1
1
0
1
1
0
0
0
28 0 0 1 1 1 0 0 0
29
1
0
1
1
1
0
0
0
30 0 1 1 1 1 0 0 0
31
1
1
1
1
1
0
0
0
32 0 0 0 0 0 1 0 0
33
1
0
0
0
0
1
0
0
34 0 1 0 0 0 1 0 0
35
1
1
0
0
0
1
0
0
36 0 0 1 0 0 1 0 0
37
1
0
1
0
0
1
0
0
38 0 1 1 0 0 1 0 0
39
1
1
1
0
0
1
0
0
40 0 0 0 1 0 1 0 0
41
1
0
0
1
0
1
0
0
42 0 1 0 1 0 1 0 0
43
1
1
0
1
0
1
0
0
44 0 0 1 1 0 1 0 0
45
1
0
1
1
0
1
0
0
46 0 1 1 1 0 1 0 0
47
1
1
1
1
0
1
0
0
48 0 0 0 0 1 1 0 0
49
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103
1
1
1
0
0
1
1
0
104 0 0 0 1 0 1 1 0
105
1
0
0
1
0
1
1
0
106 0 1 0 1 0 1 1 0
107
1
1
0
1
0
1
1
0
108 0 0 1 1 0 1 1 0
109
1
0
1
1
0
1
1
0
110 0 1 1 1 0 1 1 0
111
1
1
1
1
0
1
1
0
112 0 0 0 0 1 1 1 0
113
1
0
0
0
1
1
1
0
114 0 1 0 0 1 1 1 0
115
1
1
0
0
1
1
1
0
116 0 0 1 0 1 1 1 0
117
1
0
1
0
1
1
1
0
118 0 1 1 0 1 1 1 0
119
1
1
1
0
1
1
1
0
CV
Address
Bit
0
Bit
1
Bit
2
Bit
3
Bit
4
Bit
5
Bit
6
Bit
7
120 0 0 0 1 1 1 1 0
121
1
0
0
1
1
1
1
0
122 0 1 0 1 1 1 1 0
123
1
1
0
1
1
1
1
0
124 0 0 1 1 1 1 1 0
125
1
0
1
1
1
1
1
0
126 0 1 1 1 1 1 1 0
127
1
1
1
1
1
1
1
0
128 0 0 0 0 0 0 0 1
129
1
0
0
0
0
0
0
1
130 0 1 0 0 0 0 0 1
131
1
1
0
0
0
0
0
1
132 0 0 1 0 0 0 0 1
133
1
0
1
0
0
0
0
1
134 0 1 1 0 0 0 0 1
135
1
1
1
0
0
0
0
1
136 0 0 0 1 0 0 0 1
137
1
0
0
1
0
0
0
1
138 0 1 0 1 0 0 0 1
139
1
1
0
1
0
0
0
1
140 0 0 1 1 0 0 0 1
141
1
0
1
1
0
0
0
1
142 0 1 1 1 0 0 0 1
143
1
1
1
1
0
0
0
1
144 0 0 0 0 1 0 0 1
145
1
0
0
0
1
0
0
1
146 0 1 0 0 1 0 0 1
147
1
1
0
0
1
0
0
1
148 0 0 1 0 1 0 0 1
149
1
0
1
0
1
0
0
1
150 0 1 1 0 1 0 0 1
151
1
1
1
0
1
0
0
1
152 0 0 0 1 1 0 0 1
153
1
0
0
1
1
0
0
1
154 0 1 0 1 1 0 0 1
155
1
1
0
1
1
0
0
1
156 0 0 1 1 1 0 0 1
157
1
0
1
1
1
0
0
1
158 0 1 1 1 1 0 0 1
159
1
1
1
1
1
0
0
1
160 0 0 0 0 0 1 0 1
161
1
0
0
0
0
1
0
1
162 0 1 0 0 0 1 0 1
162
1
1
0
0
0
1
0
1
164 0 0 1 0 0 1 0 1
165
1
0
1
0
0
1
0
1
166 0 1 1 0 0 1 0 1
167
1
1
1
0
0
1
0
1
168 0 0 0 1 0 1 0 1
169
1
0
0
1
0
1
0
1
170 0 1 0 1 0 1 0 1
171
1
1
0
1
0
1
0
1
172 0 0 1 1 0 1 0 1
173
1
0
1
1
0
1
0
1
174 0 1 1 1 0 1 0 1
175
1
1
1
1
0
1
0
1
176 0 0 0 0 0 1 0 1
177
1
0
0
0
0
1
0
1
178 0 1 0 0 0 1 0 1
179
1
1
0
0
0
1
0
1
Содержание IB-COM
Страница 1: ...The Digital Center for PC Manual...
Страница 37: ...IB COM 37 Appendix...