Programming PROMs in LogicWorks

This document describes procedures to program PROMs (Programmable Read Only Memory). The PROMs are programmed using data in a .HEX file (more precisely, a file in the Intel Hex format). The file can be loaded into a PROM in LogicWorks (for simulation) or a real EPROM (Erasable Programmable ROM), such as the 2732. The procedure for programming a PROM in LogicWorks will be described below.

Remember that the HEX file must have lines that begin with colons (":").  If you create a HEX file using the Truth Table program, it will look like this:

INPUT               a2 0 0 0
INPUT a1 0 0 0
INPUT a0 0 0 0
OUTPUT d2 0 0 0 0 0
OUTPUT d1 0 0 0 0 0
OUTPUT d0 0 0 0 0 0
HEX
:10000000f8faf9fdfefef9faffffffffffffffff21
:10001000fffffffffffffffffffffffffffffffff0
:10002000ffffffffffffffffffffffffffffffffe0
:10003000ffffffffffffffffffffffffffffffffd0
:10004000ffffffffffffffffffffffffffffffffc0
:10005000ffffffffffffffffffffffffffffffffb0
:10006000ffffffffffffffffffffffffffffffffa0
:10007000ffffffffffffffffffffffffffffffff90
:10008000ffffffffffffffffffffffffffffffff80
:10009000ffffffffffffffffffffffffffffffff70
:1000a000ffffffffffffffffffffffffffffffff60
Delete the first few lines to get the following:
:10000000f8faf9fdfefef9faffffffffffffffff21
:10001000fffffffffffffffffffffffffffffffff0
:10002000ffffffffffffffffffffffffffffffffe0
:10003000ffffffffffffffffffffffffffffffffd0
:10004000ffffffffffffffffffffffffffffffffc0
:10005000ffffffffffffffffffffffffffffffffb0
:10006000ffffffffffffffffffffffffffffffffa0
:10007000ffffffffffffffffffffffffffffffff90
:10008000ffffffffffffffffffffffffffffffff80
:10009000ffffffffffffffffffffffffffffffff70
:1000a000ffffffffffffffffffffffffffffffff60

Using the ".HEX" File to Program a PROM in LogicWorks

The next three steps are for Logicworks on PCs (it is similar for Mac).  Assume that the .HEX file is in wiliki.  

Step 1.  Transfer the ".HEX" file from wiliki to the PC

The SSH Secure File Transfer program, available in the EE 260 Lab (Holmes 451) and the EE Computer Lab (Holmes 387), transfers files between a local and a remote computer.  The local computer is the one you're using, and the remote is somewhere else.  For our purposes, the remote computer will be wiliki, where the .HEX file is located.  A file transfer can be a download, which goes from remote to local, or an upload, which goes from local to remote.

Start the SSH Secure File Transfer, which will open a window.  Under the File menu, select Connect.  When the program prompts you for a machine,  enter

wiliki.eng.hawaii.edu

Now logon.  The window will show your files on the local and remote computers.  You can navigate around by pointing and clicking.  You can also create folders/directories.  

Navigate on wiliki until you find your HEX file.  Navigate on your local computer until you find a folder to download the file.  Select your HEX file on wiliki.  Under the Operation menu, select Download.  The file should transfer, and you're done.  You can close the connection by simply exiting or closing the application.

Step 2. Programming a PROM for LogicWorks 5 using the ".HEX" file: 
*  Logicworks only allows the number to be powers of 2.  So you may end up having slightly more inputs than you need.  The extra inputs are the ones corresponding to the most significant bits.  When using the circuit, tie these to Ground (0).  For example, suppose you need 5 inputs but must select 8.  This leaves you with a PROM with inputs In7, In6,... In0.  When you use the PROM, connect In7, In6, and In5 to Ground.

** Logicworks only allows the numbers to be powers of 2.  You may end up having slightly more outputs than you need.  The extra outputs are the ones corresponding to the most significant bits.  You can ignore these.  For example, suppose you need 3 outputs but must select 4.  This leaves you with a PROM with inputs Out3, Out2, Out1, Out0.  When you use the PROM, ignore Out3.

Step 3. Delete your files from the PC if it's not your own.  Don't forget your thumb drive or disks.


Appendix A: Refresher



Appendix B:  Intel Hex File Format

We will be using the Intel Hex File format to program Programmable Read Only Memory (PROMs) such as the 2732.  The format specifies the memory location of the data, and the data values itself.  In addition, it has information to check for bit errors. 

The file is a text file but representing hexadecimal numbers.  A hexadecimal number is a number that has base 16.  So each digit can have one of 16 values, {0, 1, 2, ..., 14, 15}.  The digit is a single symbol.  For the values 10, 11, ..., 15, the symbols are "A" = 10, "B" = 11, "C" = 12, ..., "E" = 14, and "F" = 15.  The letters may be upper or lower case.  As an example, the hexadecimal number FA is equal to 15x16 + 10.  Hexadecimal numbers are useful to represent binary values because it is easy to convert a hexadecimal number to binary and vice versa.  Each hexadecimal digit represents 4 bits.  For example the hexadecimal number "FA" is equal to the binary number "1111 1010".  To convert a hexadecimal number to binary, just convert each hexadecimal digit to its equivalent 4-bit binary number.  To convert a binary number to hexadecimal, just partition the binary number into 4-bit chunks starting from the right.  Then convert the 4-bit values into hexadecimal.  For example,101101100010101 = 101  1011  0001  0101 = 5  B  1  5.  Note that a byte (8 bits) is represented by two hexadecimal digits.  Also, hexadecimal numbers are often prefixed by "0x" to indicate it is a hexadecimal number, e.g., 0x5B15

The Intel Hex File Format is list of "lines", where each line either (i) specifies data values at a particular memory location or (ii) its a line indicating that its the end of the file.  Each line has six parts to it, where each part is also referred as a "field".   
For example, the first line below has the start code ":" then a byte count of 0x10 = 16, an address of 0x0000, a record of 00 = dataand a checksum of 21.  The second line also has data but starting at address 0x0010, and with a checksum of 0xf0.  The final line has a record 01 = end of file, byte count = 0x00 = 0, address of 0x0000 (since there are no data bytes), and checksum of 0xff.
:10000000f8faf9fdfefef9faffffffffffffffff21
:10001000fffffffffffffffffffffffffffffffff0
:00000001ff
This specifies that the data to be stored is

Address (hex)   Data (hex)
0000                 f8
0001                 fa
0002                 f9
0003                 fd
0004                 fe
0005                 fe
0006                 f9
0007                 fa
0008                 ff
0009                 ff
etc