On Thu, 6 Dec 2001, [iso-8859-1] Simon-Thijs de Feber wrote: > Hello, > > I am in doubt how to solve the following issue. > I have a 4 bit input and need to convert it to a 6 bit > output. > This can probably be done with a look-up table > (FPGA/GAL/PIC) > The Table is as follows > In Out > 0000 111111 > 0001 111101 > 0010 111110 > 0011 111010 > 0100 111000 > 0101 111010 > 0110 101001 > 0111 101000 > 1000 110000 > 1001 010000 > include 16f628_4 include jpic628 cmcon = 0x07 var byte input is port_a_low port_a_low_direction = input var byte output is port_b port_b_direction = output forever loop if input = 0 then output = 0x_ff elsif input = 0x_01 then output = 0x_fd elsif input = 0x_02 then output = 0x_fe ; ettcetera endif end loop jal, no lookup table -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu