In many biotechnological applications, it is useful for gene expression to be regulated by multiple signals, as this allows the programming of complex behavior. Here we implement, in Escherichia coli, a system that compares the concentration of two signal molecules, and tunes GFP expression proportionally to their relative abundance. The computation is performed via molecular titration between an orthogonal σ factor and its cognate anti-σ factor. We use mathematical modeling and experiments to show that the computation system is predictable and able to adapt GFP expression dynamically to a wide range of combinations of the two signals, and our model qualitatively captures most of these behaviors. We also demonstrate in silico the practical applicability of the system as a reference-comparator, which compares an intrinsic signal (reflecting the state of the system) with an extrinsic signal (reflecting the desired reference state) in a multicellular feedback control strategy.