5 digital data and binary code, Mc_rack manual 96 – Multichannel Systems MC_Rack Manual User Manual
Page 102

MC_Rack Manual
96
4.3.5 Digital Data and Binary Code
Only two voltage levels are allowed as an input of the 16 digital channels: 0 Volts or 5 Volts.
This means, that each channel can have either the state high (5 Volts), also called 1 or On, or low
(0 Volts), also called 0 or Off. For example, if you use the Sync Out of a stimulus generator (STG)
or another external device to trigger the recording, you can connect the device to one of the
16 digital channels. When the device is active, it sends a 5 V signal and the bit of the
corresponding channel is high. This event can be used as a trigger (see Trigger Detector) for
recording, or for triggering displays or analyzers.
For special advanced applications, it is also possible to encode more complex information from
external devices in binary code. Because a single bit can only store two values, bits are combined
together into large units in order to hold a greater range of values. Each bit combination encodes
a decimal number. (Decimal numbers are the numbers we usually use in daily life.) The more bits
you have, the more information you can encode. The number of possible values is 2 to the powers
of N, where N is the number of bits.
If a bit is Low, its decimal weight value is 0. If it is High, the bit has a decimal weight value
according to its position (see following table). The first bit has the number 0, and its decimal
value is 1 if it is high. Each following bit doubles the decimal weight value of the preceding bit.
This means, the decimal weight value of a bit is 2 to the powers of N, where N is the bit number.
Mathematical convention sets out binary numbers with the lowest significant bit (the bit with the
least value) on the right and with the highest significant bit (the bit with the greatest value) on
the left (in analogy to the arabic decimal number system, which is also written from right to left).
The total decimal value of all 16 bits results from adding up the single values.
Bit
15 14 13 12 11 10 9 8 7 6
5
4
3
2
1
0
2
15
2
14
2
13
2
12
2
11
2
10
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
Decimal
value
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
For example, if you had a 2-bit encoded number, the first bit would have a decimal weight value
of 2, and the second bit of 1. This gives the possible decimal numbers shown in the following
table.
Binary number
Decimal number
00 0
(0+0)
01 1
(0+1)
10 2
(2+0)
11 3
(2+1)
Accordingly, for 16 bits, there are 65,536 possible values, that is, 65,536 different states that can
be defined. (Number 65,535 results if all 16 bits are High, 0 results if all bits are Low). For example,
if the digital input bit 0 is set to high, the binary 16-bit value of the Digital Data stream in
MC_Rack will be 0000000000000001, or 1 as a decimal number. If channel 2 is set to high,
the value is (binary) 0000000000000010, or (decimal) 2, and so on. Any combination of logical
states of input bits is represented by the 16-bit value.
Thus, you can use the digital data stream to retrieve and store encoded information from external
devices for your experiment. This information can be displayed with the Digital Display either
as a bit trace or as a decimal number. It can also be used to trigger events (see Trigger Detector).