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

entity Cookbook__bitscan is 
  Port (
    pi00,pi01,pi02,pi03,pi04,pi05,pi06,pi07,pi08,pi09,pi10,pi11,pi12,pi13,pi14,pi15: in std_logic;
    po00,po01,po02,po03,po04,po05,po06,po07,po08,po09,po10,po11,po12,po13,po14: inout std_logic
  );
end Cookbook__bitscan;

architecture Cookbook__bitscan_behav of Cookbook__bitscan is
signal n31,n32,n33,n34,n35,n36,n37,n38,n39,n40,n41,n42,n43,n44,n45,n46,n47,n48,n49,n50,n51,n52,n53,n54,n55,n56,n57,n58,n59: std_logic;
begin
    n31 <= ( not pi15 and not pi14 )
      or ( pi15 and pi14 );
    n32 <= not (( not pi15 and not pi14 ));
    n33 <= ( not n32 and not pi13 )
      or ( n32 and pi13 );
    n34 <= not (( not n32 and not pi13 ));
    n35 <= ( not n34 and not pi12 )
      or ( n34 and pi12 );
    n36 <= not (( not n34 and not pi12 ));
    n37 <= ( not n36 and not pi11 )
      or ( n36 and pi11 );
    n38 <= not (( not n36 and not pi11 ));
    n39 <= ( not n38 and not pi10 )
      or ( n38 and pi10 );
    n40 <= not (( not n38 and not pi10 ));
    n41 <= ( not n40 and not pi09 )
      or ( n40 and pi09 );
    n42 <= not (( not n40 and not pi09 ));
    n43 <= ( not n42 and not pi08 )
      or ( n42 and pi08 );
    n44 <= not (( not n42 and not pi08 ));
    n45 <= ( not n44 and not pi07 )
      or ( n44 and pi07 );
    n46 <= not (( not n44 and not pi07 ));
    n47 <= ( not n46 and not pi06 )
      or ( n46 and pi06 );
    n48 <= not (( not n46 and not pi06 ));
    n49 <= ( not n48 and not pi05 )
      or ( n48 and pi05 );
    n50 <= not (( not n48 and not pi05 ));
    n51 <= ( not n50 and not pi04 )
      or ( n50 and pi04 );
    n52 <= not (( not n50 and not pi04 ));
    n53 <= ( not n52 and not pi03 )
      or ( n52 and pi03 );
    n54 <= not (( not n52 and not pi03 ));
    n55 <= ( not n54 and not pi02 )
      or ( n54 and pi02 );
    n56 <= not (( not n54 and not pi02 ));
    n57 <= ( not n56 and not pi01 )
      or ( n56 and pi01 );
    n58 <= not (( not n56 and not pi01 ));
    n59 <= ( not n58 and not pi00 )
      or ( n58 and pi00 );
    po14 <= ( pi14 and not n31 );
    po13 <= ( pi13 and not n33 );
    po12 <= ( pi12 and not n35 );
    po11 <= ( pi11 and not n37 );
    po10 <= ( pi10 and not n39 );
    po09 <= ( pi09 and not n41 );
    po08 <= ( pi08 and not n43 );
    po07 <= ( pi07 and not n45 );
    po06 <= ( pi06 and not n47 );
    po05 <= ( pi05 and not n49 );
    po04 <= ( pi04 and not n51 );
    po03 <= ( pi03 and not n53 );
    po02 <= ( pi02 and not n55 );
    po01 <= ( pi01 and not n57 );
    po00 <= ( pi00 and not n59 );
end Cookbook__bitscan_behav;
