0.4.3 What is Binary?
The digital world is all ones and zeros. By placing ones and zeros in a standardized
pattern we can encode data that can be exchanged between multiple devices. The lowest
level of encoding data is “binary notation”. In this notation, a “bit” represents the “true”
or “false” presence of the numeric value at that bit location. Therefore, if the bit
representing a “4” was “true”, one would add the “4” to the total of the “byte” (the total
size of the number). For our systems and the character-set we are using, we have an “8-
bit” byte (meaning there are 8 value “places” representing numbers that are added to each
other to generate the final number which the “byte” represents).
There are two ways to notate and send binary data – LSB and MSB. These stand for
“Least Significant Bit” and “Most Significant Bit” respectively, and these labels refer to
which bit in a given byte is sent first (basically this means that data can be notated left to-
right or right-to-left – and the data can be sent with the largest value first, or the smallest
value first). In this document, we will use the standard of notating MSB 8-bit bytes for
sentence (string) construction (largest-to-smallest, left-to-right), and LSB for the
communication scheme (RS-232/IR standards).
As an example, the decimal (“0-9”, “10-19”, etc.) notation number of “65” is:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Value = 128 Value = 64 Value = 32 Value = 16 Value = 8 Value = 4 Value = 2 Value = 1
0
1
0 0 0 0 0
1
If you add: 64 + 1, you get “65”. This is the basis for all future dialog within this guide.
0.4.4 What is HEX?
So you’re probably saying “It’s going to take me forever to figure out how to send
Binary data from a PC to an iScan,” or “Boy, do I have to learn binary notation to use the
iScan Automation Protocol?” Well the short answer is “no”, you will want this basic
ground-work to understand that electronic devices communicate this way – but there is a
short-hand for Binary which you
will need to learn. It reduces the characters you have to
type by ¼ (thus you would type only two characters instead of eight to represent an “8-bit
byte”). This is the HEX Notation. HEX is a different “base” number set – where
“binary” has two possibilities for each character (0 and 1), the very familiar “Decimal”
has ten possibilities (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), and “Hexadecimal” (or “HEX” for short)
has 16 possibilities (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A(10), B(11), C(12), D(13), E(14), F(15)).
This “shorthand” was selected since decimal doesn’t easily calculate into binary (where
each additional bit is a multiplier of two of the previous bit). With HEX, each character
represents a “nybble” of a byte (or four bits). Each “byte” is split into two “nybbles” (a
high nybble and a low nybble), so that a byte can be conveyed using the same MSB
notation with fewer characters to mean the same thing, in a terminal application which
accepts HEX.
9