A generalized signal flow graph for the forward and inverse discrete cosine transform (DCT) based on the Hou's recursive algorithm is described. The regular structure of the generalized signal flow graph enables to realize the DCT and inverse DCT computation for any given N = 2m, m >0, and is effectively implementable on a VLSI chip. Computer program for the DCT and inverse DCT computation is also presented.