decodedscience
  • オンラインカジノ
  • 私たちについて

Comparing the Genetic Code of DNA to Binary Code

August 25, 2015 by Mike DeHaan 15 Comments

Share621
Share19
+13
Pin1
Tweet
644 Shares
Diagram of the structure of DNA, with strands holding the base pairs.

This illustrates the structure of DNA, with strands holding the base pairs. Image by U.S. National Library of Medicine.

Does DNA store information in the same way that a computer stores data? What are the similarities or differences?

We need to discuss “What is DNA?” and “What is the genetic code?” to answer these questions – but let’s start with how computers store data.

Computer Data Storage in Binary Codes

The smallest unit of computer data storage is a “bit,” a contraction for “binary digit.”

One bit has the value of either zero or one; just as every digit in base-2 arithmetic has the values zero or one.

In base-10 arithmetic, a digit has any value from zero through 9. For example, 11001 in base-2 equals 25 in base-10.

Computers use binary arithmetic, since electrical circuits can “easily” distinguish two values (such as “on” versus “off”).

We usually discuss computer data in larger units. Different computers use many different coding schemes, or binary codes. ASCII code groups 7 bits into one “byte”. A 7-bit byte can represent 2x2x2x2x2x2x2 = 2^7 = 128 different values. In ASCII, each byte represents one character, such as ‘7’, ‘a’, or ‘Z’.

Some of these characters have meanings other than letters, numbers or symbols. For example, one character specifies the start of a message; another ends the message.

Unicode is a different binary coding scheme, which uses one or more 8-bit bytes for each character. An 8-bit byte has 2^8 = 256 values. Many computer applications require other binary codes.

Bytes also represent machine-level commands inside a computer chip. However, when one byte represents the command, the full instruction usually requires one or more subsequent bytes to represent the data for that command to process.

Size of Computer Files versus the Information of a Computer Program

The length of a computer program, or of a piece of data such as a document, image or video, may run to megabytes or gigabytes (millions or billions of bytes) of information.

The length of a data file may not correspond to the “information value” of that file. For example, a story may include redundant flashbacks, such as a mystery novel in which a suspect repeats previous dialogue verbatim to different lawyers and again in court.

Similarly, programmers might achieve the same result in different computer programs of very different lengths. In the field of computational mathematics, some theorems discuss the shortest program to perform a particular function.

What is DNA?

Diagram of DNA Spooling from a Cell Nucleus

DNA Spooling from a Cell Nucleus. Image by National Institute on Aging.

Just what is DNA?

DNA is a long organic molecule, mainly made from four base chemicals: adenine (A); guanine (G); cytosine (C); and thymine (T). Only A+T and C+G may form base pairs.

Other chemicals hold the base pairs in place, and serve other functions in the DNA molecule, but most of the information is stored as a sequence of base pairs.

DNA’s geometry is a double spiral, with base pairs held between two long strands. For the purpose of data storage we can think of DNA as a ladder, with the base pairs as rungs, and the strands as the legs of the ladder.

Since there are only two types of base pair, AT or CG, each rung on the ladder might act exactly as a computer bit. For some purposes, it’s enough to report that a segment of DNA contains {AT, AT, AT, AT, CG, CG}.

However, the cell reads the DNA in one direction along one “strand” where it may find any one of the four molecules: A, T, C or G. As Dr. Donald E. Riley notes, genetic sequencing tests also report the base chemicals. So the DNA segment above might be reported as ‘AATTCG’, distinguishing the AT from TA and the CG from GC.

Therefore each base pair represents one of four values as the cell reads through the DNA; twice as many values as one computer bit.

The genome is the complete description of the sequence of bases in one organism’s DNA.

One continuous sequence of DNA is a “chromosome”. Humans have 46 chromosomes, in the form of 23 pairs, in most cells.

Table showing the Genetic Code from DNA to RNA to Amino Acids.

The Genetic Code from DNA to RNA to Amino Acids. Copyright image by Mike DeHaan, all rights reserved.

Transcribing DNA to RNA to Amino Acids

The cell gets information from its DNA by transcribing, or copying, some base pairs from DNA to messenger RNA. The cell does not copy all the DNA; we classify the useful sections as genes.

DNA provides the information to build amino acids by the sequence of base pairs in the genes.

The cell transcribes a protein-coding gene from DNA into RNA, but substitutes U, uracil, for T. Then the cell reads the RNA by following one side of the base pairs, in sequence. Therefore each base pair in RNA still has four possible values, A, C, G, or U. The only possible pairs are AU and CG.

