Bits and Bytes of Info...

Binary

Computers use two states of activity, on and off. Represented arithmetically, they are 1 and 0 respectively. Having only two possible states to exist in, it is termed a binary system.

The state of the computer's activity is the value of a bit of information in a computer. So, a bit can be on (1) or off (0).

When several bits are joined together, it is called a byte. Often the number of bits is added onto the word 'byte' to differentiate it from other bytes of a bigger size. For example, a 4-bit byte can be represented by any of the following:


0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.

In all, there are sixteen combinations. As with base 10 or decimal numbers, the rightmost digit is the smallest number, the same is true for binary numbers as it is in base 2. Since there are four bits in each of the above numbers, there are a maximum of 24 or 2 x 2 x 2 x 2 combinations, which is of course 16. An 8-bit byte has a maximum of 24 = 256 combinations.

For a four bit byte,
binary 0000 is decimal 0,
binary 0001 is decimal 1,
binary 0010 is decimal 2,
binary 0011 is decimal 3,
binary 0100 is decimal 4,
binary 0101 is decimal 5,
binary 0110 is decimal 6,
binary 0111 is decimal 7,
binary 1000 is decimal 8,
binary 1001 is decimal 9,
binary 1010 is decimal 10,
binary 1011 is decimal 11,
binary 1100 is decimal 12,
binary 1101 is decimal 13,
binary 1110 is decimal 14,
binary 1111 is decimal 15

That is,
binary [23][22][21][20] is decimal [8][4][2][1]

For binary 1111 we would have decimal 8 + 4 + 2 + 1 = 15. So if we converted these 4-bit binary numbers they would have a decimal equivalent, ranging from 0 to 15 inclusively, that is, sixteen numbers in all.

This can be extended for any number of bits as following binary arithmetic.
binary [27][26][25][24][23][22][21][20] is decimal [128][64][32][16][8][4][2][1]

Notice that from the right, the first bit is the lowest bit, whilst the highest bit of the eighth bit of the eight bit byte.

Octal

Another popular number base when talking about computers is a base 8 or Octal number system. The digits this time can exist in eight states, 0, 1, 2, 3, 4, 5, 6, and 7.

Octal [83][82][81][80] is decimal [512][64][8][1]

So, Octal 7124 = decimal (7 x 512) + (1 x 64) + (2 x 8) + (4 x 1) = decimal 3668

Hexadecimal

On a similar bent, each digit of base 16 or Hexadecimal can exist in one of sixteen states, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The letters are used because in our written orthography, there just aren't enough digits to cover the sixteen numbers as a single digit. Therefore, A=10, B=11, C=12, D=13, E=14, F=15, together with the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, there are sixteen individual numbers.

hexadeciaml [163][162][161][160] is decimal [65536][256][16][1]

A two digit Hexadecimal number 9F = decimal (9 x 16) + (F x 1) = (9 x 16) + (15 x 1) = decimal 159.

ASCII

American Standard Code for Information Interchange (ASCII)
used by most PC's, originally contained a character set of 128 unique characters, that is, it was a 7-bit code.
Later it was expanded into the Extended ASCII set which contains 256 unique characters, an 8-bit code. Most of the 7 bit characters found on the keyboard, but there are a number which were reserved as instructions for the computer itself. The extended character set, is accessible using a sequence of keys from the keyboard. (Usually holding the ALTertnate key down whilst using the numberpad to enter a decimal number). ALT 232 yields Þ an Icelandic capital Thorn (sound th- as in thank) on my computer, you may see it differently.

Seven Bit Characters

These are represented by the first 128 alloted characters in the ASCII set.

ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec
  0  1  2  3  4  5  6  7
 8 9 10 11 12 13  14  15
 16  17  18  19  20  21  22  23
 24  25  26  27  28  29  30  31
32 ! 33 " 34 # 35 $ 36 % 37 & 38 ' 39
( 40 ) 41 * 42 + 43 , 44 - 45 . 46 / 47
0 48 1 49 2 50 3 51 4 52 5 53 6 54 7 55
8 56 9 57 : 58 ; 59 < 60 = 61 > 62 ? 63
@ 64 A 65 B 66 C 67 D 68 E 69 F 70 G 71
H 72 I 73 J 74 K 75 L 76 M 77 N 78 O 79
P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87
X 88 Y 89 Z 90 [ 91 \ 92 ] 93 ^ 94 _ 95
` 96 a 97 b 98 c 99 d100 e101 f102 g103
h104 i105 j106 k107 l108 m109 n110 o111
p112 q113 r114 s115 t116 u117 v118 w119
x120 y121 z122 {123 |124 }125 ~126 127

Eight bit Characters

These are the remaining 128 characters of the ASCII set.

ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec ASCII Dec
128 129 130 ƒ131 132 133 134 135
ˆ136 137 Š138 139 Œ140 141 Ž142 143
144 145 146 147 148 149 150 151
˜152 153 š154 155 œ156 157 ž158 Ÿ159
 160 ¡161 ¢162 £163 ¤164 ¥165 ¦166 §167
¨168 ©169 ª170 «171 ¬172 ­173 ®174 ¯175
°176 ±177 ²178 ³179 ´180 µ181 182 ·183
¸184 ¹185 º186 »187 ¼188 ½189 ¾190 ¿191
À192 Á193 Â194 Ã195 Ä196 Å197 Æ198 Ç199
È200 É201 Ê202 Ë203 Ì204 Í205 Î206 Ï207
Ð208 Ñ209 Ò210 Ó211 Ô212 Õ213 Ö214 ×215
Ø216 Ù217 Ú218 Û219 Ü220 Ý221 Þ222 ß223
à224 á225 â226 ã227 ä228 å229 æ230 ç231
è232 é233 ê234 ë235 ì236 í237 î238 ï239
ð240 ñ241 ò242 ó243 ô244 õ245 ö246 ÷247
ø248 ù249 ú250 û251 ü252 ý253 þ254 ÿ255

As can be seen above, 7-bit ascii consists mainly those characters which can be accessed via the keyboard - the alphanumerics and various punctuation and symbolics. In the extended ascii set, we see a lot of characters belonging to accented characters and characters used in other orthographies, such as German, French and Icelandic.


Double Byte Characters

Double Byte Characters (DBC) are composed mostly of at least one 8-bit character. They are the basis of encodings for the written languages of Chinese, Japanese, Korean etc.
Flux Index

© Dylan W.H. Sung

This page was created on Friday 15th October 1999.
It was last updated on Thursday 7th December 2000.