**3.1. PSA: A generalized model of fine-grain computations**

Conceptually PSA unites in itself a substitutional character of Markov's algorithm [12] and spatial parallelism of a cellular automaton [13] basing on an associative mechanism of application of operations, which is common to both of them. PSA represents a "true parallelism" of computations, when all the allowable operations are executed at each step for all the available data. The main idea of PSA is concluded in the following three statements:


"base" part of the found array is replaced by the array generated by the right part of the parallel substitution for the same cell name.

 The process of computations is iterative. At each iteration, all the substitutions applicable to the processed cellular array are executed. The computation is over when no substitutions applicable to the array obtained at the previous iteration were found. This array is the result of work of PSA.

62 Optical Communication

implementation.

The considered tools include:

parallel architectures;

of the characteristics from these models.

belongs to a certain finite alphabet *A*.

A detailed description of the cellular technology is given in [11].

**3.1. PSA: A generalized model of fine-grain computations** 

information an unlimited number of times;

transfer of information from one element to another can be done without loss of

 the use of threshold photodetectors allows reducing of the operating voltage and of energy required for switching a gate down to acceptable levels for microelectronic

Efforts to create optoelectronic circuits have given impetus to the development of algorithmic and software tools that aid in solution of the problem of design and study of 3D

These tools map a primordial parallel algorithm of a problem solution onto an architecture with a massive spatial-temporal parallelism. The orientation to constructing structures of models that consist of huge sets of rather simple and homogenous computing devices (cells),

 a formal model of fine-grain (cellular) computations, which is called the Algorithm of Parallel Substitutions (PSA) and which serves as the basis of a method for synthesis of

 a simulation system of parallel computational processes, which is used for the construction, debugging of models of 3D logical structures as well as for the extraction

Conceptually PSA unites in itself a substitutional character of Markov's algorithm [12] and spatial parallelism of a cellular automaton [13] basing on an associative mechanism of application of operations, which is common to both of them. PSA represents a "true parallelism" of computations, when all the allowable operations are executed at each step for all the available data. The main idea of PSA is concluded in the following three statements: The processed information is presented in the form of a cellular array, which is a set of cells. Each cell is data (a bit, a character, a number, etc.) with its name (its "location" within array, which is an element of a set of names *M*) in the array. A set of data

 The algorithm is defined by a set of parallel substitutions. They have left-hand and right-hand sides (left and right parts). The expression in the left part generates cellular arrays, one for each cell name in the processed cellular array. If processed arrays contain one or more such arrays, then the substitution is applicable. Its execution means that a certain "base" part of the found array generated by its right part is replaced by array generated by its left part for the same cell name. Its execution means that a certain

**3. The Cellular technology constructing 3D logical structures** 

mainly with local links, and placed in a 3D space is their basic property.

(multilayer) digital structures, focused on the use of optical interlayer connections.

Executing the substitution in the form of replacement of one cellular array by another permits representation of such replacement as replacement of one spatial image by another. This is rather essential for a visual construction of computer-aided model of optoelectronic logical structure and visual representation of computational process of such a model, which is distributed in time and space.

A formal description of PSA is presented in [14]. Let us demonstrate the idea of PSA by a simple example. Let us consider PSS for adding many non-negative binary numbers as a sample.

Let *A* = {0, l}, *M* = *N2*, *N* = {0, 1, 2, ...}. A transformed cellular array is a 2D rectangular table whose cells are numbered according to left coordinate system (*i* is abscissa, *j* is ordinata). The name of cell *m* is a pair of values *i, j*. The digits of numbers are kept in the strings of the table. The least significant bits occupy the right-most column. PSA consists of two parallel substitutions:

$$\Phi\_{\sigma} = \begin{cases} \Theta\_1^{\sigma} : \left\{ (1, \{i, j\}) (1, \{i, j+1\}) (0, \{i+1, j\}) \right\} \* \left\{ (0, \{i, j-1\}) (0, \{i+1, j-1\}) \right\} \to \\ \quad \left\{ (0, \{i, j\}) (0, \{i, j+1\}) (1, \{i+1, j\}) \right\} ; \\ \Theta\_2^{\sigma} : \left\{ (1, \{i, j\}) (0, \{i, j+1\}) \right\} \* \left\{ (0, \{i, j-1\}) \right\} \to \left\{ (0, \{i, j\}) (1, \{i, j+1\}) \right\} . \end{cases}$$

