4.1 Binary Numbers and ASCII

In many situations involving computers, it is more natural to represent data as strings of 0s and 1s, rather than as letters and numbers.

Numbers can be converted to binary (or base 2), if desired, which we’ll quickly review. Our standard way of writing numbers is in base 10. For example, 123 means 1×102+2×101+3. Binary uses 2 in place of 10 and needs only the digits 0 and 1. For example, 110101 in binary represents 25+24+22+1 (which equals 53 in base 10).

Each 0 or 1 is called a bit. A representation that takes eight bits is called an eight-bit number, or a byte. The largest number that 8 bits can represent is 255, and the largest number that 16 bits can represent is 65535.

Often, we want to deal with more than just numbers. In this case, words, symbols, letters, and numbers are given binary representations. There are many possible ways of doing this. One of the standard ways is called ASCII, which stands for American Standard Code for Information Interchange. Each character is represented using seven bits, allowing for 128 possible characters and symbols to be represented. Eight-bit blocks are common for computers to use, and for this reason, each character is often represented using eight bits. The eighth bit can be used for checking parity to see if an error occurred in transmission, or is often used to extend the list of characters to include symbols such as ü and è .

Table 4.1 gives the ASCII equivalents for some standard symbols.

Table 4.1 ASCII Equivalents of Selected Symbols

A table shows ASCII Equivalents of Selected Symbols. It depicts various symbols and each symbol contains decimal and binary numbers.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.118.229