import numpy as np
from qiskit import *
%matplotlib inline
from qiskit.tools.visualization import plot_histogram

s = 101011

from qiskit import *

qc = QuantumCircuit(6+1,6)
qc.h([0,1,2,3,4,5])
qc.draw('mpl')

qc.x(6)
qc.h(6)
qc.barrier()
qc.draw('mpl')

qc.cx(5, 6)
qc.cx(3, 6)
qc.cx(1, 6)
qc.cx(0, 6)
qc.barrier()
qc.draw('mpl')

qc.h([0,1,2,3,4,5])
qc.draw('mpl')

qc.measure([0,1,2,3,4,5], [0,1,2,3,4,5])
qc.draw('mpl')

simulator = Aer.get_backend('qasm_simulator')
result = execute(qc, backend = simulator, shots = 1).result()
counts =result.get_counts()
print(counts)