The left part of the substitution is to the left of the arrow, while its right part is to the right of the arrow. Shift functions are written in angle brackets in the definitions of substitutions . These functions set the location of cells of the left and right parts of a substitution as related to each other. A cell description is confined in parentheses. Cell states are shown to the left of commas. The "base" parts of the left parts of substitutions are at the left of asterisks. When particular values of the pair *i*, *j* are substituted into the shift functions, the cellular arrays associated with this name are obtained.

The description of substitutions allows their geometric representation depicted in Figure 4, a. In this case, the left and right parts of commands are defined by templates, and the search of occurrences of the left parts of substitutions is done by shifting their templates above cells of the table along axes. One step of transformation of the source table containing numbers 9, 15, 5 is presented in Figure 4, b. After carrying out four steps the result is placed in the top string, while the rest of them contain zeros.

The expressive capabilities of PSA augment if an alphabet *A* is extended by introduction of *variable* and *functional* symbols. An alphabet *A* serves as a domain for variables symbols and as a range for functional symbols. In the case of graphic representation of substitutions,

**Figure 4.** Cellular adder: a – graphic representation of PSA commands, b – one step of execution of algorithm

variable symbols can be written into cells of templates of the left part of substitution, while the functional symbols can be in the cells of the right part. Such a substitution is called *functional* substitution. When an alteration of a state is performed for a cell located in the processed array under a template cell of the right part of a certain command containing a functional symbol, it is not specific data from the template cell, but a result of evaluation of a certain function that is written into this cell. The states of cells in the processed array that are below the cells of a template of the left part can be arguments of such functions. Using the functional substitutions helps: a) in reducing PSA notation to a considerably more concise form in theoretical issues, b) in practical issues to represent rather complicated devices such as ALU by a single cell.

#### **3.2. A simulation system of 3D digital structures**

#### *3.2.1. Overview of the system*

A physical and technical rationale for the construction of multilayer optoelectronic structures is given In Section 2. Evidently the construction of real 3D structures requires a large amount of work associated in the first place with selection of an optimal kind of structure from the standpoint of technical parameters among a big number of possible variants. A manual solution of such a task is virtually impossible. Thus, a computer-aided tool must be available for the research and development of models of 3D structures. Such an instrument was built and it is called WinALT [15]. The user's interface of the system coincides with the standard user's interface in Windows applications. A simulation model is represented by a project that contains a number of sub-windows. Each sub-window can hold graphic or text objects of a model. Creation and editing of graphic objects are carried out by means of toolbars, menus and dialog windows. The system is freely distributed. System's site [16] contains a section "installation", which includes manuals on installation, uninstallation and system's distributive package. An open architecture of the system enables the user to participate in extension of the system functionality.

#### *3.2.2. Adequacy of the system language to the problem domain*

The WinALT was developed simultaneously with computer-aided models of parallel algorithms and structures under their strong influence. This influence has manifested itself in the WinALT system by a wide employment of visualization tools both for supporting the construction of parallel algorithm descriptions (graphic representation of objects corresponding to cellular arrays, the left and right parts of substitutions) and for their simulation (capability to view the dynamics of application of each substitution). What is more, a special attention was given to the development of tools that provide the visualization of 3D (multilayer) objects and that allow viewing the transformation of cell states in any layer of a 3D cellular array. This is due to the orientation of the development of computer-aided models to fine-grain architectures that are promising for the implementation in the form of multilayer VLSI. The simulation language contains three parts.

The first part of the language is designed to describe parallel computations in the form of parallel substitutions. It is fully based on PSA.

The objective of the second part of the language is the description of sequential computations. This part is essentially based on Pascal. It provides statements for the description of simulation program structure, control operators, assignment operator and subroutine call by name or by reference. These statements can be used in a model program for the description of sequential control when needed. These means can be used in a model program for the description of sequential control, when it is needed, for the definition of functions that describe cell states and, also, for the construction of such service functions within a model program as menu definition, graph drawing or initial data input.

The third part of the language provides importing libraries into a model program. These are **dll** libraries written in **C/C++** and embedded into the simulation system. This helps in enriching the functionality of simulation tools to suit the user.

Let us describe the first and the third parts in greater detail.

64 Optical Communication

algorithm

as ALU by a single cell.

*3.2.1. Overview of the system* 

**3.2. A simulation system of 3D digital structures** 

the user to participate in extension of the system functionality.

*3.2.2. Adequacy of the system language to the problem domain* 

**Figure 4.** Cellular adder: a – graphic representation of PSA commands, b – one step of execution of

