--- VHDL generated by LogSynth framework (c) Petr Fiser
Library IEEE;
use IEEE.std_logic_1164.all;

entity DFF is
  Port ( D, CLK: in std_logic;
     Q: out std_logic);
end DFF;

architecture Behavior of DFF is
begin
  process(CLK)
  begin
    if CLK'event and CLK = '1' then
      Q <= D;
    end if;
  end process;
end Behavior;

Library IEEE;
use IEEE.std_logic_1164.all;

entity ternary_sum_nine is 
  Port (
    pi00,pi01,pi02,pi03,pi04,pi05,pi06,pi07,pi08,pi09,pi10,pi11,pi12,pi13,pi14,pi15,pi16,pi17,pi18,pi19,pi20,pi21,pi22,pi23,pi24,pi25,pi26,pi27,pi28,pi29,pi30,pi31,pi32,pi33,pi34,pi35,pi36,pi37,pi38,pi39,pi40,pi41,pi42,pi43,pi44,pi45,pi46,pi47,pi48,pi49,pi50,pi51,pi52,pi53,pi54,pi55,pi56,pi57,pi58,pi59,pi60,pi61,pi62,pi63,pi64,pi65,pi66,pi67,pi68,pi69,pi70,pi71,pi72, CLK: in std_logic;
    po00,po01,po02,po03,po04,po05,po06,po07,po08,po09,po10,po11: inout std_logic
  );
end ternary_sum_nine;

architecture ternary_sum_nine_behav of ternary_sum_nine is
component DFF
  Port ( D, CLK: in std_logic;
     Q: out std_logic);
end component;

