QUOTE: "If bit 3 is set, the decimal value is 8."
I'll use an example to try to explain this statement. Sorry, but I
don't know what "This parameter" is. It sounds like they are referring
to something specific to what you are reading.
Example:
A bit is either a zero or a one. A byte is made up of multiple bits.
Let's say you have an 8 bit byte. The "binary" value of a number is
only going to be represented by zero's and one's. The "decimal" value
is what everyone is used to dealing with (ie. 1, 2, 3, ..., 10, 11, 12,
...., 20, 21, 22, ..., etc). Here are some examples of binary number
and their decimal equivalents.
BINARY DECIMAL
-------------------- --------------
00000000 0
00000001 1
00000010 2
00000011 3
00000100 4
00000101 5
00000110 6
00000111 7
00001000 8
The way binary works is just like the way decimal numbers work except
that you can only go as high as 1 before you have to add one to the
next number to the left, whereas in decimal you can go to 9. What I
mean is that you could represent your decimal numbers with zeros to the
left as well, but once you reach 9, you need to add 1 to the number to
the left.
For example:
7 can be represented as 00000007
8 can be represented as 00000008
9 can be represented as 00000009
but when you reach the next number you have to add one to the number to
the left and start over at zero with the ones digit.
10 would then be 00000010
In the binary example above, 00001000, the one would be in the 3rd
place (or bit 3). Java's bitwise starts counting the binary digits at
zero. So, the first zero starting from the right is bit 0, the second
zero from the right is bit 1, the third zero from the right is bit 2,
and the 1 then is a bit 3.
Sorry, if I didn't expain this very well. Maybe Roedy's link will
explain it better.
Troy