|
I'm not going into a lot of detail on why computers use different coding schemes. Just accept the fact that they do. Binary ("0"s and "1"s) is used internally for operating efficiency. For computing efficiency there simply is no comparison between binary and the other options. But binary needs to be translated for "eyeball consumption" and that usually takes decimal form. But decimal comes up short for some usage, i.e., how do you represent the value of 255 with just two decimal characters? Answer: You can't, but you can do it with two hexadecimal characters, "FF" or "ff." And so, IBM and most computers today use binary for internal operations, decimal for user output (monitors and printers), and HEXADECIMAL for technicians (programmers). A few years ago, RCA made computers that used binary, decimal, and octal.... Go figure. Binary Decimal Hexadecimal Octal
The EBCDIIC Coding Scheme BINARY Numbers, Base 2: "Binary" literally means "two" or two by two. Or: Compounded, consisting of, or characterized by two. Therefore, in binary, 0 = 0 (none), 1 = 1, and that's it for the rightmost character. Move left one position (to what we call the "tens position" in decimal) and the same representation of 0 and 1 doubles in value: 0 = 0, 1 = 2. Now, move left one more position (to the hundreds) and the value doubles again: 0 = 0, 1 = 4. Now, if I wanted to write a three character number, i.e., 111, the value would be 7 in decimal. Here's why: The rightmost 1 has a value of 1, the middle 1 has a value of 2, and the leftmost 1 has a value of 4. I wrote 111. Therefore, it is: 111 binary, 1 + 2 + 4 = 7, decimal. See? Here's another three digit binary number: 100. The value is 4. See why? Another three digit number could be: 010, value is 2 decimal. Of course, you could write a three digit binary number of 000, value = 0 decimal. Just as in decimal, there is virtually no limit to how large you can make the binary number; you just have to keep doubling the value. Remember, in the decimal system (base 10) you keep upping the value of each left or leading number by ten. Ergo, in binary, base 2, you double each position. As was mentioned, modern computers had a need for one more bit in each character position and so the byte size was expanded to 9 bits. However, that did NOT change the integrity of the 8-bit ASCII coding used for the alphabet, special characters (#,$,%...), and simple number representation. Internally memory and storage space is logically processed in 8-bit chunks plus one parity bit and under certain conditions the information has to be displayed for eyeball consumption. For example, 10000000 = 128, and 11111111 = 255.
Notice, 128 or 255 is the sum of all the bits to produce the byte's value. The logic that applies if you are chopping computer memory into byte size chunks and want to display it for two contiguous bytes:
However, if you are stringing the bits out (bit strings) longer than byte size, then value-doubling described for BINARY applies beyond the 8th or left-most bit. Ergo, a bit string: (2)1111111111 (binary value) would = 2048 (decimal) and span two bytes. A HEX dump of the two bytes would be: One last point: In base-2 systems the highest decimal value possible in one position is 1. Therefore, 1 plus 1 equal 0 with 1 carry, just like in decimal when adding 1 to 9. With that in mind follow this: 01 binary plus 01 binary [ (2)01 + (2)01 ] = 10 binary OR 2 decimal. See? |
All commercial-use rights reserved. For details and contact information see Copyright Notice. Permission for student, teacher and classroom use is granted. |