signal lo00,lo01,lo02,lo03,lo04,lo05,lo06,lo07,lo08,lo09,lo10,lo11,lo12,lo13,lo14,lo15,lo16,lo17,lo18,lo19,lo20,lo21,lo22,lo23,lo24,lo25,lo26,lo27,lo28,lo29,lo30,lo31,lo32,lo33,lo34,lo35,lo36,lo37,lo38,lo39,lo40,lo41,n211,n212,n213,n214,n215,n216,n217,n218,n219,n220,n221,n222,n223,n224,n225,n226,n227,li00,n229,li01,n231,li02,n233,li03,n235,li04,n237,li05,n239,li06,n241,li07,n243,li08,li09,n246,n247,n248,n249,n250,n251,n252,n253,n254,n255,n256,n257,n258,n259,n260,n261,n262,li10,n264,li11,n266,li12,n268,li13,n270,li14,n272,li15,n274,li16,n276,li17,n278,li18,li19,n281,n282,n283,n284,n285,n286,n287,n288,n289,n290,n291,n292,n293,n294,n295,n296,n297,li20,n299,li21,n301,li22,n303,li23,n305,li24,n307,li25,n309,li26,n311,li27,n313,li28,li29,n316,n317,n318,n319,n320,n321,n322,n323,n324,n325,n326,n327,n328,n329,n330,n331,n332,n333,n334,n335,n336,li30,n338,li31,n340,li32,n342,li33,n344,li34,n346,li35,n348,li36,n350,li37,n352,li38,n354,li39,n356,li40,li41: std_logic;
begin
    DFF0: DFF port map (li00, CLK, lo00);
    DFF1: DFF port map (li01, CLK, lo01);
    DFF2: DFF port map (li02, CLK, lo02);
    DFF3: DFF port map (li03, CLK, lo03);
    DFF4: DFF port map (li04, CLK, lo04);
    DFF5: DFF port map (li05, CLK, lo05);
    DFF6: DFF port map (li06, CLK, lo06);
    DFF7: DFF port map (li07, CLK, lo07);
    DFF8: DFF port map (li08, CLK, lo08);
    DFF9: DFF port map (li09, CLK, lo09);
    DFF10: DFF port map (li10, CLK, lo10);
    DFF11: DFF port map (li11, CLK, lo11);
    DFF12: DFF port map (li12, CLK, lo12);
    DFF13: DFF port map (li13, CLK, lo13);
    DFF14: DFF port map (li14, CLK, lo14);
    DFF15: DFF port map (li15, CLK, lo15);
    DFF16: DFF port map (li16, CLK, lo16);
    DFF17: DFF port map (li17, CLK, lo17);
    DFF18: DFF port map (li18, CLK, lo18);
    DFF19: DFF port map (li19, CLK, lo19);
    DFF20: DFF port map (li20, CLK, lo20);
    DFF21: DFF port map (li21, CLK, lo21);
    DFF22: DFF port map (li22, CLK, lo22);
    DFF23: DFF port map (li23, CLK, lo23);
    DFF24: DFF port map (li24, CLK, lo24);
    DFF25: DFF port map (li25, CLK, lo25);
    DFF26: DFF port map (li26, CLK, lo26);
    DFF27: DFF port map (li27, CLK, lo27);
    DFF28: DFF port map (li28, CLK, lo28);
    DFF29: DFF port map (li29, CLK, lo29);
    DFF30: DFF port map (li30, CLK, lo30);
    DFF31: DFF port map (li31, CLK, lo31);
    DFF32: DFF port map (li32, CLK, lo32);
    DFF33: DFF port map (li33, CLK, lo33);
    DFF34: DFF port map (li34, CLK, lo34);
    DFF35: DFF port map (li35, CLK, lo35);
    DFF36: DFF port map (li36, CLK, lo36);
    DFF37: DFF port map (li37, CLK, lo37);
    DFF38: DFF port map (li38, CLK, lo38);
    DFF39: DFF port map (li39, CLK, lo39);
    DFF40: DFF port map (li40, CLK, lo40);
    DFF41: DFF port map (li41, CLK, lo41);
    n211 <= '0';
    n212 <= ( not n211 and not pi08 and pi16 )
      or ( not n211 and pi08 and not pi16 )
      or ( n211 and not pi08 and not pi16 )
      or ( n211 and pi08 and pi16 );
    n213 <= ( not n211 and pi08 and pi16 )
      or ( n211 and not pi08 and pi16 )
      or ( n211 and pi08 and not pi16 )
      or ( n211 and pi08 and pi16 );
    n214 <= ( not n213 and not pi07 and pi15 )
      or ( not n213 and pi07 and not pi15 )
      or ( n213 and not pi07 and not pi15 )
      or ( n213 and pi07 and pi15 );
    n215 <= ( not n213 and pi07 and pi15 )
      or ( n213 and not pi07 and pi15 )
      or ( n213 and pi07 and not pi15 )
      or ( n213 and pi07 and pi15 );
    n216 <= ( not n215 and not pi06 and pi14 )
      or ( not n215 and pi06 and not pi14 )
      or ( n215 and not pi06 and not pi14 )
      or ( n215 and pi06 and pi14 );
    n217 <= ( not n215 and pi06 and pi14 )
      or ( n215 and not pi06 and pi14 )
      or ( n215 and pi06 and not pi14 )
      or ( n215 and pi06 and pi14 );
    n218 <= ( not n217 and not pi05 and pi13 )
      or ( not n217 and pi05 and not pi13 )
      or ( n217 and not pi05 and not pi13 )
      or ( n217 and pi05 and pi13 );
    n219 <= ( not n217 and pi05 and pi13 )
      or ( n217 and not pi05 and pi13 )
      or ( n217 and pi05 and not pi13 )
      or ( n217 and pi05 and pi13 );
    n220 <= ( not n219 and not pi04 and pi12 )
      or ( not n219 and pi04 and not pi12 )
      or ( n219 and not pi04 and not pi12 )
      or ( n219 and pi04 and pi12 );
    n221 <= ( not n219 and pi04 and pi12 )
      or ( n219 and not pi04 and pi12 )
      or ( n219 and pi04 and not pi12 )
      or ( n219 and pi04 and pi12 );
    n222 <= ( not n221 and not pi03 and pi11 )
      or ( not n221 and pi03 and not pi11 )
      or ( n221 and not pi03 and not pi11 )
      or ( n221 and pi03 and pi11 );
    n223 <= ( not n221 and pi03 and pi11 )
      or ( n221 and not pi03 and pi11 )
      or ( n221 and pi03 and not pi11 )
      or ( n221 and pi03 and pi11 );
    n224 <= ( not n223 and not pi02 and pi10 )
      or ( not n223 and pi02 and not pi10 )
      or ( n223 and not pi02 and not pi10 )
      or ( n223 and pi02 and pi10 );
    n225 <= ( not n223 and pi02 and pi10 )
      or ( n223 and not pi02 and pi10 )
      or ( n223 and pi02 and not pi10 )
      or ( n223 and pi02 and pi10 );
    n226 <= ( not n225 and not pi01 and pi09 )
      or ( not n225 and pi01 and not pi09 )
      or ( n225 and not pi01 and not pi09 )
      or ( n225 and pi01 and pi09 );
    n227 <= ( not n225 and pi01 and pi09 )
      or ( n225 and not pi01 and pi09 )
      or ( n225 and pi01 and not pi09 )
      or ( n225 and pi01 and pi09 );
    li00 <= ( not n211 and not n212 and pi24 )
      or ( not n211 and n212 and not pi24 )
      or ( n211 and not n212 and not pi24 )
      or ( n211 and n212 and pi24 );
    n229 <= ( not n211 and n212 and pi24 )
      or ( n211 and not n212 and pi24 )
      or ( n211 and n212 and not pi24 )
      or ( n211 and n212 and pi24 );
    li01 <= ( not n229 and not n214 and pi23 )
      or ( not n229 and n214 and not pi23 )
      or ( n229 and not n214 and not pi23 )
      or ( n229 and n214 and pi23 );
    n231 <= ( not n229 and n214 and pi23 )
      or ( n229 and not n214 and pi23 )
      or ( n229 and n214 and not pi23 )
      or ( n229 and n214 and pi23 );
    li02 <= ( not n231 and not n216 and pi22 )
      or ( not n231 and n216 and not pi22 )
      or ( n231 and not n216 and not pi22 )
      or ( n231 and n216 and pi22 );
    n233 <= ( not n231 and n216 and pi22 )
      or ( n231 and not n216 and pi22 )
      or ( n231 and n216 and not pi22 )
      or ( n231 and n216 and pi22 );
    li03 <= ( not n233 and not n218 and pi21 )
      or ( not n233 and n218 and not pi21 )
      or ( n233 and not n218 and not pi21 )
      or ( n233 and n218 and pi21 );
    n235 <= ( not n233 and n218 and pi21 )
      or ( n233 and not n218 and pi21 )
      or ( n233 and n218 and not pi21 )
      or ( n233 and n218 and pi21 );
    li04 <= ( not n235 and not n220 and pi20 )
      or ( not n235 and n220 and not pi20 )
      or ( n235 and not n220 and not pi20 )
      or ( n235 and n220 and pi20 );
    n237 <= ( not n235 and n220 and pi20 )
      or ( n235 and not n220 and pi20 )
      or ( n235 and n220 and not pi20 )
      or ( n235 and n220 and pi20 );
    li05 <= ( not n237 and not n222 and pi19 )
      or ( not n237 and n222 and not pi19 )
      or ( n237 and not n222 and not pi19 )
      or ( n237 and n222 and pi19 );
    n239 <= ( not n237 and n222 and pi19 )
      or ( n237 and not n222 and pi19 )
      or ( n237 and n222 and not pi19 )
      or ( n237 and n222 and pi19 );
    li06 <= ( not n239 and not n224 and pi18 )
      or ( not n239 and n224 and not pi18 )
      or ( n239 and not n224 and not pi18 )
      or ( n239 and n224 and pi18 );
    n241 <= ( not n239 and n224 and pi18 )
      or ( n239 and not n224 and pi18 )
      or ( n239 and n224 and not pi18 )
      or ( n239 and n224 and pi18 );
    li07 <= ( not n241 and not n226 and pi17 )
      or ( not n241 and n226 and not pi17 )
      or ( n241 and not n226 and not pi17 )
      or ( n241 and n226 and pi17 );
    n243 <= ( not n241 and n226 and pi17 )
      or ( n241 and not n226 and pi17 )
      or ( n241 and n226 and not pi17 )
      or ( n241 and n226 and pi17 );
    li08 <= ( not n243 and not n227 and n211 )
      or ( not n243 and n227 and not n211 )
      or ( n243 and not n227 and not n211 )
      or ( n243 and n227 and n211 );
    li09 <= ( not n243 and n227 and n211 )
      or ( n243 and not n227 and n211 )
      or ( n243 and n227 and not n211 )
      or ( n243 and n227 and n211 );
    n246 <= '0';
    n247 <= ( not n246 and not pi32 and pi40 )
      or ( not n246 and pi32 and not pi40 )
      or ( n246 and not pi32 and not pi40 )
      or ( n246 and pi32 and pi40 );
    n248 <= ( not n246 and pi32 and pi40 )
      or ( n246 and not pi32 and pi40 )
      or ( n246 and pi32 and not pi40 )
      or ( n246 and pi32 and pi40 );
    n249 <= ( not n248 and not pi31 and pi39 )
      or ( not n248 and pi31 and not pi39 )
      or ( n248 and not pi31 and not pi39 )
      or ( n248 and pi31 and pi39 );
    n250 <= ( not n248 and pi31 and pi39 )
      or ( n248 and not pi31 and pi39 )
      or ( n248 and pi31 and not pi39 )
      or ( n248 and pi31 and pi39 );
    n251 <= ( not n250 and not pi30 and pi38 )
      or ( not n250 and pi30 and not pi38 )
      or ( n250 and not pi30 and not pi38 )
      or ( n250 and pi30 and pi38 );
    n252 <= ( not n250 and pi30 and pi38 )
      or ( n250 and not pi30 and pi38 )
      or ( n250 and pi30 and not pi38 )
      or ( n250 and pi30 and pi38 );
    n253 <= ( not n252 and not pi29 and pi37 )
      or ( not n252 and pi29 and not pi37 )
      or ( n252 and not pi29 and not pi37 )
      or ( n252 and pi29 and pi37 );
    n254 <= ( not n252 and pi29 and pi37 )
      or ( n252 and not pi29 and pi37 )
      or ( n252 and pi29 and not pi37 )
      or ( n252 and pi29 and pi37 );
    n255 <= ( not n254 and not pi28 and pi36 )
      or ( not n254 and pi28 and not pi36 )
      or ( n254 and not pi28 and not pi36 )
      or ( n254 and pi28 and pi36 );
    n256 <= ( not n254 and pi28 and pi36 )
      or ( n254 and not pi28 and pi36 )
      or ( n254 and pi28 and not pi36 )
      or ( n254 and pi28 and pi36 );
    n257 <= ( not n256 and not pi27 and pi35 )
      or ( not n256 and pi27 and not pi35 )
      or ( n256 and not pi27 and not pi35 )
      or ( n256 and pi27 and pi35 );
    n258 <= ( not n256 and pi27 and pi35 )
      or ( n256 and not pi27 and pi35 )
      or ( n256 and pi27 and not pi35 )
      or ( n256 and pi27 and pi35 );
    n259 <= ( not n258 and not pi26 and pi34 )
      or ( not n258 and pi26 and not pi34 )
      or ( n258 and not pi26 and not pi34 )
      or ( n258 and pi26 and pi34 );
    n260 <= ( not n258 and pi26 and pi34 )
      or ( n258 and not pi26 and pi34 )
      or ( n258 and pi26 and not pi34 )
      or ( n258 and pi26 and pi34 );
    n261 <= ( not n260 and not pi25 and pi33 )
      or ( not n260 and pi25 and not pi33 )
      or ( n260 and not pi25 and not pi33 )
      or ( n260 and pi25 and pi33 );
    n262 <= ( not n260 and pi25 and pi33 )
      or ( n260 and not pi25 and pi33 )
      or ( n260 and pi25 and not pi33 )
      or ( n260 and pi25 and pi33 );
    li10 <= ( not n246 and not n247 and pi48 )
      or ( not n246 and n247 and not pi48 )
      or ( n246 and not n247 and not pi48 )
      or ( n246 and n247 and pi48 );
    n264 <= ( not n246 and n247 and pi48 )
      or ( n246 and not n247 and pi48 )
      or ( n246 and n247 and not pi48 )
      or ( n246 and n247 and pi48 );
    li11 <= ( not n264 and not n249 and pi47 )
      or ( not n264 and n249 and not pi47 )
      or ( n264 and not n249 and not pi47 )
      or ( n264 and n249 and pi47 );
    n266 <= ( not n264 and n249 and pi47 )
      or ( n264 and not n249 and pi47 )
      or ( n264 and n249 and not pi47 )
      or ( n264 and n249 and pi47 );
    li12 <= ( not n266 and not n251 and pi46 )
      or ( not n266 and n251 and not pi46 )
      or ( n266 and not n251 and not pi46 )
      or ( n266 and n251 and pi46 );
    n268 <= ( not n266 and n251 and pi46 )
      or ( n266 and not n251 and pi46 )
      or ( n266 and n251 and not pi46 )
      or ( n266 and n251 and pi46 );
    li13 <= ( not n268 and not n253 and pi45 )
      or ( not n268 and n253 and not pi45 )
      or ( n268 and not n253 and not pi45 )
      or ( n268 and n253 and pi45 );
    n270 <= ( not n268 and n253 and pi45 )
      or ( n268 and not n253 and pi45 )
      or ( n268 and n253 and not pi45 )
      or ( n268 and n253 and pi45 );
    li14 <= ( not n270 and not n255 and pi44 )
      or ( not n270 and n255 and not pi44 )
      or ( n270 and not n255 and not pi44 )
      or ( n270 and n255 and pi44 );
    n272 <= ( not n270 and n255 and pi44 )
      or ( n270 and not n255 and pi44 )
      or ( n270 and n255 and not pi44 )
      or ( n270 and n255 and pi44 );
    li15 <= ( not n272 and not n257 and pi43 )
      or ( not n272 and n257 and not pi43 )
      or ( n272 and not n257 and not pi43 )
      or ( n272 and n257 and pi43 );
    n274 <= ( not n272 and n257 and pi43 )
      or ( n272 and not n257 and pi43 )
      or ( n272 and n257 and not pi43 )
      or ( n272 and n257 and pi43 );
    li16 <= ( not n274 and not n259 and pi42 )
      or ( not n274 and n259 and not pi42 )
      or ( n274 and not n259 and not pi42 )
      or ( n274 and n259 and pi42 );
    n276 <= ( not n274 and n259 and pi42 )
      or ( n274 and not n259 and pi42 )
      or ( n274 and n259 and not pi42 )
      or ( n274 and n259 and pi42 );
    li17 <= ( not n276 and not n261 and pi41 )
      or ( not n276 and n261 and not pi41 )
      or ( n276 and not n261 and not pi41 )
      or ( n276 and n261 and pi41 );
    n278 <= ( not n276 and n261 and pi41 )
      or ( n276 and not n261 and pi41 )
      or ( n276 and n261 and not pi41 )
      or ( n276 and n261 and pi41 );
    li18 <= ( not n278 and not n262 and n246 )
      or ( not n278 and n262 and not n246 )
      or ( n278 and not n262 and not n246 )
      or ( n278 and n262 and n246 );
    li19 <= ( not n278 and n262 and n246 )
      or ( n278 and not n262 and n246 )
      or ( n278 and n262 and not n246 )
      or ( n278 and n262 and n246 );
    n281 <= '0';
    n282 <= ( not n281 and not pi56 and pi64 )
      or ( not n281 and pi56 and not pi64 )
      or ( n281 and not pi56 and not pi64 )
      or ( n281 and pi56 and pi64 );
    n283 <= ( not n281 and pi56 and pi64 )
      or ( n281 and not pi56 and pi64 )
      or ( n281 and pi56 and not pi64 )
      or ( n281 and pi56 and pi64 );
    n284 <= ( not n283 and not pi55 and pi63 )
      or ( not n283 and pi55 and not pi63 )
      or ( n283 and not pi55 and not pi63 )
      or ( n283 and pi55 and pi63 );
    n285 <= ( not n283 and pi55 and pi63 )
      or ( n283 and not pi55 and pi63 )
      or ( n283 and pi55 and not pi63 )
      or ( n283 and pi55 and pi63 );
    n286 <= ( not n285 and not pi54 and pi62 )
      or ( not n285 and pi54 and not pi62 )
      or ( n285 and not pi54 and not pi62 )
      or ( n285 and pi54 and pi62 );
    n287 <= ( not n285 and pi54 and pi62 )
      or ( n285 and not pi54 and pi62 )
      or ( n285 and pi54 and not pi62 )
      or ( n285 and pi54 and pi62 );
    n288 <= ( not n287 and not pi53 and pi61 )
      or ( not n287 and pi53 and not pi61 )
      or ( n287 and not pi53 and not pi61 )
      or ( n287 and pi53 and pi61 );
    n289 <= ( not n287 and pi53 and pi61 )
      or ( n287 and not pi53 and pi61 )
      or ( n287 and pi53 and not pi61 )
      or ( n287 and pi53 and pi61 );
    n290 <= ( not n289 and not pi52 and pi60 )
      or ( not n289 and pi52 and not pi60 )
      or ( n289 and not pi52 and not pi60 )
      or ( n289 and pi52 and pi60 );
    n291 <= ( not n289 and pi52 and pi60 )
      or ( n289 and not pi52 and pi60 )
      or ( n289 and pi52 and not pi60 )
      or ( n289 and pi52 and pi60 );
    n292 <= ( not n291 and not pi51 and pi59 )
      or ( not n291 and pi51 and not pi59 )
      or ( n291 and not pi51 and not pi59 )
      or ( n291 and pi51 and pi59 );
    n293 <= ( not n291 and pi51 and pi59 )
      or ( n291 and not pi51 and pi59 )
      or ( n291 and pi51 and not pi59 )
      or ( n291 and pi51 and pi59 );
    n294 <= ( not n293 and not pi50 and pi58 )
      or ( not n293 and pi50 and not pi58 )
      or ( n293 and not pi50 and not pi58 )
      or ( n293 and pi50 and pi58 );
    n295 <= ( not n293 and pi50 and pi58 )
      or ( n293 and not pi50 and pi58 )
      or ( n293 and pi50 and not pi58 )
      or ( n293 and pi50 and pi58 );
    n296 <= ( not n295 and not pi49 and pi57 )
      or ( not n295 and pi49 and not pi57 )
      or ( n295 and not pi49 and not pi57 )
      or ( n295 and pi49 and pi57 );
    n297 <= ( not n295 and pi49 and pi57 )
      or ( n295 and not pi49 and pi57 )
      or ( n295 and pi49 and not pi57 )
      or ( n295 and pi49 and pi57 );
    li20 <= ( not n281 and not n282 and pi72 )
      or ( not n281 and n282 and not pi72 )
      or ( n281 and not n282 and not pi72 )
      or ( n281 and n282 and pi72 );
    n299 <= ( not n281 and n282 and pi72 )
      or ( n281 and not n282 and pi72 )
      or ( n281 and n282 and not pi72 )
      or ( n281 and n282 and pi72 );
    li21 <= ( not n299 and not n284 and pi71 )
      or ( not n299 and n284 and not pi71 )
      or ( n299 and not n284 and not pi71 )
      or ( n299 and n284 and pi71 );
    n301 <= ( not n299 and n284 and pi71 )
      or ( n299 and not n284 and pi71 )
      or ( n299 and n284 and not pi71 )
      or ( n299 and n284 and pi71 );
    li22 <= ( not n301 and not n286 and pi70 )
      or ( not n301 and n286 and not pi70 )
      or ( n301 and not n286 and not pi70 )
      or ( n301 and n286 and pi70 );
    n303 <= ( not n301 and n286 and pi70 )
      or ( n301 and not n286 and pi70 )
      or ( n301 and n286 and not pi70 )
      or ( n301 and n286 and pi70 );
    li23 <= ( not n303 and not n288 and pi69 )
      or ( not n303 and n288 and not pi69 )
      or ( n303 and not n288 and not pi69 )
      or ( n303 and n288 and pi69 );
    n305 <= ( not n303 and n288 and pi69 )
      or ( n303 and not n288 and pi69 )
      or ( n303 and n288 and not pi69 )
      or ( n303 and n288 and pi69 );
    li24 <= ( not n305 and not n290 and pi68 )
      or ( not n305 and n290 and not pi68 )
      or ( n305 and not n290 and not pi68 )
      or ( n305 and n290 and pi68 );
    n307 <= ( not n305 and n290 and pi68 )
      or ( n305 and not n290 and pi68 )
      or ( n305 and n290 and not pi68 )
      or ( n305 and n290 and pi68 );
    li25 <= ( not n307 and not n292 and pi67 )
      or ( not n307 and n292 and not pi67 )
      or ( n307 and not n292 and not pi67 )
      or ( n307 and n292 and pi67 );
    n309 <= ( not n307 and n292 and pi67 )
      or ( n307 and not n292 and pi67 )
      or ( n307 and n292 and not pi67 )
      or ( n307 and n292 and pi67 );
    li26 <= ( not n309 and not n294 and pi66 )
      or ( not n309 and n294 and not pi66 )
      or ( n309 and not n294 and not pi66 )
      or ( n309 and n294 and pi66 );
    n311 <= ( not n309 and n294 and pi66 )
      or ( n309 and not n294 and pi66 )
      or ( n309 and n294 and not pi66 )
      or ( n309 and n294 and pi66 );
    li27 <= ( not n311 and not n296 and pi65 )
      or ( not n311 and n296 and not pi65 )
      or ( n311 and not n296 and not pi65 )
      or ( n311 and n296 and pi65 );
    n313 <= ( not n311 and n296 and pi65 )
      or ( n311 and not n296 and pi65 )
      or ( n311 and n296 and not pi65 )
      or ( n311 and n296 and pi65 );
    li28 <= ( not n313 and not n297 and n281 )
      or ( not n313 and n297 and not n281 )
      or ( n313 and not n297 and not n281 )
      or ( n313 and n297 and n281 );
    li29 <= ( not n313 and n297 and n281 )
      or ( n313 and not n297 and n281 )
      or ( n313 and n297 and not n281 )
      or ( n313 and n297 and n281 );
    n316 <= '0';
    n317 <= ( not n316 and not lo00 and lo10 )
      or ( not n316 and lo00 and not lo10 )
      or ( n316 and not lo00 and not lo10 )
      or ( n316 and lo00 and lo10 );
    n318 <= ( not n316 and lo00 and lo10 )
      or ( n316 and not lo00 and lo10 )
      or ( n316 and lo00 and not lo10 )
      or ( n316 and lo00 and lo10 );
    n319 <= ( not n318 and not lo01 and lo11 )
      or ( not n318 and lo01 and not lo11 )
      or ( n318 and not lo01 and not lo11 )
      or ( n318 and lo01 and lo11 );
    n320 <= ( not n318 and lo01 and lo11 )
      or ( n318 and not lo01 and lo11 )
      or ( n318 and lo01 and not lo11 )
      or ( n318 and lo01 and lo11 );
    n321 <= ( not n320 and not lo02 and lo12 )
      or ( not n320 and lo02 and not lo12 )
      or ( n320 and not lo02 and not lo12 )
      or ( n320 and lo02 and lo12 );
    n322 <= ( not n320 and lo02 and lo12 )
      or ( n320 and not lo02 and lo12 )
      or ( n320 and lo02 and not lo12 )
      or ( n320 and lo02 and lo12 );
    n323 <= ( not n322 and not lo03 and lo13 )
      or ( not n322 and lo03 and not lo13 )
      or ( n322 and not lo03 and not lo13 )
      or ( n322 and lo03 and lo13 );
    n324 <= ( not n322 and lo03 and lo13 )
      or ( n322 and not lo03 and lo13 )
      or ( n322 and lo03 and not lo13 )
      or ( n322 and lo03 and lo13 );
    n325 <= ( not n324 and not lo04 and lo14 )
      or ( not n324 and lo04 and not lo14 )
      or ( n324 and not lo04 and not lo14 )
      or ( n324 and lo04 and lo14 );
    n326 <= ( not n324 and lo04 and lo14 )
      or ( n324 and not lo04 and lo14 )
      or ( n324 and lo04 and not lo14 )
      or ( n324 and lo04 and lo14 );
    n327 <= ( not n326 and not lo05 and lo15 )
      or ( not n326 and lo05 and not lo15 )
      or ( n326 and not lo05 and not lo15 )
      or ( n326 and lo05 and lo15 );
    n328 <= ( not n326 and lo05 and lo15 )
      or ( n326 and not lo05 and lo15 )
      or ( n326 and lo05 and not lo15 )
      or ( n326 and lo05 and lo15 );
    n329 <= ( not n328 and not lo06 and lo16 )
      or ( not n328 and lo06 and not lo16 )
      or ( n328 and not lo06 and not lo16 )
      or ( n328 and lo06 and lo16 );
    n330 <= ( not n328 and lo06 and lo16 )
      or ( n328 and not lo06 and lo16 )
      or ( n328 and lo06 and not lo16 )
      or ( n328 and lo06 and lo16 );
    n331 <= ( not n330 and not lo07 and lo17 )
      or ( not n330 and lo07 and not lo17 )
      or ( n330 and not lo07 and not lo17 )
      or ( n330 and lo07 and lo17 );
    n332 <= ( not n330 and lo07 and lo17 )
      or ( n330 and not lo07 and lo17 )
      or ( n330 and lo07 and not lo17 )
      or ( n330 and lo07 and lo17 );
    n333 <= ( not n332 and not lo08 and lo18 )
      or ( not n332 and lo08 and not lo18 )
      or ( n332 and not lo08 and not lo18 )
      or ( n332 and lo08 and lo18 );
    n334 <= ( not n332 and lo08 and lo18 )
      or ( n332 and not lo08 and lo18 )
      or ( n332 and lo08 and not lo18 )
      or ( n332 and lo08 and lo18 );
    n335 <= ( not n334 and not lo09 and lo19 )
      or ( not n334 and lo09 and not lo19 )
      or ( n334 and not lo09 and not lo19 )
      or ( n334 and lo09 and lo19 );
    n336 <= ( not n334 and lo09 and lo19 )
      or ( n334 and not lo09 and lo19 )
      or ( n334 and lo09 and not lo19 )
      or ( n334 and lo09 and lo19 );
    li30 <= ( not n316 and not n317 and lo20 )
      or ( not n316 and n317 and not lo20 )
      or ( n316 and not n317 and not lo20 )
      or ( n316 and n317 and lo20 );
    n338 <= ( not n316 and n317 and lo20 )
      or ( n316 and not n317 and lo20 )
      or ( n316 and n317 and not lo20 )
      or ( n316 and n317 and lo20 );
    li31 <= ( not n338 and not n319 and lo21 )
      or ( not n338 and n319 and not lo21 )
      or ( n338 and not n319 and not lo21 )
      or ( n338 and n319 and lo21 );
    n340 <= ( not n338 and n319 and lo21 )
      or ( n338 and not n319 and lo21 )
      or ( n338 and n319 and not lo21 )
      or ( n338 and n319 and lo21 );
    li32 <= ( not n340 and not n321 and lo22 )
      or ( not n340 and n321 and not lo22 )
      or ( n340 and not n321 and not lo22 )
      or ( n340 and n321 and lo22 );
    n342 <= ( not n340 and n321 and lo22 )
      or ( n340 and not n321 and lo22 )
      or ( n340 and n321 and not lo22 )
      or ( n340 and n321 and lo22 );
    li33 <= ( not n342 and not n323 and lo23 )
      or ( not n342 and n323 and not lo23 )
      or ( n342 and not n323 and not lo23 )
      or ( n342 and n323 and lo23 );
    n344 <= ( not n342 and n323 and lo23 )
      or ( n342 and not n323 and lo23 )
      or ( n342 and n323 and not lo23 )
      or ( n342 and n323 and lo23 );
    li34 <= ( not n344 and not n325 and lo24 )
      or ( not n344 and n325 and not lo24 )
      or ( n344 and not n325 and not lo24 )
      or ( n344 and n325 and lo24 );
    n346 <= ( not n344 and n325 and lo24 )
      or ( n344 and not n325 and lo24 )
      or ( n344 and n325 and not lo24 )
      or ( n344 and n325 and lo24 );
    li35 <= ( not n346 and not n327 and lo25 )
      or ( not n346 and n327 and not lo25 )
      or ( n346 and not n327 and not lo25 )
      or ( n346 and n327 and lo25 );
    n348 <= ( not n346 and n327 and lo25 )
      or ( n346 and not n327 and lo25 )
      or ( n346 and n327 and not lo25 )
      or ( n346 and n327 and lo25 );
    li36 <= ( not n348 and not n329 and lo26 )
      or ( not n348 and n329 and not lo26 )
      or ( n348 and not n329 and not lo26 )
      or ( n348 and n329 and lo26 );
    n350 <= ( not n348 and n329 and lo26 )
      or ( n348 and not n329 and lo26 )
      or ( n348 and n329 and not lo26 )
      or ( n348 and n329 and lo26 );
    li37 <= ( not n350 and not n331 and lo27 )
      or ( not n350 and n331 and not lo27 )
      or ( n350 and not n331 and not lo27 )
      or ( n350 and n331 and lo27 );
    n352 <= ( not n350 and n331 and lo27 )
      or ( n350 and not n331 and lo27 )
      or ( n350 and n331 and not lo27 )
      or ( n350 and n331 and lo27 );
    li38 <= ( not n352 and not n333 and lo28 )
      or ( not n352 and n333 and not lo28 )
      or ( n352 and not n333 and not lo28 )
      or ( n352 and n333 and lo28 );
    n354 <= ( not n352 and n333 and lo28 )
      or ( n352 and not n333 and lo28 )
      or ( n352 and n333 and not lo28 )
      or ( n352 and n333 and lo28 );
    li39 <= ( not n354 and not n335 and lo29 )
      or ( not n354 and n335 and not lo29 )
      or ( n354 and not n335 and not lo29 )
      or ( n354 and n335 and lo29 );
    n356 <= ( not n354 and n335 and lo29 )
      or ( n354 and not n335 and lo29 )
      or ( n354 and n335 and not lo29 )
      or ( n354 and n335 and lo29 );
    li40 <= ( not n356 and not n336 and n316 )
      or ( not n356 and n336 and not n316 )
      or ( n356 and not n336 and not n316 )
      or ( n356 and n336 and n316 );
    li41 <= ( not n356 and n336 and n316 )
      or ( n356 and not n336 and n316 )
      or ( n356 and n336 and not n316 )
      or ( n356 and n336 and n316 );
    po00 <= ( lo41 );
    po01 <= ( lo40 );
    po02 <= ( lo39 );
    po03 <= ( lo38 );
    po04 <= ( lo37 );
    po05 <= ( lo36 );
    po06 <= ( lo35 );
    po07 <= ( lo34 );
    po08 <= ( lo33 );
    po09 <= ( lo32 );
    po10 <= ( lo31 );
    po11 <= ( lo30 );
end ternary_sum_nine_behav;
