/************************************************ * 32ビット乗算器用64ビット桁上げ伝搬加算器 * * 以下のファイルを参考に作成 * * $PARTHENON/sfl_lib.src/sfl/cpa32.sfl * * $PARTHENON/sfl_lib.src/sfl/cpa16.sfl * * $PARTHENON/sfl_lib.src/sfl/cpa4.sfl * * $PARTHENON/sfl_lib.src/int_h/cpa16.h * * $PARTHENON/sfl_lib.src/int_h/cpa4.h * ************************************************/ module cpa64 { submod_type cpa32 { input cin ; input in1<32> ; input in2<32> ; output out<32> ; output gout ; output pout ; instrin do ; instr_arg do(cin,in1,in2) ; } input cin ; input in1<64> ; input in2<64> ; output out<64> ; output gout ; output pout ; tmp cry<2> ; cpa32 cpa1 ; cpa32 cpa0 ; instrin do ; instruct do par { cry = ((cin&cpa0.pout) | cpa0.gout) || cin ; out = cpa1.do(cry<1>,in1<63:32>,in2<63:32>).out || cpa0.do(cry<0>,in1<31:00>,in2<31:00>).out ; gout = (cpa0.gout&cpa1.pout) | cpa1.gout ; pout = cpa0.pout&cpa1.pout; } } module cpa32 { submod_type cpa16 { input cin ; input in1<16> ; input in2<16> ; output out<16> ; output gout ; output pout ; instrin do ; instr_arg do(cin,in1,in2) ; } input cin ; input in1<32> ; input in2<32> ; output out<32> ; output gout ; output pout ; tmp cry<2> ; cpa16 cpa1 ; cpa16 cpa0 ; instrin do ; instruct do par { cry = ((cin&cpa0.pout) | cpa0.gout) || cin ; out = cpa1.do(cry<1>,in1<31:16>,in2<31:16>).out || cpa0.do(cry<0>,in1<15:00>,in2<15:00>).out ; gout = (cpa0.gout&cpa1.pout) | cpa1.gout ; pout = cpa0.pout&cpa1.pout ; } } module cpa16 { submod_type cpa4 { input cin ; input in1<4> ; input in2<4> ; output out<4> ; output gout ; output pout ; instrin do ; instr_arg do(cin,in1,in2) ; } input cin ; input in1<16> ; input in2<16> ; output out<16> ; output gout ; output pout ; tmp cry<4> ; cpa4 cpa43 ; cpa4 cpa42 ; cpa4 cpa41 ; cpa4 cpa40 ; instrin do ; instruct do par { cry = ((cin&cpa40.pout&cpa41.pout&cpa42.pout) | (cpa40.gout&cpa41.pout&cpa42.pout) | (cpa41.gout&cpa42.pout) | cpa42.gout) || ((cin&cpa40.pout&cpa41.pout) | (cpa40.gout&cpa41.pout) | cpa41.gout) || ((cin&cpa40.pout) | cpa40.gout) || cin ; out = cpa43.do(cry<3>,in1<15:12>,in2<15:12>).out || cpa42.do(cry<2>,in1 <11:8>,in2 <11:8>).out || cpa41.do(cry<1>,in1 <7:4>,in2 <7:4>).out || cpa40.do(cry<0>,in1 <3:0>,in2 <3:0>).out ; gout = (cpa40.gout&cpa41.pout&cpa42.pout&cpa43.pout) | (cpa41.gout&cpa42.pout&cpa43.pout) | (cpa42.gout&cpa43.pout) | cpa43.gout ; pout = cpa40.pout&cpa41.pout&cpa42.pout&cpa43.pout ; } } module cpa4 { input cin ; input in1<4> ; input in2<4> ; output out<4> ; output gout ; output pout ; tmp g<4> ; tmp p<4> ; tmp cry<4> ; instrin do ; instruct do par { g = (in1<3> & in2<3>) || (in1<2> & in2<2>) || (in1<1> & in2<1>) || (in1<0> & in2<0>) ; p = (in1<3> | in2<3>) || (in1<2> | in2<2>) || (in1<1> | in2<1>) || (in1<0> | in2<0>) ; cry = ((cin&p<0>&p<1>&p<2>) | (g<0>&p<1>&p<2>) | (g<1>&p<2>) | g<2>) || ((cin&p<0>&p<1>) | (g<0>&p<1>) | g<1>) || ((cin&p<0>) | g<0>) || cin ; out = in1 @ in2 @ cry ; gout = (g<0>&p<1>&p<2>&p<3>) | (g<1>&p<2>&p<3>) | (g<2>&p<3>) | g<3> ; pout = p<0>&p<1>&p<2>&p<3> ; } }