Updated date:

What's the Difference Between Analog and Digital?

Eugene is a qualified control/instrumentation engineer Bsc (Eng) and has worked as a developer of electronics & software for SCADA systems.

whats-the-difference-between-analog-and-digital

The Future is Digital?

We often hear about analog and digital in the context of communications, sound recording, cameras, TV, radio and other electronic devices. But what exactly is the difference and is digital better than analog? Why has digital replaced analog in audio, digital imaging and electronic communication? In this article I hope to shed light on the mystery.

How are Analog and Digital Displays Used?

Although it has nothing to do with the real distinction between analog and digital, these terms are often used to refer to the type of displays on clocks, measuring devices and electronic instruments. An analog display usually involves some form of pointer which indicates a value depending on its position or angle on a scale. Examples of analog displays are traditional watches and clocks, weighing scales, speedometers and old style moving coil or moving iron voltmeters and ammeters. See the photos below for examples.

A digital display indicates the value of a parameter directly by actually showing a number. This number can be produced on an LED, LCD or Nixie tube (cold cathode) display. Even the displays on old fashioned electromechanical cash registers could be thought of as digital, but the term is usually reserved for electronic devices.


Note the British English spelling of analog is "analogue"

What are Analog Examples?

On an analog display, the value is indicated by a line or pointer.

Analog voltmeter

Analog voltmeter

Another analog voltmeter

Another analog voltmeter

What are Examples of Digital Displays?

On a digital display, a value is displayed as a series of 1 or more numerical or alphanumerical digits.

Nixie tube or cold cathode display. An early type of digital display

Nixie tube or cold cathode display. An early type of digital display

My vintage 1977 calculator. This has a miniature vacuum fluorescent display.

My vintage 1977 calculator. This has a miniature vacuum fluorescent display.

Vintage calculator with an LED digital display

Vintage calculator with an LED digital display

What are Analog and Digital Signals?

Another distinction between analog and digital is in the field of electronics and signals. In the real world, many varying parameters can be considered as analog. So for instance the variation of temperature in a room over time is an analog quantity, as is the voltage of a battery as it discharges. The characteristic of an analog parameter or quantity is that its value varies continuously within a range. So the temperature in a room could vary anywhere between 10 and 20 degrees C.

The state of a light switch is either on or off. This is an example of a digital quantity. The switch doesn't exist in an in between state, it is either on or off. Digital technology is fundamentally based on this idea of on and off states of "switches"

What is a Signal?