Again, the cell reads one end each pair, so there are four possible values for each pair.

The cell uses RNA in groups, or “codons”, of three pairs. So each codon has one of 4x4x4 = 4^3 = 64 different values. Therefore the codon has exactly as much information as a 6-bit byte, since 2^6 = 64 possible sequences for codons. But there is a catch.

RNA only encodes 20 different amino acids, plus a “stop” signal, and a “start here with one specific amino acid, methionine” signal. Methionine is one of the 20 amino acids.

So each codon of RNA only leads to 21 possible outcomes, rather than 64.

This leads to the question: Should we say the genetic information is the content of the codons, or the resulting amino acid? (Actually, some genes have control functions; and there may be useful information in sections of DNA that we do not classify as genes. Later, we will check both possibilities).

Translating RNA into Amino Acids and Proteins

The cell builds a protein by creating the amino acid methionine for the first codon, and then creating and attaching the amino acid for the second codon, and so on, until it finds a “stop” codon. The sequence of amino acids forms a protein.

Genetic Code Table

This is the Genetic Code Table in its usual format. Image by National Center for Biotechnology Information.

Junk DNA and Regulatory Mechanisms

A large percentage of any organism’s DNA never encodes proteins, because the codons follow a “stop” codon and do not have the next “start” codon. At one time, scientists called these sequences of codons, junk DNA, since they seemed to be useless.

However, researchers now know that some of these codon sequences regulate how other genes are expressed or repressed. Clearly a regulator gene carries information; it is not “junk”.

Also, the cell may suppress a gene by attaching other molecules to the gene; this keeps the cell from transcribing that gene into RNA.

One such suppression process is methylation, which adds a methyl group to the gene. A methyl group is one carbon atom bonded to three hydrogen atoms. Certainly there is an additional binary “bit” of information at each point where an additional molecule might suppress that gene.

Note that gene suppression plays an important role, especially in multicellular organisms. A pluripotent stem cell’s daughter must suppress some genes, and express others, in order to become a specialized cell.

Specific genes are expressed or repressed from time to time during the life of a cell. Some genetic suppression may last a lifetime and may be inherited if it is incorporated in the reproductive cells (egg or sperm cells). This long-term pattern of suppression is called the epigenome, a layer of information “above” the genome of DNA.

Should we consider the codons found inside a non-coding, never-expressed sequence of DNA as information? Yes, if we want to describe the whole genome. Perhaps not, if we only want to describe the full set of outputs.

Finally, it is possible that the length and placement of each non-coding section of DNA is vitally important. In a cell, DNA folds onto itself somewhat like a ball of rubber bands. The cell can only read what it finds on the outside of that folded bundle; and that “outside” depends on the length and twists of the DNA inside the bundle.

How Much Information Does DNA Encode?

The simplest answer to “How much information does DNA encode?” is “enough data to completely specify an organism’s particular genome and epigenome.” That involves the number of base pairs and the number of possible sites for adding a suppressor. Human DNA has approximately 3 billion base pairs, according to the National Human Genome Research Institute. That means 4^3,000,000,000 possible base sequences.

For simplicity, let’s say that each gene is either suppressed, or not, in the epigenome. That would be a binary choice for each gene. Most humans have between 20,000 and 25,000 genes. Let’s say the average is about 2^22,500 more choices.

The length of DNA varies for different species. Humans, with about 3 billion base pairs, have neither the largest nor smallest genome.

Normally we specify the “amount of information” in bits; so 2^n choices requires n bits. Note that 4^j = (2*2)^j = 2^(2*j).

Therefore human DNA genome encodes 4^(3 billion) = 2^(6 billion) choices, or 6 billion bits of information. The epigenome encodes at least 2^22,500 choices, or 22,500 bits. The total information is 6,000,022,500 bits, or approximately 6 Gb (gigabits).

We usually discuss computer storage in bytes rather than bits. 6 Gb would amount to 6/7 = 0.857 GB (gigabytes), or 857 MB (megabytes), using ASCII code.

How Much Information do the Amino Acids Encode?

One might suggest that the genetic information is equally carried by the amino acids produced by the codons. (This still assumes that “junk” DNA also carries exactly that information). There are 21 possible results from each codon. The one “start” codon encodes one amino acid; 60 different codons encode another 19 amino acids; and three codons encode “stop”. The 3 billion base pairs would be grouped into 1 billion codons, and each codon has 21 possible meanings. So that would be 21^(1 billion) sequences of amino acids.

