// This is a SyReC-file describing a circuit computing the average of 16 values.
// This file has been taken from RevLib (www.revlib.org).   

module avg16( out x0, inout x1, inout x2, inout x3, inout x4, inout x5, inout x6, inout x7, inout x8,
              inout x9, inout x10, inout x11, inout x12, inout x13, inout x14, inout x15, inout x16 )

  x1 += x2 ;
  x1 += x3 ;
  x1 += x4 ;
  x1 += x5 ;
  x1 += x6 ;
  x1 += x7 ;
  x1 += x8 ;
  x1 += x9 ;
  x1 += x10 ;
  x1 += x11 ;
  x1 += x12 ;
  x1 += x13 ;
  x1 += x14 ;
  x1 += x15 ;
  x1 += x16 ;
  x0 += ( x1 >> 4 )
