import math


def src_from_rc8x8(row, col) :
    """Converts Cheetah 8x8 ASICs table row and column to seg, row, col coordinates
    """
    qsegs, rows, cols = (8, 185, 388) 
    quad = math.floor(col/cols) # [0,3]
    qseg = math.floor(row/rows) # [0,7]
    s = qsegs*quad + qseg
    c = col%cols if isinstance(col, int) else math.fmod(col, cols)
    r = row%rows if isinstance(row, int) else math.fmod(row, rows)
    return s, r, c