--- 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 Cookbook__x4_encoder_8b10b__part2 is 
  Port (
    pi27,pi26,pi25,pi24,pi23,pi02,pi22,pi21,pi20, CLK: in std_logic;
    po21,po22,po24,po25,po26,po27,po28,po29: inout std_logic
  );
end Cookbook__x4_encoder_8b10b__part2;

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

signal lo20,lo21,lo22,lo23,lo24,lo25,lo27,lo28,n544,n545,n546,n547,n548,n549,n550,n551,n552,n553,li20,n555,n556,n557,n558,n559,n560,n561,n562,n563,n564,n565,li21,n567,n568,n569,n570,n571,n572,n573,n574,n575,n576,li22,n578,n579,n580,n581,n582,n583,n584,n585,n586,n587,li23,n589,n590,n591,n592,n593,li24,n595,n596,n597,n598,n599,n600,n601,n602,n603,n604,n605,n606,n607,n608,n609,n610,n611,n612,n613,li25,n615,n616,n617,n618,n619,n620,n621,n622,n623,n624,n625,n626,n627,n628,n629,n630,n631,n632,n633,n634,n635,n636,n637,n638,li27,li28: std_logic;
begin
    DFF0: DFF port map (li20, CLK, lo20);
    DFF1: DFF port map (li21, CLK, lo21);
    DFF2: DFF port map (li22, CLK, lo22);
    DFF3: DFF port map (li23, CLK, lo23);
    DFF4: DFF port map (li24, CLK, lo24);
    DFF5: DFF port map (li25, CLK, lo25);
    DFF6: DFF port map (li27, CLK, lo27);
    DFF7: DFF port map (li28, CLK, lo28);
    n544 <= not (( pi27 and not pi26 ));
    n545 <= not (( not pi27 and pi26 ));
    n546 <= ( n544 and not pi25 )
      or ( n545 and pi25 );
    n547 <= not (( not pi27 and pi26 ));
    n548 <= ( pi27 and not pi26 );
    n549 <= ( n547 and not pi25 )
      or ( n548 and pi25 );
    n550 <= ( n546 and not pi24 )
      or ( n549 and pi24 );
    n551 <= not (( not pi27 and pi26 ));
    n552 <= ( n551 and not pi25 )
      or ( pi27 and pi25 );
    n553 <= ( pi27 and not pi24 )
      or ( n552 and pi24 );
    li20 <= ( n550 and not pi23 )
      or ( n553 and pi23 );
    n555 <= not (( pi27 and not pi26 ));
    n556 <= ( pi27 and not pi25 )
      or ( n555 and pi25 );
    n557 <= not (( pi27 and not pi26 ));
    n558 <= ( n557 and not pi25 )
      or ( pi26 and pi25 );
    n559 <= ( n556 and not pi24 )
      or ( n558 and pi24 );
    n560 <= not (( pi27 and not pi26 ));
    n561 <= ( n560 and not pi25 )
      or ( pi26 and pi25 );
    n562 <= not (( pi27 and not pi26 ));
    n563 <= ( not pi27 and pi26 );
    n564 <= ( n562 and not pi25 )
      or ( n563 and pi25 );
    n565 <= ( n561 and not pi24 )
      or ( n564 and pi24 );
    li21 <= ( n559 and not pi23 )
      or ( n565 and pi23 );
    n567 <= ( not pi27 and pi26 )
      or ( pi27 and not pi26 );
    n568 <= not (( not pi27 and not pi26 ));
    n569 <= ( n567 and not pi25 )
      or ( n568 and pi25 );
    n570 <= ( not pi27 and not pi26 );
    n571 <= not (( pi27 and pi26 ));
    n572 <= ( n570 and not pi25 )
      or ( n571 and pi25 );
    n573 <= ( n569 and not pi24 )
      or ( n572 and pi24 );
    n574 <= ( not pi27 and not pi26 );
    n575 <= not (( not n574 and not pi25 ));
    n576 <= ( n575 and not pi24 )
      or ( pi25 and pi24 );
    li22 <= ( n573 and not pi23 )
      or ( n576 and pi23 );
    n578 <= not (( pi27 and pi26 ));
    n579 <= ( not pi27 and not pi26 );
    n580 <= ( n578 and not pi25 )
      or ( n579 and pi25 );
    n581 <= not (( not pi27 and not pi26 ));
    n582 <= not (( not n581 and not pi25 ));
    n583 <= ( n580 and not pi24 )
      or ( n582 and pi24 );
    n584 <= not (( not pi27 and not pi26 ));
    n585 <= not (( pi27 and pi26 ));
    n586 <= ( n584 and not pi25 )
      or ( n585 and pi25 );
    n587 <= ( n586 and pi24 );
    li23 <= ( n583 and not pi23 )
      or ( n587 and pi23 );
    n589 <= ( not pi27 and not pi26 );
    n590 <= ( n589 and not pi25 );
    n591 <= ( pi27 and pi26 );
    n592 <= ( n591 and pi25 );
    n593 <= ( n590 and not pi24 )
      or ( n592 and pi24 );
    li24 <= not (( not n593 and not pi23 ));
    n595 <= not (( pi27 and pi26 ));
    n596 <= not (( not n595 and pi25 ));
    n597 <= not (( pi27 and pi26 ));
    n598 <= ( not pi27 and not pi26 )
      or ( pi27 and pi26 );
    n599 <= ( n597 and not pi25 )
      or ( n598 and pi25 );
    n600 <= ( n596 and not pi24 )
      or ( n599 and pi24 );
    n601 <= not (( not pi02 and pi27 ));
    n602 <= not (( not n601 and pi26 ));
    n603 <= not (( not pi02 and pi27 ));
    n604 <= ( pi02 and not pi27 );
    n605 <= ( n603 and not pi26 )
      or ( n604 and pi26 );
    n606 <= ( n602 and not pi25 )
      or ( n605 and pi25 );
    n607 <= not (( not pi02 and pi27 ));
    n608 <= ( pi02 and not pi27 );
    n609 <= ( n607 and not pi26 )
      or ( n608 and pi26 );
    n610 <= ( pi02 and not pi27 );
    n611 <= ( n610 and not pi26 )
      or ( pi27 and pi26 );
    n612 <= ( n609 and not pi25 )
      or ( n611 and pi25 );
    n613 <= ( n606 and not pi24 )
      or ( n612 and pi24 );
    li25 <= ( n600 and not pi23 )
      or ( n613 and pi23 );
    n615 <= not (( pi27 and pi26 ));
    n616 <= ( not pi27 and not pi26 );
    n617 <= ( n615 and not pi25 )
      or ( n616 and pi25 );
    n618 <= ( not pi27 and not pi26 );
    n619 <= ( pi27 and pi26 );
    n620 <= ( n618 and not pi25 )
      or ( n619 and pi25 );
    n621 <= ( n617 and not pi24 )
      or ( n620 and pi24 );
    n622 <= ( not pi27 and not pi26 );
    n623 <= ( pi27 and pi26 );
    n624 <= ( n622 and not pi25 )
      or ( n623 and pi25 );
    n625 <= ( not pi27 and not pi26 )
      or ( pi27 and pi26 );
    n626 <= not (( not pi27 and not pi26 ));
    n627 <= ( n625 and not pi25 )
      or ( n626 and pi25 );
    n628 <= ( n624 and not pi24 )
      or ( n627 and pi24 );
    n629 <= ( n621 and not pi23 )
      or ( n628 and pi23 );
    n630 <= ( not pi22 and not pi21 );
    n631 <= ( pi22 and pi21 );
    n632 <= ( not pi22 and pi21 )
      or ( pi22 and not pi21 );
    n633 <= ( n632 and pi02 );
    n634 <= not (( not n629 and not pi02 ));
    n635 <= not (( not n630 and not n633 ));
    n636 <= ( n635 and not n634 )
      or ( n631 and n634 );
    n637 <= ( not pi22 and not pi20 );
    n638 <= ( not n637 and not pi21 );
    li27 <= ( not n638 and not n636 )
      or ( n638 and n636 );
    li28 <= ( not pi20 and n636 )
      or ( pi20 and not n636 );
    po21 <= ( lo28 );
    po22 <= ( lo27 );
    po24 <= ( lo25 );
    po25 <= ( lo24 );
    po26 <= ( lo23 );
    po27 <= ( lo22 );
    po28 <= ( lo21 );
    po29 <= ( lo20 );
end Cookbook__x4_encoder_8b10b__part2_behav;