We need to convert 21^(1 billion) to a power of two, since all the other information results are in bits. The conversion factor is ln(21)/ln(2), where “ln” is the natural logarithm function. We have ln(21)/ln(2) = 3.0445/0.6931 = 4.3923 (rounded), according to my calculator. (1 billion) * 4.3923 = 4,392,300,000 bits of information to code amino acids.

So that is a total information of 4,392,322,500 bits including the epigenome. In ASCII code, that would be 627,474,642 MB (megabytes).

Comparing the Genetic Code to Computer Data Storage

Let’s conclude by comparing computer data storage to the genetic code for DNA.

Computers store data in two-valued bits, grouped as bytes of 7 or more bits (for ASCII). One byte holds 2^7=128 unique values.

DNA stores data in four-valued base pairs, which RNA then groups as codons of 3 pairs. One codon holds 4^3=2^6=64 unique values.

A sequence of base pairs that convey biological information is called a gene. DNA includes extra information to express or suppress specific genes. Each gene has at least one bit of information for expression or suppression.

Computer files may be measured in megabytes or gigabytes: millions or billions of bytes. One CD-ROM disc may store about 710 MB. Modern solid-state memory and disk drives can store gigabytes.

If we can fully prescribe one human’s DNA by specifying the full sequence of base pairs, plus a binary flag to express or suppress each gene, then human DNA contains about 6 Gb or 857 MB of information.

Share621
Share19
+13
Pin1
Tweet
644 Shares

Filed Under: Information Science, Mathematics

Resources for this article

National Institutes of Health. Genetics Home Reference. (2015). Accessed on August 25, 2015


National Human Genome Research Institute. The Human Genome Project Completion: Frequently Asked Questions. Accessed on August 25, 2015


Riley, Donald E.. DNA Testing: An Introduction For Non-Scientists. (2005). Scientific.org. Accessed on August 25, 2015




Decoded Everything is a non-profit corporation, dependent on donations from readers like you. Donate now! Your support keeps the great information coming!

Donation Information

I would like to make a donation in the amount of:

 $500 $200 $100 $50 $20 $10 $5 Other
Other:

I would like this donation to automatically repeat each month

Tribute Gift

Check here to donate in honor or memory of someone
Check here if this is a memorial gift
Name of person to be honored:
Send acknowledgement via email
Send acknowledgement via postal mail
Email Name:
Email:
Name:
Address:
City:
State :
Province:
Country:
Postal Code:

Donor Information

First Name:
Last Name:
Email:
Please do not display my name publicly. I would like to remain anonymous
Add me to your mailing list

