Instructor: Joel E. Tohline
tohline@rouge.phys.lsu.edu
Binary Representation of Selected 8-bit Integers | ||||||||
---|---|---|---|---|---|---|---|---|
Integer [byte] |
Binary | HEX | ASCII equivalent |
EBCDIC equivalent |
If bgcolor = HEX | |||
R | G | B | RGB | |||||
0 |
0000 0000 |
00 |
CTRL-@ |
--- |
000000 | 000000 | 000000 | 000000 |
1 |
0000 0001 |
01 |
CTRL-a |
--- |
010000 | 000100 | 000001 | 010101 |
2 |
0000 0010 |
02 |
CTRL-b |
--- |
020000 | 000200 | 000002 | 020202 |
3 |
0000 0011 |
03 |
CTRL-c |
--- |
030000 | 000300 | 000003 | 030303 |
4 |
0000 0100 |
04 |
CTRL-d |
--- |
040000 | 000400 | 000004 | 040404 |
5 |
0000 0101 |
05 |
CTRL-e |
[Horiz. Tab] |
050000 | 000500 | 000005 | 050505 |
6 |
0000 0110 |
06 |
CTRL-f |
[Lower Case] |
060000 | 000600 | 000006 | 060606 |
7 |
0000 0111 |
07 |
CTRL-g |
[DEL] |
070000 | 000700 | 000007 | 070707 |
. |
. |
. |
||||||
127 |
0111 1111 |
7F |
DEL |
" |
7F0000 | 007F00 | 00007F | 7F7F7F |
Binary Representation of Selected 8-bit Integers | ||||||||
---|---|---|---|---|---|---|---|---|
Integer [byte] |
Binary* | HEX | ASCII equivalent |
EBCDIC equivalent |
If bgcolor = HEX | |||
R | G | B | RGB | |||||
-128 |
1000 0000 |
80 |
--- |
--- |
800000 | 008000 | 000080 | 808080 |
. |
. |
. |
||||||
-8 |
1111 1000 |
F8 |
--- |
8 |
F80000 | 00F800 | 0000F8 | F8F8F8 |
-7 |
1111 1001 |
F9 |
--- |
9 |
F90000 | 00F900 | 0000F9 | F9F9F9 |
-6 |
1111 1010 |
FA |
--- |
--- |
FA0000 | 00FA00 | 0000FA | FAFAFA |
-5 |
1111 1011 |
FB |
--- |
--- |
FB0000 | 00FB00 | 0000FB | FBFBFB |
-4 |
1111 1100 |
FC |
--- |
--- |
FC0000 | 00FC00 | 0000FC | FCFCFC |
-3 |
1111 1101 |
FD |
--- |
--- |
FD0000 | 00FD00 | 0000FD | FDFDFD |
-2 |
1111 1110 |
FE |
--- |
--- |
FE0000 | 00FE00 | 0000FE | FEFEFE |
-1 |
1111 1111 |
FF |
--- |
--- |
FF0000 | 00FF00 | 0000FF | FFFFFF |
*All of the integer data types in Java
[byte, short, int, long] are "signed two's complement integers."
This means that the integer minus one (-1)
is represented by setting all binary bits to "1"
(for example, for the "byte" data type illustrated in this table,
the binary representation of minus one is 1111 1111)
then all other negative integers are obtained by
subtracting 1 from the previous negative number, in succession. With this "two's complement" convention:
|