<< Chapter < Page Chapter >> Page >
This module is part of the collection, A First Course in Electrical and Computer Engineering . The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

Perhaps the most fundamental idea in communication theory is that arbitrary symbols may be represented by strings of binary digits. These strings are called binary words, binary addresses, or binary codes. In the simplest of cases, a finite alphabet consisting of the letters or symbols s 0 , s 1 , ... , s M - 1 is represented by binary codes. The obvious way to implement the representation is to let the i t h binary code be the binary representation for the subscript i :

s 0 000 = a 0 s 1 001 = a 1 s 6 110 = a 6 s 7 111 = a 7 .

The number of bits required for the binary code is N where

2 N - 1 < M 2 N .

We say, roughly, that N = log 2 M .

Octal Codes. When the number of symbols is large and the corresponding binary codes contain many bits, then we typically group the bits into groups of three and replace the binary code by its corresponding octal code. For example, a seven-bit binary code maps into a three-digit octal code as follows:

0000000 000 0000001 001 0100110 046 101111 137 1111111 177 .

The octal ASCII codes for representing letters, numbers, and special characters are tabulated in Table 1 .

Octal ASCII Codes (from Donald E. Knuth, The TEXbook , ©1986 by the American Mathematical Society, Providence, Rhode Island p. 367, published by Addison-Wesley Publishing Co.)
'0 '1 '2 '3 '4 '5 '6 '7
'00x
'01x
'02x
'03x
'04x ! " # $ % & '
'05x ( ) * + , - . /
'06x 0 1 2 3 4 5 6 7
'07x 8 9 : ; < = > ?
'10x @ A B C D E F G
'11x H I J K L M N O
'12x P Q R S T U V W
'13x X Y Z [ \ ] ^ _
'14x ` a b c d e f g
'15x h i j k l m n o
'16x p q r s t u v w
'17x x y z { | } ~

Quantizers and A/D Converters. What if the source alphabet is infinite? Our only hope is to approximate it with a finite collection of finite binary words. For example, suppose the output of the source is an analog voltage that lies between - V 0 and + V 0 . We might break this peak-to-peak range up into little voltage cells of size 2 V M A and approximate the voltage in each cell by its midpoint. This scheme is illustrated in Figure 1 . In the figure, the cell C i is defined to be the set of voltages that fall between i M - M ¯ 2 ̲ V p V Δ and i 2 ̲ V M Δ + V M A :

C i = { V : i . 2 V 0 M - V 0 M < V i 2 V 0 M + V 0 M } .

The mapping from continuous values of V to a finite set of approximations is

Q ( V ) = i 2 V 0 M , if V C i .

That is, V is replaced by the quantized approximation i M 2 ̲ V 0 whenever V lies in cell C i . We may represent the quantized values i M 2 ̲ V 0 with binary codes by simply representing the subscript of the cell by a binary word. In a subsequent course on digital electronics and microprocessors you will study A / D (analog-to-digital) converters for quantizing variables.

A graph showing four quadrants. The center is labeled cell C_0 and the farthest points of the x and y axes in each direction are V_0. In the upper left quadrant is the expression 2V_0/M with and arrow point to the left towards a vertical line and the mirror of this to the right of it. Below this is C_-2. In the upper right quadrant there is the expression 2V_0/M with a similar arrow line figure to its left. This one is vertical and to the left there is the expression C_2. Proceeding from the lower right to the upper left there is a series of horizontal lines stair stepping up in along a positive slope. A graph showing four quadrants. The center is labeled cell C_0 and the farthest points of the x and y axes in each direction are V_0. In the upper left quadrant is the expression 2V_0/M with and arrow point to the left towards a vertical line and the mirror of this to the right of it. Below this is C_-2. In the upper right quadrant there is the expression 2V_0/M with a similar arrow line figure to its left. This one is vertical and to the left there is the expression C_2. Proceeding from the lower right to the upper left there is a series of horizontal lines stair stepping up in along a positive slope.
A Quantizer

If M = 8 , corresponding to a three-bit quantizer, we may associate quantizer cells and quantized levels with binary codes as follows:

V C - 3 V - 3 = ( - 3 ) 2 V 0 8 111 V C - 2 V - 2 = ( - 2 ) 2 V 0 8 110 V C - 1 V - 1 = ( - 1 ) 2 V 0 8 101 V C 0 V 0 = 0 000 V C 1 V 1 = ( 1 ) 2 V 0 8 001 V C 2 V 2 = ( 2 ) 2 V 0 8 010 V C 3 V 3 = ( 3 ) 2 V 0 8 011 .

This particular code is called a sign-magnitude code , wherein the most significant bit is a sign bit and the remaining bits are magnitude bits (e.g., 110 - 2 and 010 2 ). One of the defects of the sign-magnitude code is that it wastes one code by using 000 for 0 and 100 for-O. An alternative code that has many other advantages is the 2's complement code . The 2 ' s complement codes for positive numbers are the same as the sign-magnitude codes, but the codes for negative numbers are generated by complementing all bits for the corresponding positive number and adding 1:

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A first course in electrical and computer engineering. OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10685/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?

Ask