Scientists have used biological tissue to recreate one of the main components of a modern computer inside living cells.

The biological device behaves like a transistor, one of the tiny switches that are etched on to microchips in the billions to perform computer calculations.

The researchers demonstrated the device inside E coli bacteria, one of the most common bugs used in genetic engineering. The work marks one of the latest advances in the growing field of synthetic biology, which recasts biology as a toolset for engineers.

Writing in the journal Science, researchers at Stanford University explain how their biological transistors could be connected together inside living cells to perform computing jobs such as controlling how genes are expressed in an organism.

Led by Drew Endy, a pioneer in the field, the team showed that different arrangements of biological transistors worked like logic gates, which take input signals and process them into different outputs. In keeping with their heritage, Endy calls these arrangements Boolean Integrase Logic (BIL) gates.

Normal transistors control the flow of electrons along metal wires. In the biological device, dubbed a "transcriptor", the wire is a strand of DNA and the electrons are replaced by an enzyme.

A modern computer chip holds several billion transistors that are wired together to carry out calculations. The same can be achieved with transcriptors, each of which is built from about 150 letters of the genetic code.

Scientists hope to build computers within living cells that perform useful jobs. "The first things that can be done are more precise biosensing. You could see if a cell has been exposed to different combinations of chemicals, and have a specific signal only when a certain pattern of interest shows up, say glucose and caffeine," said Jerome Bonnet, the first author on the paper.

"In the longer term we hope biocomputers can be used to study and reprogram living systems and improve cellular therapeutics," he said. Cellular therapeutics is a field of medicine that draws on genetics and cell biology to regenerate and replace dead or diseased tissues and organs.

As part of an ongoing effort among synthetic biologists to build up a stock of components, the Stanford team has made the designs for the transcriptor and BIL gates public and free to use. "Most of biotechnology has not yet been imagined, let alone made true. By freely sharing important basic tools, everyone can work better together," Bonnet said.

Last year the UK government invested more than £100m in technology designed in part to help Britain compete in a market for synthetic biology potentially worth $100bn. The Pentagon has invested heavily too and asked scientists to pitch for funds to back projects that range from chemical sensing to new ways to detect enemy troops.