Binary Numbers: Analogue Voltage Output
Binary Numbers: Analogue Voltage Output
Unlike a linear, or analogue circuit which contains signals that are constantly changing from one value to another,
such as amplitude or frequency, digital circuits process signals that contain just two voltage levels or states, labelled
logic "0" and logic "1". These discrete voltage levels are commonly known as BInary digiTS and are normally
referred to as BITS. Because there are only two valid Boolean values for representing either a logic "1" or a logic "0",
makes the Binary Numbering system ideal for use in digital or electronic circuits and systems. The Binary Numbers
system is a Base-2 system which follows the same rules in mathematics as the common decimal system meaning
instead of powers of ten, for example 1, 10, 100, 1000 etc, binary uses powers of two, 1, 2, 4, 8, 16, 32 etc.
Analogue Circuits - Analogue or Linear circuits amplify or respond to continuously varying voltage
levels over a period of time.
Digital Circuits - Digital circuits produce or respond too two distinct voltage levels representing either a
Logic level "1" or a Logic level "0".
An example of an analogue (or analog) circuit and a digital circuit are shown below:
The output from the potentiometer varies as the wiper terminal is rotated producing an infinite number of voltage
points between 0 volts and V max. Other examples of analogue signals include temperature, pressure, liquid levels
and light intensity.
In this example the potentiometer wiper has been replaced by a rotary switch which is connected to each junction of
the resistor chain, forming a potential divider. As the switch is rotated from one node to the next the output changes in
discrete voltage levels of 1 volt each, as shown in the graph and finer output voltages could easily be produced by
increasing the number of resistors within the potential divider chain.
Some circuits combine both analogue and digital signals such as an analogue to digital converter (ADC) or a digital to
analogue converter (DAC). Either way, the digital input or output signal represents a binary number value of the
analogue signal.
Logic Levels
In all electronic circuits, only two logic levels are allowed and these levels are referred to as "logic 1 or logic 0", "high
or low", "true or false". Most logic systems use positive logic, in which a logic "0" is represented by zero volts and a
logic "1" is represented by a higher voltage, such as +5 volts and the switching from one voltage level, "0" to "1" or "1"
to "0" is made as quickly as possible to prevent faulty operation of the logic circuit. In standard TTL (transistor-
transistor-logic) IC's there is a defined range of input and output voltage limits for defining what is a logic "1" value
and what is a logic "0" value and this is shown below.
The Decimal or denary counting system uses the Base-10 numbering system where each digit in a number takes on
one of ten possible values from 0 to 9, eg 21310 (Two Hundred and Thirteen). In a decimal system each digit has a
value ten times greater than its previous number and this decimal numbering system uses a set of symbols, b,
together with a base, q, to determine the weight of each digit. For example, the six in sixty has a lower weighting than
the six in six hundred and in a binary system we need some way of converting decimal into binary.
N = bi qi
where: N is a real positive number
b is the symbol
q is the base value
and integer (i) can be positive, negative or zero
N = b2 q2 + b1 q1 + b0 q0 + b-1 q-1 ... etc.
For example: N = 616310 (Six Thousand One Hundred and Sixty Three) is equal to:
Unlike the decimal numbering system which uses the Base-10 system, digital logic uses just two values or states,
logic level "1" or logic level "0", so each digit is considered as a single digit in a Base-2 or Binary number. In the
binary numbering system, each digit has a value twice that of the previous digit but can only have a value of either "1"
or "0" therefore, q = "2".
For example:
Adding together the value of all the "1" s gives us: (256) + (64) + (32) + (4) + (1) = 35710
Another method of converting decimal into binary number equivalents is to write down the decimal number and to
continually divide by 2 (two) to give a result and a remainder of either a "1" or a "0" until the final result equals zero.
Example. Convert the decimal number 29410 into its binary number equivalent.
Then the main characteristics of a Binary Numbering System is that each "digit" or "bit" has a value of either "1" or
"0" with each digit having a weight or value double that of its previous bit starting from the lowest or least significant
bit (LSB).
Binary numbers can be combined into one of several size ranges depending upon the number of bits being used and
are generally referred to by the following more common names of:
Today, as microcontroller or microprocessor systems become increasingly larger, the individual binary digits (bits) are
now grouped together into 8´s to form a single BYTE with most computer hardware such as hard drives and memory
modules commonly indicate their size in Megabytes or even Gigabytes.
Hexadecimal Numbers
The one main disadvantage of Binary Numbers is that the binary equivalent of a large decimal number can be quite
long, which makes it difficult to both read or write without producing errors especially when working with 16 or 32-bit
numbers. One common way of overcoming this problem is to arrange the binary numbers into groups of four as a
Hexadecimal Number, starting with the least significant digit at the right hand side. This Hexadecimal or simply
"Hex" numbering system uses the Base-16 system with a combination of numbers and letters to represent its Binary
or Decimal equivalent.
For example: the following group of numbers 1101 0101 1100 11112 are much easier to read and understand
than 11010101110011112 when all grouped together.
By dividing a binary number up into groups of 4 bits, each group or set of 4 digits can now have a possible value of
between "0000" (0) and "1111" (8+4+2+1 = 15) giving a total of 16 different number combinations from 0 to 15, this
system is commonly called Hexadecimal, and now q = "16".
The numbers 0 to 9 are still used as in the original decimal system, but the numbers from 10 to 15 are now
represented by letters of the alphabet from A to F inclusive and an example of this Hexadecimal system is given
below.
Using the original binary number from above 1101 0101 1100 11112 this can now be converted into an equivalent
hexadecimal number of D5CF16 which is much easier to read and understand than a long row of 1´s and 0´s.
Similarly, converting Hex based numbers back into binary is simply the reverse operation.
Then the main characteristics of a Hexadecimal Numbering System is that there are 16 distinct counting digits from
0 to F with each digit having a weight or value of 16 starting from the least significant bit (LSB). In order to distinguish
Hexadecimal numbers from Denary numbers, a prefix of either a "#", (Hash) or a "$" (Dollar sign) is used before the
actual Hexadecimal value.
Example No1.
Convert the following Binary number 111010102 into its Hexadecimal number equivalent.
111010102
Group the bits into fours starting from the right hand
side
= 1110 1010
= E A
Then, the hexadecimal equivalent of the binary number
Example No2.
Convert the following Hexadecimal number #3FA716 into its Binary equivalent, and also into its Decimal or Denary
equivalent.
#3FA716
= 0011 1111 1010 01112
= (8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1)
= 16,29510
#3FA716 in Hexadecimal
or
Octal Numbers
Octal Numbers are very similar in principle to the previous hexadecimal numbering system except that in Octal a
binary number is divided up into groups of only 3 bits, with each group or set of numbers having a value of between
"000" (0) and "111" (4+2+1=7) giving a range of just 8, (0 to 7) therefore q = "8".
Then the main characteristics of an Octal Numbering System is that there are 8 distinct counting digits from 0 to 7
with each digit having a weight or value of just 8 starting from the least significant bit (LSB).
Example No1.
Using our previous binary number of 11010101110011112 converting it into the octal equivalent is shown as
follows.
Octal Number form 1 5 2 7 1 78
Long binary numbers are difficult to both read or write and are generally converted into a system more easily
understood or user friendly. The two most common derivatives based on binary numbers are the Octal and the
Hexadecimal numbering systems, with both of these limited in length to a byte (8-bits) or a word (16-bits).
Octal numbers can be represented by groups of 3-bits and hexadecimal numbers by groups of 4-bits together, with
this grouping of the bits being used in electronic or computer systems in displays or printouts. The grouping together
of binary numbers can also be used to represent Machine Code used for programming instructions and control such
as an Assembly Language.
Comparisons between the various Decimal, Binary, Hexadecimal and Octal numbers are given in the following
table.
Comparison Table
It can be seen from the above table that the Hexadecimal numbering system uses only four digits to express a single
16-bit word length, and as a result it is the most commonly used Binary Numbering System for electronic and
micro-electronic systems.