/******************************************
* (C)Copyright by N.T.T 1993(unpublished) *
* All rights are reserved.                *
******************************************/
%i "../int_h/alu_4.h"
module alu_16 {
    input       enb_cry ;
    input       inv_in2 ;
    input       and ;
    input       or ;
    input       eor ;
    input       cin ;
    input       in1<16> ;
    input       in2<16> ;
    output      out<16> ;
    output      gout ;
    output      pout ;
    output      ovf ;
    output      eq ;
    sel_v       cry<4> ;
    alu_4       alu43 ;
    alu_4       alu42 ;
    alu_4       alu41 ;
    alu_4       alu40 ;
    instrin     do ;
    instruct do par {
        cry = ((cin&alu40.pout&alu41.pout&alu42.pout)
              |    (alu40.gout&alu41.pout&alu42.pout)
              |               (alu41.gout&alu42.pout)
              |                           alu42.gout)
           || ((cin&alu40.pout&alu41.pout)
              |    (alu40.gout&alu41.pout)
              |                alu41.gout)
           || ((cin&alu40.pout)
              |     alu40.gout)
           || cin ;
        out = alu43.do(enb_cry,inv_in2,and,or,eor,cry<3>,in1<15:12>,in2<15:12>).out
           || alu42.do(enb_cry,inv_in2,and,or,eor,cry<2>,in1<11: 8>,in2<11: 8>).out
           || alu41.do(enb_cry,inv_in2,and,or,eor,cry<1>,in1< 7: 4>,in2< 7: 4>).out
           || alu40.do(enb_cry,inv_in2,and,or,eor,cry<0>,in1< 3: 0>,in2< 3: 0>).out ;
        gout = (alu40.gout&alu41.pout&alu42.pout&alu43.pout)
              |           (alu41.gout&alu42.pout&alu43.pout)
              |                      (alu42.gout&alu43.pout)
              |                                  alu43.gout ;
        pout = alu40.pout&alu41.pout&alu42.pout&alu43.pout ;
        ovf = alu43.ovf ;
        eq = alu40.eq&alu41.eq&alu42.eq&alu43.eq ;
    }
}
