A Spreadsheet CLI

Can a spreadsheet be a programming language?

A Spreadsheet CLI

This section begins the effort to write a spreadsheet geared toward implementing state machines. The requirements given in the previous section are used to help define a cell's data structure and to define the commands to edit the fields in that data structure. Several open source spreadsheets were considered but the changes requires would have been extensive so building a spreadsheet from scratch seemed the easiest approach.

The state machine spreadsheet is described in terms of a model-view-controller paradigm. Below are descriptions of the model and the controller.

The Model
The state machine spreadsheet is a two dimensional array of cells where each cell has:
-value: the integer value of the cell
-width: the bit width of value
-nextval: an expression to compute the next value
-type: cell type as logic, register, label, or unused
-initial: cell value at reset or program start
-label: optional name of a cell
-comment: should describe the purpose of the cell
-bits: a range of bits of value

There are several cell types. A cell type of "logic" is used for what was called "named logic" in the previous section. The computed value of nextval is available immediately for use by all other cells. The value of a "register" cell is updated with the value of nextval only at the end of a clock cycle. Register cells contain the application state variables.

Posted by Bob Smith | on