< previous page page_9 next page >

Page 9
(text box continued from previous page)
the digits 0 through 9.) The word bit (short for binary digit) often is used to refer to a single 1 or 0. So the pattern 1101000110 has 10 bits. A binary number with 10 bits can represent 210(1024) different patterns. A byte is a group of 8 bits; it can represent 28 (256) patterns. Inside the computer, each character (such as the letter A the letter g, or a question mark) is usually represented by a byte. Four bits, or half of a byte, is called a nibble or nybblea name that was originally proposed with tongue in cheek but is now standard terminology. Groups of 16, 32, and 64 bits are generally referred to as words (although the terms short word and long word are sometimes used to refer to 16-bit and 64-bit groups, respectively).
The process of assigning bit patterns to pieces of data is called codingthe same name we give to the process of translating an algorithm into a programming language. In the early days of computers, programming meant translating an algorithm into patterns of 1s and 0s because the only language the first computers could work with was binary in form.
Binary coding schemes can be used to represent both the instructions that the computer follows and the data that it uses. For example, 16 bits can represent the decimal integers from 0 to 216-1 (65535). More complicated coding schemes are necessary to represent negative numbers, real numbers, and numbers in scientific notation. Characters also can be represented by bit combinations. In one coding scheme, 01001101 represents M and 01101101 represents m.
The patterns of bits that represent data and instructions vary from one computer to another. Even on the same computer, different programming languages can use different binary representations for the same data. A single programming language may even use the same pattern of bits to represent different things in different contexts. (People do this too. The four letters that represent the word tack have different meanings depending on whether you are talking about upholstery, sailing, sewing, paint, or horseback riding.) The point is that patterns of bits by themselves are meaningless. It is the way in which the patterns are used that gives them their meaning.
Fortunately, we no longer have to work with binary coding schemes. Today the process of coding is usually just a matter of writing down the data in letters, numbers, and symbols. The computer automatically converts these letters, numbers, and symbols into binary form. Still, as you work with computers, you will continually run into numbers that are related to powers of 2numbers like 256, 32768, and 65536 reminders that the binary number system is lurking somewhere nearby.

What Is a Programming Language?
In the computer, all data, whatever its form, is stored and used in binary codes, strings of 1s and 0s. When computers were first developed, the only programming language available was the primitive instruction set built into each machinethe machine language, or machine code.

 
< previous page page_9 next page >