
This is sample decoding logic, used to estimate the logic requirements.
It isn't debugged yet, but it seems to indicate that the decoder can
be built with about 150 logic cells, where each cell is a 2-input AND,
OR, NAND, MUX, etc.

Estimated requirements for a 16-bit processor:
        Decode: 150 logic cells
        Regs:   100 D-FFs
        PC++:    50 logic cells
        Muxes:  200 2-input multiplexers
        ALU:    150 logic cells
        Stacks: Single port SRAM 1K bits

\ Grouping logic
        sg01 = /op[2] * /op[1] ;  // subgroups within a group
        sg23 = /op[2] *  op[1] ;
        sg45 =  op[2] * /op[1] ;
        sg67 =  op[2] *  op[1] ;
        sg0 =  sg01 * /op[0] ;  sg1 =  sg01 *  op[0] ;
        sg2 =  sg23 * /op[0] ;  sg3 =  sg23 *  op[0] ;
        sg4 =  sg45 * /op[0] ;  sg5 =  sg45 *  op[0] ;
        sg6 =  sg67 * /op[0] ;  sg7 =  sg67 *  op[0] ;
        gp01 = /op[5] * /op[4] ;  // major groups 0..7
        gp23 = /op[5] *  op[4] ;
        gp45 =  op[5] * /op[4] ;
        gp67 =  op[5] *  op[4] ;
        gp0 =  op01  * /op[4] ; gp1 =  op01  *  op[3] ;
        gp2 =  op23  * /op[4] ; gp3 =  op23  *  op[3] ;
        gp4 =  op45  * /op[4] ; gp5 =  op45  *  op[3] ;
        gp6 =  op67  * /op[4] ; gp7 =  op67  *  op[3] ;

First 64 instructions:
        op = op[5]        ? {gp4+gp7,0,0} : opcode[2:0] ;
        cc = (/op[5]+gp7) ? {0,0,1}       : opcode[2:0] ;
        ms = op[4] + /op[3] ;
        mb = gp7          ? {/gp67,gp67}  : {/sg5,sg67} ;
        my = 1 ;
        ml = /(gp7 * /op[5] * /sg3) ;
        ma = 1 ;
        mr = {gp3+(gp7*/op[5]),1} ;
        mx = gp7          ? {/op[5]+gp5}  : op[4]+sg5 ;
        my = {op[5],gp1+gp2} ;
        mz = gp7 * (sg3+sg5) ;
        ct = gp01 + gp3 + gp7 ;
        cl = 0 ;
        ca = 0 ;
        cx = gp3 + gp5 + (gp7 * /op[5]) ;
        cs = gp7          ? {gp1+gp2,/gp01*op[0]} : {0,/op[5]} ;
        se = {gp7*sg7,gp3+gp4+gp7,gp6} ;
        ex = {gp3,0,0} ;

\ Second group of 64 instructions:

        op = {gpB*(sg0+sg7), gpA+gpB*sg0+gpC*sg2, gpA+gpB*sg7+gpC*sg2}
        cc = {0,0,1}
        ms =  gp8*/sg4 + gp9*/sg02 + gpA*op[0] + gpB*/sg01 + gpC*op[2]
        mb1 = gp8*/sg7 + gp9*/sg5 + gpAB + gpC*/sg3
        mb0 = gp8*sg45 + gp9*(sg23+sg4) + gpC*sg5
        mt = /( gp9*sg01 + gpC*sg1 )
        ml = /( gp8*sg0 )
        ma = /( gpA*sg0 )
        mr1 = gp8*sg23 + gpB
        mr0 = gp8*/sg2 + gp9 + gpA + gpB*/sg67
        mx1 = gp8*sg67 + gpB*sg0
        mx0 = /( gp9*sg6 + opB*(op[5]+op[3]) )
        my1 = /( gpA*op[5] + gpB*/op[1] )
        my0 = gpA*(op[2]+/op[0]) + gpB + gpC
        mz = gp8*sg7 + gp9*sg5 + gpB*sg23 + gpC*sg3
        ct = gp9*/sg45 + gpA*sg23 + gpB*sg01 + gpC*op[2]
        cl = gp8*sg01 + gp9*sg4 + gpA*/op[1] + gpB*sg45
        ca = op8*op[2] + opA*sg67 + opB*(op0+op2+op67)
        cx = op8*(op23+op45) + op9*sg23 + opC
        cs = {op9*sg4, gpC}
        se = {0,0}
        ex = {0, gpB*sg23, gpB*sg0}

