PAL16L8

a different use of EPROMs

Engineering: the art of performing miracles every day,
at nearly no cost, never witnessed/rewarded
by the people around or above you.

Of course, if an elevator, an aircraft, or a space station
should decide to unintentionally fall from the sky
while your electronics is somehow part of the game,
everybody will instantly blame you.

Got stuck with a logic design, too big for a PAL/GAL,
but too small for a FPGA/CPLD ?

Indecisive about installing another licence managing thing on your PC ?
Fed up with colourful user interfaces, that show all the important buttons
at different places while refusing to open your old project files after
each software update ?
Want to have a data retention time > 20 years ?
And most important: are you aware, that sometimes the definition of words
such as "mature" and "reliable" by marketing and engineering department
sometimes does not overlap ?

If you don't fear the "propagation delay", try EPROMs.
Quite reliable, versatile, cheap, can be bought at nearly every corner,
and every now and then a faster and bigger version goes into production.
[2012: Edit: things are starting to look a bit different now...]
Best of all: no vendor specific/special hardware/software is required for
logic design and programming.

Enough of pointless ranting. Example:

/*                                                                       
 *                                                                       
 * pal16l8.c V1.0 (c) Dieter Mueller 08/2004                             
 *                                                                       
 * example: using a 64kB EPROM as programmable logic device.             
 * 27512, gives 16 Input_Pins and 8 Output_Pins.                         
 *                                                                       
 * Note: unlike with PALs/GALS, the number/complexity of                 
 * product_terms/equations is only limited by the Pin count              
 * of the EPROM... and the abilities of your compiler.                   
 *                                                                       
 * Not much memory used, generating 1MB files for 27080                  
 * should be possible under DOS.                                         
 *                                                                       
 */                                                                      
                                                                         
#include <stdio.h>
#include <stdlib.h>
                                                                         
int main(void);                                                          
char do_rom(long addr);                                                  
                                                                         
int main(void)                                                           
{                                                                        
  FILE *outstream;                                                       
                                                                         
  long i;                                                                
                                                                         
  outstream=fopen("pal16l8.bin","wb");                                   
  if(outstream==NULL)                                                    
  {                                                                      
    printf("\nFile open error.\n");                                      
    return(-1);                                                          
  }                                                                      
                                                                         
  for(i=0; i<0x10000; i++) //try all possible input patterns, 64 kBytes   
  {                                                                      
    fputc(do_rom(i),outstream); //write one EPROM Byte                   
  }                                                                      
                                                                         
  fclose(outstream);                                                     
  return(0);                                                             
}                                                                        
                                                                         
char do_rom(long addr) //do one Byte                                     
{                                                                        
  char out;                                                              
  char a,b,c;                                                            
  char q0,q1,q2;                                                         
                                                                         
 //default = Zero.                                                       
  a=0; b=0; c=0; q0=0; q1=0; q2=0;                                       
                                                                         
 //scan input_pins. //WARNING: casting HAS to be, avoiding funny results.
  if((long)addr & 0x01) a=-1;                                            
  if((long)addr & 0x02) b=-1;                                            
  if((long)addr & 0x04) c=-1;                                            
                                                                         
 //equations. //WARNING: thou shalt not use ! to negate.                 
  q0=a|b;                                                                
  q1=a&b;                                                                
  q2=(~a&b)^c; //((NOT A) AND B) XOR C //last stage of a full adder      
                                                                         
 //now to throw all the results together.                                
  out=0; //default = Zero.                                               
  if(q0) out|=0x01;                                                      
  if(q1) out|=0x02;                                                      
  if(q2) out|=0x04;                                                      
                                                                         
 //done.                                                                 
  return(out);                                                           
}                                                                        

Is it possible to implement an ALU using EPROMs ?
Yes, it is, and a few hobbyists already successfully did.


[HOME] [UP]/ [BACK] [1] [2] [3] [4] [5] [6] [7] [8] [NEXT]

(c) Dieter Mueller 2004