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.
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.
| 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.