Comments

  1. Napah says

    November 25, 2017 at 2:59 am

    this is incredible analysis for this is all about fusing physics, chemistry and biology in the quest to unravel biological mysteries.

    Reply
  2. Joshua Francis Martin says

    November 5, 2017 at 2:51 am

    I THINK I HAVE WORKED OUT HOW TO DECODE DNA AND NO ONE HAS TOLD ME THIS NOR READ IT NOR LEARNT THIS, THIS IS HOW!
    DRAW THE FIBBONACCI SWIRL SO BY FIRST PASS IT HAS DOULBLED IT DISTANCE
    NOW INSIDE TO OUTSIDE DRAW TEN SEGMENTED CIRCLES
    THEN DRAW A CROSS DIRRECTLY THROUGH THIS.
    THE CONNECTED LINES WTHIN EACH QUARTER ARE MESSURED AS EASTERN AND WESTERN MUSIC NOTES.
    NOW IMAGINE THE FIBBONACCI SWIRL TO CONTINUE LIKE A DNA DOES THEN TAKE STEPS OUT FROM EACH QUATER OF THIS
    COULD THIS BE PLACED AS MATHS AS MUSIC NOTES EASTERN AND WESTERN
    TO THEN RUN A SIMULATION PROCESS TO COUNT AND SHOW AS MANY DNA SEQUENCES THAT ARE POSSIBLE AND MAYBE THIS IS THE WAY TO RECORD, CLASSIFIE GROUP AND RECONISE=DNA AS MUSIC NOTES
    MY PERSONAL THOUGHT
    i did not learn how to do this but naturally attand the information from the universe
    JUST A BIT OF A PUSH FROM A HELPING HAND

    Reply
  3. narayana dash says

    September 18, 2017 at 12:23 am

    teach it in high school

    Reply
  4. Aziz says

    April 5, 2017 at 6:23 am

    I want to Explain Other issue that you will wonder .
    the smallest Transistor size is 3 nm and for create one bit memory type(SROM) will need at least 6 Transistor.
    so size of 1 bit Static Read Only memory is about 6*3 = 18 nm without considering the Needed Buses.
    in the other hand as you can study my before Comment you can see …
    chromosome 1 data to save :
    85 mm long * 2.2 Width = 85000000 * 2.2 = 187000000 nm so 55 million byte = 440 million bit
    and if we do (187 million / 440 million = 0.425) nm size for 1 bit data on DNA
    so the DNA Storing Data can be ( 18/ 0.425 = 42.35) time Smaller that currently .

    Reply
  5. Aziz says

    April 4, 2017 at 5:16 pm

    It is 2:00 am now,before sleep I just as usual was plunging inside my inovative whims, suddenly I detect a new idea, storing data inside DNA!!!. readable for digital electronic, I have some information about (A,T, C, G) the four bases of DNA and by studying the human first chromosome in Wikipedia, “. For instance, the DNA in the largest humanchromosome, chromosome number 1, consists of approximately 220 millionbase pairs[13] and would be 85 mm long if straightened”
    I calculated
    1 byte = 8 bit >>>>> 256
    4 DNA bases >>>> 4 power 4 >>>> 256 so
    220 million / 4 = 55 million byte and approximately 52 mega byte ,
    I analysed so many possibilities for this new sciences , and even I set name for it as “Genetronic ” 😀
    so I DID Google about” binary from DNA” and saw this site , and all of my planes for new technology vanished
    🙁

    Reply
  6. DR MINH says

    March 29, 2017 at 8:52 pm

    I THINK THE 4 LETTERS OF DNA ARE:
    DNA
    DNB
    DNC
    DND

    AM I RIGHT?

    MY 8 YEARS OLD DAUGHTER AYA TOLD ME THEY ARE A C G T . IS SHE CORRECT?

    Reply
  7. Jim Mills says

    May 26, 2016 at 9:16 pm

    “In ASCII code, that would be 627,474,642 MB (megabytes),” needs to be corrected. It is 627.474642 MB.

    When I took my college biology classes in the early nineties, I was dumfounded to find out God was a programmer. At the same time learning about the Turing machine, which basically describes the transcribing function. Add in standard jumps and code execution, plus your “junk” DNA being similar to data that isn’t executed, and it is scary.

    Wonder if we should hire compiler experts to reverse engineer the DNA rather than those in the medical science field. This is one of the reasons I have considered going back for a computational biology degree.

    Reply
  8. ali amjid says

    March 9, 2016 at 3:35 pm

    If scientist make a software who can undrstand the DNA code and also work on that code like a cel then that software will b a human that wil b think like humans

    Reply
  9. Steven Ladavich says

    February 15, 2016 at 7:56 pm

    Interesting read. However 8bits = 1 byte. Your calculations need to be corrected. You are correct that ASCII code uses a seven bit structure, the eight bit was simply ignored. But computer storage/memory has always used an 8bit per byte model. All modern schema uses a multiple of this basic construct.

    Reply
    • Jim Mills says

      May 26, 2016 at 9:05 pm

      Not all bytes are 8 bits. Some are 16, which is why computer scientists call what your referring to and an octet.

      Reply
      • Jim Mills says

        May 26, 2016 at 9:18 pm

        “…to as an octet.” Not sure how to edit the comments.

        Reply
        • John Smith says

          August 10, 2016 at 3:21 pm

          Great article thanks.
          I’d agree with Steven that everyone nowadays considers 1 byte to mean 8 bits.
          Also, when storing binary information you wouldn’t tend to use ASCII at all so you’d get the full 8 bits / 256 unique values per byte.

          Reply
      • Jacob P says

        November 16, 2016 at 11:47 pm

        Well that may be technically true that 8bits is not always considered a byte, it is so in almost ALL cases with digital electronic computers. 16bits is typically referred to as a word, not a byte.

        Reply
  10. Murray Lumley says

    August 29, 2015 at 10:39 am

    A good read. It accompanies the book I just completed – ‘Life’s Engines – How Microbes Made Earth Inhabitable’, Paul G. Falkowski

    In it the author points out that the majority of DNA, RNA etc. determine the cell ‘nano machinery’ (ribosomes where proteins are made, mitochondria, chloroplasts etc.) as in bacteria and other single celled microbes and the number of additional genes required to make multicellular plants and animals is comparatively small – a few thousand more genes. Since large multicellular organisms have variation in characteristics that change over time due to environmental selection of traits using sexual reproduction, the genes for the ‘nano machines’ that are found in all living cells, have varied little over 2.6 billion years according to Falkowski. So what does that tell us about what is important about life? We actually alter the Earth’s living systems – as we are doing – at our existence peril.

    Reply
    • Mike DeHaan says

      September 2, 2015 at 8:12 pm

      Disclaimer: my training is in math, not biology.
      #1. You’re right: one large topic is conservation of some genes over time, while others change. A mutation that kills the offspring or prevents reproduction does not propagate; so the most conserved genes are probably the most necessary for that species.
      #2 Therefore a big problem is to make a viable and more competitively-successful change to an organism; then it can out-compete natural ones. Similar problem in introducing non-native species, or changing a habitat in a way that local species cannot survive.

      Thanks for your note!

      Reply