variable symbols can be written into cells of templates of the left part of substitution, while the functional symbols can be in the cells of the right part. Such a substitution is called *functional* substitution. When an alteration of a state is performed for a cell located in the processed array under a template cell of the right part of a certain command containing a functional symbol, it is not specific data from the template cell, but a result of evaluation of a certain function that is written into this cell. The states of cells in the processed array that are below the cells of a template of the left part can be arguments of such functions. Using the functional substitutions helps: a) in reducing PSA notation to a considerably more concise form in theoretical issues, b) in practical issues to represent rather complicated devices such

A physical and technical rationale for the construction of multilayer optoelectronic structures is given In Section 2. Evidently the construction of real 3D structures requires a large amount of work associated in the first place with selection of an optimal kind of structure from the standpoint of technical parameters among a big number of possible variants. A manual solution of such a task is virtually impossible. Thus, a computer-aided tool must be available for the research and development of models of 3D structures. Such an instrument was built and it is called WinALT [15]. The user's interface of the system coincides with the standard user's interface in Windows applications. A simulation model is represented by a project that contains a number of sub-windows. Each sub-window can hold graphic or text objects of a model. Creation and editing of graphic objects are carried out by means of toolbars, menus and dialog windows. The system is freely distributed. System's site [16] contains a section "installation", which includes manuals on installation, uninstallation and system's distributive package. An open architecture of the system enables

The WinALT was developed simultaneously with computer-aided models of parallel algorithms and structures under their strong influence. This influence has manifested itself in the WinALT system by a wide employment of visualization tools both for supporting the *The Description of the Parallel Part of Simulation Language.* This part has a clear division into graphic and analytical subparts. Graphic objects are cellular arrays and templates. An image of an object is composed of color cells located along horizontal and vertical axes and, also, along the axis that goes from the user to the screen. The origin in the template is called its *center*.

A color is used to visualize a cell's state. Its state can belong to any cell's data type supported by the library of data formats (see below). A name can be assigned to a cell in addition to a typed value as an additional property. It has to be unique within the scope of one cellular object. This makes possible to implement functional substitutions in WinALT. There is a special neutral **void** state of a cell (depicted by a diagonal cross on a color background).

A parallel substitution in WinALT simulation language is set by a bunch of operators **in-atdo**. The names of cellular arrays and templates can be used as parameters in these operators. In the case of one-block structure of a device (a single cellular array), a parallel substitution is described as follows. The parameter of **in** operator is the name of a processed cellular array. A name of template of the left part of substitution is a parameter in **at** operator, while that of its right part is a parameter in **do** operator. The execution of substitution is done in two phases. During the first one, the center of a template of the left part is moved along the axes in a processed cellular array, and all its occurrences in this array are marked accurate to the

empty cells. At the second phase, the states of cells of the processed cellular array in all these occurrences are replaced by the states of cells from the template of the right part also accurate to the empty cells. Taking multi-block structure of the device into consideration means the following. The parameter in operator **in** is a list of names of cellular arrays placed in brackets and separated by commas. The lists in operators **at** and **do** are arranged similarly, but instead of names of cellular arrays the names of templates are used in them. Combining patterns in the list means that the movement of patterns in the images of their corresponding cellular arrays is coordinated by substitution of the same set of coordinates into the centers of all the templates of the operators **at** and **do**. The coordinates of cells of the cellular array that is in the head of the list **in** operator form these sets. Such substitutions are called vector substitutions and allow describing parallel transformations of information in compositions of cellular arrays.

A bunch of operators **in-at-do** and a description of a function serve as an analog of functional substitution. Operator **at** contains the names of templates, in which some cells are named. A function uses these names as input and output variables. The name of a function is used as a parameter in operator **do**. A functional substitution can also be a vector one.

A synchroblock **exhaust-end** (or shortly **ex-end**) is the main structure for definition of an algorithm of a device operation. This block implements an iterative procedure of PSA application for the composite operators describing parallel substitutions that it contains. In addition, there are two more kinds of synchroblocks that were introduced: **clock – end** (**cl – end**) and **change – end** (**ch – end**). The first one executes its substitutions a number of times specified as its parameter. The second one executes its body only once.

Remark. The combination of parallel and sequential parts of the language is attained by the possibility to use operators from the sequential part in synchroblocks. Let us also note that nested synchroblocks can be in WinALT simulation language. The described capabilities allow constructing any parallel-sequential compositions of synchronous transformations of cellular arrays.

Model program. The structure of a model program is quite conventional. It consists of a list of libraries imported to a program (using operators **use**, **import** and **include**), declarations of constants, variables and cellular objects, procedures, functions and the main operator block. The main operator block is placed in operator **begin**-**end** brackets and contains operators of the first and second parts of the language. A program may include comments, which can be placed in braces. A project can contain any number of simulation programs. They are capable of interacting with each other if necessary.

