ROM Editor/Programmer Guide

The ROM components are programmable in a various modes, included the possibility of initialize the memory with a sampled waveform. In the example of the next figure, the user has activated the contest menu of the component, to launch the ROM Editor/Programmer:

The ROM Editor/Programmer dialog (see the figure below) can be used to edit directly the memory contents in Binary, Hexadecimal or ASCII text format (Undo/Redo buttons are available). To edit a memory cell, simply click on it. To go to the next cell, press the <right arrow key>.

The dialog has also three buttons (Load, Save, Waveform), and the Label field. In the Label edit field (up-right side), the user can edit a symbolic name for the memory component (see also the example in the previous figure, just over the symbol: "Sine Wave").

By clicking on the Waveform button, we open the"Waveform in ROM" dialog, initially in Viewer Mode. As visible in the next figure, the dialog shows the Rom data as a digital signal, in a bidimensional chart (on the horizontal axis: the internal addresses of the memory; on the vertical axis: the corresponding data values). In this example, the memory contains the 8-bits samples of a complete cycle of a sine wave (the samples are coded as signed binary numbers).

To define a new waveform, you must change the mode (see the figure below):

Now it is possible to choose a new waveform, selecting it from the Wave list box:

The user can select a standard function: sine, cosine, saw-tooth, triangle and square wave (in the figure above, the cosine waveform). The waveform samples are calculated to memorize an entire cycle of the wave and to reach the maximum possible amplitude, centered on the zero (from +127 to -127, if signed, as in this example), or all-positive ( unsigned, from 0 to 254).

The button "Copy Image" will copy the waveform image on the clipboard, ready to be pasted in the user documents.

At the end of the list, a Fourier Series utility is available (the Fourier Series is a mathematical method to represent a cyclic function as the sum of sine waves). We can choose between two classic series (square wave and saw-tooth wave), and stop the series at a given order. In the example below, a square wave series is set (as only the "Odd" harmonics has been selected), limited at the seventh harmonic.

Moving the mouse on the desired sample, with a click, the user will open a magnifying window (visible in the next figure):

In this example, we see a particular of the waveform seen in the previous figure, magnified around the sample of address 106, whose value is +116 (in blue, the digitized waveform; in red, the analog original waveform that has been sampled).

Buttons are available to manage time scale and horizontal Panning; the vertical scale, instead, is adaptive. Also here, a "Copy Image" button allows to the user to copy the waveform image on the clipboard.

Returning to the Waveform Editor, note that we can add to the waveform also a certain amount of white noise, as visible in the following figure:

Let's return to the ROM Editor/Programmer dialog, and consider the buttons "Load" and "Save":

The ROM memory contents can be saved on, and loaded from, a coded text file. The default extension of the file is ".drs" (Deeds Rom Source file), but it can be opened and modified with a text file editor. By clicking on the "Save" button, we export a text file like this:

  #- Deeds (Digital Electronics Education and Design Suite)
  #- Rom Contents Saved on (14/10/2015, 19:03:29)
  #- by the Deeds (Digital Circuit Simulator)(Deeds-DcS)
  #- … omissis …
  #R ROM256x8, id 02F0   
  #A 0000h   
  #H ;
  4E 65 6C 20 6D 65 7A 7A 6F 20 64 65 6C 20 63 61
  6D 6D 69 6E 20 64 69 20 6E 6F 73 74 72 61 20 76
  69 74 61 20 6D 69 20 72 69 74 72 6F 76 61 69 20
  … omissis …

In this example, the # in first position indicate that the entire line is a Comment. A # followed by a letter is a Directive (see below). All the HEX numbers that will follow, in the lines without # in first position, represent the data contents of the ROM, location by location.

By clicking on the "Load" button, we can import a .drs file. The file is compiled and the ROM component is programmed with the file data. A Directive must be written in first position, and can be one of the following:

  #-                         Comment (or header) (ignored at compile time);
  #R ROM256x16, id 0004      Rom component Type (ignored at compile time);
  #A <address>               Start address of data that will follow (hex or decimal),
                             if no #A directive is defined, the default address is zero;
  #T                         "Text contents follow", that is read starting from the next
                             line (including CR/LF), and stored from the address defined
                             [this is the default];
  #H                         Declares that the following numbers are hex;
  #B                         Declares that the following numbers are binary;
  #D                         Declares that the following numbers are decimal.

In the following example, the file has been coded to load in the memory the first verses of the "Divina Commedia" (Dante Alighieri). Note that the directives could be cut away, leaving only the text in the file:

  #- Dante Alighieri
  #A 0000h
  Nel mezzo del cammin di nostra vita
  mi ritrovai per una selva oscura
  ché la diritta via era smarrita.
  Ahi quanto a dir qual era è cosa dura
  esta selva selvaggia e aspra e forte
  che nel pensier rinova la paura!

Then, the resulting contents will be visible in the ROM Editor/Programmer (see the next figure):