CPE 315/353
Prof. Stearns
Telephone Story


Once upon a time, Prof. Stearns lived in a small town that used an old telephone system. There were only 100 phone numbers; the telephones were only capable of dialing 2 digit numbers.

One day, the town needed to expand to 3 digit numbers; the telephone address space was no longer sufficient.
The town couldn't afford to buy a new phone system so a clever resident designed the following system.

Each area (uptown and downtown) has 100 assigned phone numbers. An uptown person who desires to telephone a downtown person must walk to the red phone and dial their number.
A downtown person who desires to telephone an uptown person must walk to the yellow phone and dial their number - 100.


A smart computer scientist proposed another idea. Create a table, in the central office, for each telephone. The table maps the dialed number to the real phone number; the real phone number can be any number of digits even though only 2 digits are dialed.

This method requires no changes to the telephones nor to the phone wires.

An example table is shown below; each table contains upto 100 entries depending on how many numbers the customer uses.
A customer dials the virtual number and is connected to the real number.
Note the address space for an individual customer is still 100 but the system, as a whole, is capable of handling more numbers.

Telephone Mapping Table
(one table per telephone)
Virtual number Real number
00 00
01 145
02 26
03 103
04 04
05 99
06 34
07 187

Note: the virtual number doesn't need to be stored since they are in consecutive order. The position (index) in the table is the virtual number.


Last updated on 2/1/05