The basic unit of information that computers work with is called a "Binary digIT" - almost always known as a "bit". One bit on it's own can represent the values '0' or '1' (or 'off' or 'on') (or 'yes' or 'no'). For pretty well all purposes they are referred to as '0' and '1'.
Inside the computer these values are represented by two different electrical voltages. But mostly, when the computer takes in or puts out data, they are represented in a different way. This is because these electrical voltages don't travel very far down wires, you can't put them onto disks and of course they mean fuck all to humans!
So for sending down phone lines etc, they have to be converted into sounds similar to tone dialling in a telephone. For storing on disks, which are basically the same material as audio tape, they have to be converted into something similar to sound, but higher pitched. And of course, for communicating with people they get converted to and from text (via keyboard, screen and printer), graphics or sounds.
When the computer is working with text (letters, numbers etc) it's represented by groups of bits. Each character has its own code and it's these codes that the computer actually manipulates.
Ascii codes are made up of 7 bits. There are 128 possible combinations of 7 bits. Therefore, standard ascii has 128 characters. This includes 10 digits (0-9), 26 capital letters and 26 lower case letters, as well as the other normal symbols you find on a keyboard, e.g. &,$,!,@ etc. The rest of the character set consists of control characters which are used for special (and often different) purposes by software.
It's important to bear in mind that these characters have no significance whatever to the hardware, which always works with the binary codes for them and never sees anything other than collections of 1s and 0s.
The next most basic unit of information that computers work with is called a "byte". A byte is a group of 8 bits. there are 256 possible combinations of 8 bits. A byte can be viewed as a number and its maximum value can be 255 (as one of the combinations equals zero). That is a byte can have any value from 0-255.
As the byte is a pretty well universal form of data, this means that if you use a byte for each character (which is normal) you *could* have 256 characters instead of the 128 which ascii has. IBM-type computers make use of this possibility by having an extended form of ascii which allows an extra 128 characters. However, as not all computers use the whole 256 characters and the ones that do use the extra 128 in different ways, this extended code isn't a lot of use for communicating with other computers.
The extra 128 characters are known as IBM codes and it's best to avoid using them in a network setup.
It's important to remember that bytes are used to represent other things than characters too. Computer programs are stored in exactly the same format. Only here, the bytes represent the codes for processor operations and addresses of data and software. As well as this, they can also be used to represent their numerical value for mathematical operations within the computer. It's also possible to allocate an on/off meaning to each bit and this could be used to convey all sorts of things from one bit of software to another.
So if you try and look at a software file as if it was a text file, you'll get completely meaningless nonsense. Or if you try and get the computer to run a text file as if it was software, completely unpredictable things will happen and the computer will almost certainly crash.
In the system used by DOS for naming files, this is taken care of to a certain extent. DOS file names have the form: <filename>.<extension>
e.g: thisfile.txt
'thisfile' is its name and 'txt' (the extension) indicates what type of file it is. txt = text (that is, straight ascii usually).
other file types inclued:
The last three will need to be uncompressed with the correct uncompression program.
For text files it's always best to use an extension of .txt or .asc , although you will find text files with all sorts of extensions.
In decimal notation this means the value of the digits (from right to left) is as follows:
1s, 10s, 100s, 1000s, 10000s etc
In binary notation the values are:
1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s etc
Put the right way round, that means:
128, 64, 32, 16, 8, 4, 2, 1
That is what the eight bits of a byte represent.
10110010 = 128+32+16+2 = 178
I'm afraid that's as good as i can explain it. If it doesn't make sense, you'll have to keep trying or get someone else to explain it differently. It's important to understand this stuff, although it's possible to get by without it. The more of these basics you understand, the easier it will be to sort out problems later.
And if you thought that was weird, have a look at this:
In the way that in decimal each digit can have values from 0-9, in hexadecimal each digit can have a value from 0-15. The digits from 10-15 are represented by the letters A-F. So the complete range of hex digits is:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f.
Right, what's all this got to do with binary? Well, if you group binary values in chunks of four bits, each four bits can have 16 different combinations and therefore numerically can represent values from 0-15. The same as each hex digit! Hey!
Therefore, a byte can either be represented as 8 binary digits or 2 hex digits. Or, of course, 3 decimal digits. As hex is more handy than binary, while still being really easy to convert to binary, and decimal is really difficult to convert to binary, hex is very commonly used in all fields of computing.
Here are the binary and decimal equivalents of the 16 hex digits:
binary hex dec ------ --- --- 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7 1000 8 8 1001 9 9 1010 A 10 1011 B 11 1100 C 12 1101 D 13 1110 E 14 1111 F 15
So 10110010 = B2 (hex) = 178 (decimal)
click here to go to chapter four