Molecular-level information processing is essential for 'smart' in vivo nanosystems. Natural molecular computing, such as the regulation of messenger RNA (mRNA) synthesis by special proteins called transcription factors, has inspired engineered systems that can control the levels of mRNA with certain combinations of transcription factors. Here, we show an alternative approach to achieving general-purpose control of mRNA and protein levels by logic integration of transcription factor input signals in mammalian cells. The transcription factors regulate synthetic genes coding for small regulatory RNAs (called microRNAs), which, in turn, control the mRNA of interest (the output) via an RNA interference pathway. The simplicity of these modular interactions makes it possible, in theory, to implement any arbitrary logic relation between the transcription factors and the output. We construct, test and optimize increasingly complex circuits with up to three transcription factor inputs, establishing a platform for in vivo molecular computing.