The invention provides a method for constructing a half
adder and a half subtracter based on the interaction between a
cyanine dye and
metal ions, and the method is characterized by comprising the steps: a
cyanine dye solution and
DNA double strands are taken as templates,
Tris-HCl buffer solutions with different pH values and
metal ion solutions are taken as two parallel paths of input signals, the
DNA double strands are induced into four-strand structures under regulation and control of the
Tris-HCl buffer solutions and the
metal ions, the
cyanine dye interacts with the
DNA four-strand structure through non-
covalent bond acting force to generate spectral signals, and the
ultraviolet absorption values and / or
fluorescence intensities of the cyanine dye are taken as output signals to construct the half
adder or half subtracter. The half
adder or half subtracter constructed by the scheme has good molecular logic circuit property, high sensitivity, large on off ratio, easy differentiation and low threshold of 0.3. The detection of the output signals is easy and can be realized by an absorption /
fluorescence spectra instrument, and the
ion concentration of a solution can be detected efficiently, sensitively, simply and rapidly.