Leave a Reply Cancel reply

Connect with:
Facebook

Your email address will not be published. Required fields are marked *

About the Author

Mike DeHaan

Mike DeHaan applies his Bachelor of Math in Computer Sciences degree, years of Cobol programming and quality assurance (including testing credit card interest calculations) to research and present mathematical theory for the … Read Full Profile

Follow Decoded Science

  • Facebook
  • Google+
  • Twitter
  • Pinterest
signupheredailydosedecsciv2


Science Everyone’s Talking About

  • How Chemical Reactions in Fireworks Produce Sounds and Colors How Chemical Reactions in Fireworks Produce Sounds and Colors Many people enjoy fireworks displays on the fourth… under Chemistry
  • Red Ants Reaction and Treatment: What is a True Allergic Reaction to Red Ants? Red Ants Reaction and Treatment: What is a True Allergic Reaction to Red Ants? Fire ants have a painful bite; the resulting swelling a… under Headlines, Health
  • Cross Multiply to Solve Equations with Fractions Cross Multiply to Solve Equations with Fractions Having trouble solving for X in an equation that involv… under Mathematics
  • How Airplanes Fly: Small Aircraft Controls How Airplanes Fly: Small Aircraft Controls How does a small aircraft work? Basic controls, the phe… under Aviation
  • Full Moons and Crime AKA The Lunar Effect: Real Deal or Pseudoscience? Full Moons and Crime AKA The Lunar Effect: Real Deal or Pseudoscience? It’s a full moon, so watch out! Does the phase of the l… under Criminology, Headlines

Today’s Most Popular Science Articles

  • Introducing Math Symbols for Union and Intersection Introducing Math Symbols for Union and Intersection
  • Stomach Flu Cramps: Is There Anything You Can Do For Norovirus Symptoms? Stomach Flu Cramps: Is There Anything You Can Do For Norovirus Symptoms?
  • Which Chemical Bond is Stronger: Ionic vs. Covalent Bonds Which Chemical Bond is Stronger: Ionic vs. Covalent Bonds
  • Genetically Modified Organisms: Pros and Cons of GMO Food Genetically Modified Organisms: Pros and Cons of GMO Food
  • Cross Multiply to Solve Equations with Fractions Cross Multiply to Solve Equations with Fractions
  • Introducing the Factorial: the Exclamation Mark of Math Introducing the Factorial: the Exclamation Mark of Math
  • Organ Harvesting, Human Trafficking, and the Black Market Organ Harvesting, Human Trafficking, and the Black Market

© 2026 DecodedScience

MENU
  • Home
  • Headlines
  • General Science
  • Applied Science
    • Calculations
    • Economics
    • Engineering
      • Aviation
      • Civil Engineering
    • Medical Science
      • Health
      • Neuroscience
      • Oncology
      • Veterinary Science
    • Political Science
      • Polling
    • Mathematics
    • Technology
      • Artificial Intelligence
      • Computing
      • Electronics
      • Gadgets
    • Social Science
      • Cognitive Science
      • Psychology
      • Sociology
      • Anthropology
        • Linguistics
  • Physical Science
    • Archaeology
    • Astronomy
    • Chemistry
      • Materials Science
    • Geoscience
      • Climate Change
      • The Environment
      • Geology
      • Meteorology
      • Oceanography
    • Life Science
      • Biology
        • Botany
        • Zoology
          • Marine Biology
          • Entomology
          • Microbiology
        • Paleontology
        • Ecology
    • Nuclear Science
  • Theoretical Science
    • Physics
    • Math Theory
  • About Us
    • Contact Decoded Science
    • Ask the Expert
    • Meet Our Experts
    • Meet Our Sponsors:
    • Browse All Articles
    • Subscribe
    • Privacy Policy
    • Terms of Use Agreement
  • Support Decoded Science