The function of a signal is to convey information about the behavior of some phenomenon. An example is the output of a temperature sensor which provides information about the temperature in a room. The fluctuations in light level which travel down fiber optic cables are signals.(signals don't have to be electrical). The information could be a telephone conversation, Internet data or a TV program. The state of the switch in the example above, measured over time can be thought of as a digital signal.

Analog and digital signals. The analog signal varies continuously over time, the digital single is either "high" or "low"

Analog and digital signals. The analog signal varies continuously over time, the digital single is either "high" or "low"

What is a Sensor?

A sensor converts a real world parameter such as temperature, pressure or light level into a signal. This signal may then get amplified and/or processed before being used for some other purpose. Some examples:

  • In instrumentation, the signal from a sensor could drive a display indicating the value being measured. e.g. speedometer in a vehicle, temperature gage or voltmeter
  • In communications, sound or pictures from microphones or cameras are converted to an electrical signal which eventually gets transmitted as radio waves

How Do Digital Signals Work?

A digital signal has two states or levels, high and low. The signals in a digital computer, or instrumentation such as a digital voltmeter are two state. A computer doesn't understand analog signal levels and just works on high and low states, effectively ones and zeros. For a more thorough explanation of this, and an explanation of the binary number system, see my article Why is Binary Used in Computers?

What Does Sampling Mean?

Sampling a Signal

Sampling is a process which converts a real world signal to a digital format which can then be processed by a computer, instrumentation or other digital electronics technology.

Some examples:

  • A digital multi meter (DMM) samples a voltage, converts it to digital, and the digital signals are used to drive a display
  • An image projected by the lens of a digital camera, falls on the CCD (Charged Coupled Device) at the back of the camera. The image is converted to numbers and stored in the camera's flash memory
  • A scanner scans a document. The resultant image is stored in memory
  • A sound recording is made. The audio signal is converted to digital and saved on hard disk or printed onto a CD

Analog to Digital Conversion

As digital electronics and computers were developed, applications arose for reading signals from the real world. The process to do this is called sampling whereby an analog signal is converted to a binary number understandable by a computer. A device which does this is called an analog to digital converter (ADC). An ADC measures the level of the analog signal at regular intervals known as the sampling frequency. The voltage range over which the ADC works (e.g. 0 to 5V or 0 to 10V) is broken up into equally spaced ranges and a binary number assigned to each of these ranges. Each time the ADC samples the signal, it outputs a binary number representative of the level at the instant of sampling. These numbers can then be stored, used to drive a display, transmitted along a communication line etc. For a 3 bit converter (see diagram below), there are 23 = 8 possible binary numbers. In reality, ADC converters have 6, 12, 16 or even 24 bit resolution. (16 bit at 44kHz sampling rate is used for CD recordings). Obviously this means that there are lots more levels and the converter can resolve more detail in the signal.

Sampling an analog signal. There are 8 possible levels - The converter outputs a 3 bit number depending on the level of the analog signal

Sampling an analog signal. There are 8 possible levels - The converter outputs a 3 bit number depending on the level of the analog signal

A to D Converter Resolution

As I mentioned before, A to D converters typically have resolutions of 6 to 16 bits, although 24 bit converters are available.

The number of levels which a converter can resolve is equal to 2n , where n is the number of bits of the converter. So for a 6 bit converter there are 64 levels and for a 16 bit converter, there are 216 = 65,536 levels. A converter has an input range over which it works, e.g. 0 to 5 volts, and it is this range which is split up into equal ranges. So to get the most amount of "detail" out of a signal, the signal should span as much of this range as possible.

Block diagram of a typical ADC. A start conversion signal initiates a conversion. The ADC generates an end of conversion signal on completion. An 8 bit converter can resolve 2 to the power of 8 = 256 different levels

Block diagram of a typical ADC. A start conversion signal initiates a conversion. The ADC generates an end of conversion signal on completion. An 8 bit converter can resolve 2 to the power of 8 = 256 different levels

Minimum Sampling Frequency of a Waveform — The Nyquist–Shannon Sampling Theorem

The maths behind this theorem is a bit complicated, but basically it says that the sampling rate of a signal must be at least twice the highest frequency content of the signal. This is intuitively correct so for instance the slowly changing signal from a temperature sensor in a room would need to be sampled much less frequently than an audio signal from a microphone or video signal from a camera in order to preserve the rapid changes in the signal.

Reproducing a Signal - Digital to Analog Converter (DAC)

Once a signal has been sampled, several things can be done with it. In the case of instrumentation, e.g. a digital multimeter, data may not need to be stored. Instead the digital output signal of the ADC drives the display on the instrument (through intermediate driver electronics). Alternatively data can be stored in a computer as a set of numbers: in random access memory (RAM ), on a hard drive or on a CD or DVD. Sometimes a signal which has been sampled and stored must be reproduced. An example of this is an audio recording on a CD. A device called a digital to analog converter (DAC) is used to reproduce the original signal. The DAC does the same job as the ADC in reverse. Each binary number which was stored during the original recording is input to the DAC at a playback rate equal to the original sampling frequency. The output of the DAC is an analog voltage level. The signal is then filtered to remove the "staircase" effect due to sampling

Sampled signal is stored as a set of numbers. When this signal is reconverted back to analog, filtering must be used to remove the "staircase" effect

Sampled signal is stored as a set of numbers. When this signal is reconverted back to analog, filtering must be used to remove the "staircase" effect

Digital Electronics

Some electronic devices are almost purely digital and don't need to sample analog signals. An example is a digital watch or clock which makes use of a quartz oscillator. An oscillator is a system which does something at regular intervals, e.g. a swinging pendulum, or a flashing light. The frequency of a quartz oscillator is very stable and has a relatively low sensitivity to temperature unlike the components of a mechanical clock. The output of the oscillator is a square wave voltage, usually at 32,768 Hz. i.e. a digital signal. This frequency is a power of 2 and is chosen so that it can be successively divided by 2 by a digital counter to produce a 1 second pulse. Other counters then generate minute and hour outputs every 60 and 3600 seconds for driving the digital display. (Digital quartz watches can also have analog displays)

Increasing the Signal to Noise Ratio

The process of storing and transmitting data in digital format is in effect increasing the signal to noise ratio (SNR or S/N). There are no low level signals, just highs and lows. Digital electronics "decides" on whether a bit is high or low depending on whether it is within a high or low band of voltages.

What are the Advantages of Digital Data?

Once a signal is sampled and the data is converted to a series of numbers in memory, lots of things can be done with it.

  • Data can be stored and copied indefinitely without degradation This is because numbers in memory or on digital media are stored in binary format as ones and zeros. In memory, electronic switches are either on or off, representing the storage of 1 or 0. This single piece of information is known as a bit. On a CD, either a 1 or 0 can be represented by a pit in the surface of the disk. Contrast this with an analog recording on tape (which could be audio or video). Low level signals get swamped by noise over time and noise also gets introduced during the copying process. This also applies to image recording on photographic media such as a traditional negative.
  • Clearer audio communication. Because digital increases the SNR, radio and telephone communication and radio broadcasts are clearer without the introduction of noise. Increasing the SNR is somewhat similar to the idea of how the phonetic alphabet can be used during radio communication or a telephone call to improve intelligibility. Each letter of a message is represented by a word - (E.g "Car" as "Charlie - Alpha - Romeo") so that a transmission can be understood.
  • Data can be compressed Since data is stored as numbers, fancy algorithms can be used to compress the data. This is advantageous because data files can be made smaller and require less storage space (think JPEG and MP3 which are formats for storing and compressing images and sound). Digital TV and digital radio also makes use of these compression techniques (MPEG 4 compression for TV). The radio frequency spectrum is limited and only so many channels can be squeezed onto the spectrum. Compressing TV signals, narrows the required bandwidth for a channel so more channels can be squeezed into a frequency band ( which may be a good or bad idea! It reminds me of Bruce Springsteen's song, "57 Channels and Nothin' On)

What are the Disadvantages of Digital Data?

  • A decoding device is required Data which is stored on media is usually compressed, encoded and formatted in some way. Equipment to read and decode the archived data may not be available in the future. For instance if you have any 5 1/4 inch floppy disks with data on them, do you still have a computer which can read these disks? Yet it is even possible to read the information from books written hundreds of years ago and view the illustrations, or view photographs from the mid nineteenth century. It would also be relatively easy to build a machine which could play early wax cylinder phonographic recordings. This is obviously an issue for archivists of important information.
  • Digital data is not necessarily durable While digital data on media is theoretically rugged and less likely to be degraded than an analog recording, in practice if the media is damaged, it may not be possible to read data (e,g, a seriously scratched CD). However an analog tape recording could probably be pieced together and played. Similarly a photograph ( a traditional non-digital type, which is in effect a two dimensional, analog, optical recording) can still be viewed if stained or damaged in some other way. The moral of the story is to always back up your digital data (and back up the back up!)


What are TTL and CMOS?

TTL (Transistor Transistor Logic) and CMOS (Complimentary Metal Oxide Silicon) are two technologies used to implement switches in the integrated circuits of digital electronic devices. CMOS has the advantage that it is low power which of course is important for battery powered devices. Digital ICs have input and output pins, and the voltages on these pins are within designed tolerance bands. For instance if a high output of a TTL chip is connected to the input of another TTL chip, the output voltage must be between 2.7 and 5 volts . Inputs between 2 and 5 volts are interpreted as high. Similarly a low output must be between 0 and 0.5 volts, even though anything between 0 and 0.8 is interpreted as low. This means that up to 0.3 volts of noise can be added to a signal without it being misinterpreted.

TTL(Transistor Transistor Logic) is a type of technology used in digital electronics. Output signal levels of TTL ICs must be within the acceptable range of voltages shown above

TTL(Transistor Transistor Logic) is a type of technology used in digital electronics. Output signal levels of TTL ICs must be within the acceptable range of voltages shown above

Electron microscope image of a CD. Data is stored as "pits" on the CD. Pits are approximately 100nm deep, 500 nm wide and 850nm to 3.5 microns long

Electron microscope image of a CD. Data is stored as "pits" on the CD. Pits are approximately 100nm deep, 500 nm wide and 850nm to 3.5 microns long

This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

© 2014 Eugene Brennan

Comments

Tutu on October 03, 2017:

Wow

Beautiful article

It is so helpful

Eugene Brennan (author) from Ireland on August 27, 2015:

Thanks Ron! Hopefully it should shed some light on the mystery. Often words like "analog", "digital", "RAM", "JPEG" etc are used as buzz words but without any understanding of what they mean.

Ronald E Franklin from Mechanicsburg, PA on August 26, 2015:

As a former electrical engineer, the info you cover in this hub was once my everyday bread and butter. Congrats on a good overview.

Eugene Brennan (author) from Ireland on February 02, 2014:

Thanks, glad you liked it and it made sense! As with any of these types of topics, in reality, things can get quite complex because of all the communication protocols, storage formats etc which are involved. The basic concept of analog and digital however is quite simple.

Writer Fox from the wadi near the little river on February 02, 2014:

Very comprehensive explanation! You are a real expert in this topic and you have explained the differences so well. I think many people will find this article useful, especially students. Enjoyed and voted up!

Eugene Brennan (author) from Ireland on January 30, 2014:

Thanks John and Tim!

I'll add more info to this hub later, but probably deal with bluetooth, comms and wi-fi in a separate article.

John MacNab from the banks of the St. Lawrence on January 30, 2014:

Brilliant eugbug. I had just finished asking my electronically knowledgeable wife what the difference was and I didn't understand her answer. Your hub explains it perfectly. Voted up+

Tim Anthony on January 30, 2014:

A very nice and informative hub. Consider detailing the digital data transmission over wireless networks like wi-fi and bluetooth. The emerging trends, versions and technologies too.