The third part of the language is based upon a set of WinALT libraries. The functionality of the system is extended by means of external modules. These modules are represented by Windows **dll** files. These external modules contain the interface functions that are used in versatile simulation models. The external modules form several groups that are called libraries. Some of them are briefly described below.

*The library of data formats* eliminates limitations of a data type that can be represented by cells in a cellular array. The library contains modules for representations of cellular arrays with integer cells (**int8**, **int16**, **int32**, **uint8**, **uint16**, **uint32**), bit cells (**bit**), float cells (**float**) and others. Some external formats are supported by the modules of library, such as **bmp** raster graphics format. The assignment of **default** type for a cellular object means that any of its cells can have any of the above-mentioned formats. The latter can be used for the representation of heterogeneous cellular objects. In GUI, the type of a cellular object can be selected in a combo box within the dialog window of the new object creation.

66 Optical Communication

cellular arrays.

empty cells. At the second phase, the states of cells of the processed cellular array in all these occurrences are replaced by the states of cells from the template of the right part also accurate to the empty cells. Taking multi-block structure of the device into consideration means the following. The parameter in operator **in** is a list of names of cellular arrays placed in brackets and separated by commas. The lists in operators **at** and **do** are arranged similarly, but instead of names of cellular arrays the names of templates are used in them. Combining patterns in the list means that the movement of patterns in the images of their corresponding cellular arrays is coordinated by substitution of the same set of coordinates into the centers of all the templates of the operators **at** and **do**. The coordinates of cells of the cellular array that is in the head of the list **in** operator form these sets. Such substitutions are called vector substitutions and allow

describing parallel transformations of information in compositions of cellular arrays.

specified as its parameter. The second one executes its body only once.

They are capable of interacting with each other if necessary.

libraries. Some of them are briefly described below.

A bunch of operators **in-at-do** and a description of a function serve as an analog of functional substitution. Operator **at** contains the names of templates, in which some cells are named. A function uses these names as input and output variables. The name of a function is used as a parameter in operator **do**. A functional substitution can also be a vector one.

A synchroblock **exhaust-end** (or shortly **ex-end**) is the main structure for definition of an algorithm of a device operation. This block implements an iterative procedure of PSA application for the composite operators describing parallel substitutions that it contains. In addition, there are two more kinds of synchroblocks that were introduced: **clock – end** (**cl – end**) and **change – end** (**ch – end**). The first one executes its substitutions a number of times

Remark. The combination of parallel and sequential parts of the language is attained by the possibility to use operators from the sequential part in synchroblocks. Let us also note that nested synchroblocks can be in WinALT simulation language. The described capabilities allow constructing any parallel-sequential compositions of synchronous transformations of

Model program. The structure of a model program is quite conventional. It consists of a list of libraries imported to a program (using operators **use**, **import** and **include**), declarations of constants, variables and cellular objects, procedures, functions and the main operator block. The main operator block is placed in operator **begin**-**end** brackets and contains operators of the first and second parts of the language. A program may include comments, which can be placed in braces. A project can contain any number of simulation programs.

The third part of the language is based upon a set of WinALT libraries. The functionality of the system is extended by means of external modules. These modules are represented by Windows **dll** files. These external modules contain the interface functions that are used in versatile simulation models. The external modules form several groups that are called

*The library of data formats* eliminates limitations of a data type that can be represented by cells in a cellular array. The library contains modules for representations of cellular arrays with *The library of language functions* provides the ability to use such functions in simulation programs as functions of object management (creation, deletion, modification or size alteration), GUI functions (construction of dialog windows and data input based upon them), mathematical functions (**sin**, **cos**, **atan**, **cosh**, **log**, **j0**), console I/O functions (**WriteLn**, **ReadLn**), file I/O functions (**fopen**, **fgets**, **fread**, **feof**, …) and miscellaneous functions such as **max**, **min**, **null**, **typeof**, **StringLength**, **Time**. Operator **use** activates the modules of this library in a simulation program. A typical module of this library is a **dll** written in **C** or **C++**.

*The library of visual modes* provides a customizable visualization of a cellular array and its cells. A cell state can be visualized e.g. by color, a directed arrow or by a number or by their certain combination. A 3D cellular array can be shown as a deck of layers or as layers unrolled in a line or in a grid.

New external modules can be added to any of these libraries. Such modules can be created, for example, using Microsoft Visual Studio. Their source texts can be either borrowed from a provided sample, written from the scratch, or taken from an existing library of functions (e.g. ANSI C runtime library).
