Codes, Numbers and Strings

A code is just a string of symbols to which each symbol has assigned some special meaning. Some codes we are familiar with include languages, number systems, Morse code, zip codes, hot keys on a computer, etc. Meanings for various codes can be found in tables or dictionaries.

A particularly important code is the number. Each symbol is a digit. The base of the number system determines the number of possible values for a digit. Some common bases are 2, 8, 10, and 16. Counting in a number system always proceeds by incrementing the least significant digit. A digit advances from its maximum value back to zero by generating a carry to the digit on its left. Thus 011 is followed by 100 in base 2 as the next units value is 0 with a carry, the second digit receives a carry and increments from its maximum value to zero again with a carry and the third digit then receives the carry and increments to 1.

How many codes are there for a given base B of length N? What is the maximum value of a number in this set of codes? How many 4-letter words are there in the English language (from AAAA to ZZZZ)? Multiplication rule for counting

A code is often times subdivided into substrings called fields. Each field would then have its own interpretation rule. We would then need to specify the length, position, and meanings of all the fields. The specification would be known as a format. The IEEE 754 Standard incorporates one such format for representing signed floating point decimals. Another format is the American Standard Code for Information Interchange (ASCII). It represents each character with a 7-bit code giving 27 or 128 possible combinations. As computers typically move data along on busses that are a multiple of 8, this format leaves the upper bit in position 7 unused. This upper bit was often used as a parity bit for error checking.

Computers interpret codes as signals propagated along wires and through various electronic devices. The waveform of a typical digital signal has one of two possible levels or values. One signal level represents a binary 1 and the other represents a binary 0. These discrete signals transition during very short periods denoted by the leading and trailing edges of the signal. Each signal is normally in a quiescent state. For a relatively short time it is activated. During this activation or assertion it is called a pulse and has a measurable pulse width or duration. A pulse is commonly used within a computer to initiate an event. It may be used to cause a device to sample other signals. So for the duration of the activation pulse a device may sample the signal. Most computer devices sample the values of several (N) signals on N different wires at once, known as parallel sampling. The same N-bit code could be transferred on a single wire by sampling the signal N successive times. The latter represents a serial bit string. One is invariably faced with a time versus hardware tradeoff.

BACK