Binary Numbers |
Navigation |
|
|
Binary Numbers
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". Generally, a logic "1" represents a higher voltage,
which is referred to as a HIGH and a logic "0" is referred to as a LOW. 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 system of using Binary Numbers 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 numbers use powers of two, doubling the value of each successive bit, 1, 2, 4, 8, 16, 32 etc.
The voltages used to represent a digital circuit are called "logic levels" and ideally one
voltage level represents a HIGH and another represents a LOW. Digital waveforms or signals consist of discrete
voltage levels that are changing back and forth between these HIGH and LOW levels or states. But what makes a
signal or voltage "Digital" and how can we represent these voltage levels. Electronic circuits can be divided
into two main categories.
- 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".
Analogue Voltage Output
An example of an analogue (or analog) circuit and a digital circuit are shown below:
Analogue Voltage Output Representation
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. As the voltage output varies either slowly or rapidly there is
no sudden change between two voltage levels giving a continuous output voltage. Examples of analogue signals include
temperature, pressure, liquid levels and light intensity.
Digital Voltage Output
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 network. As the switch is rotated from
one node to the next the output changes quickly in discrete voltage levels of multiples of 1 volt each, as shown in
the graph. For example, 2 volts, 3 volts, 5 volts etc but NOT 2.5V, 3.1V or 4.6V. Finer output voltage levels could
easily be produced by increasing the number of resistors within the potential divider chain.
Digital Voltage Output Representation
Then the major difference between an analogue signal or quantity and a digital quantity is that
an "Analogue" quantity is continuously changing over time while a "Digital" quantity has discrete (step by step)
values. LOW to HIGH or HIGH to LOW. Another example of this could be a light dimmer that varies the light intensity
up or down between fully-ON and fully-OFF, but with a light switch the light is either "ON", (HIGH) or it is
"OFF", (LOW).
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.
TTL Input & Output Voltage Levels
Then, when using a +5 volt supply any voltage input between 2.0v and 5v is recognised as a logic "1"
value and any voltage input of below 0.8v is recognised as a logic "0" value. While the output of a logic gate between
2.7v and 5v represents a logic "1" value and a voltage output below 0.4v represents a logic "0" value. This is called
"positive logic" and is used in these tutorials.
Noise
However, between these defined HIGH and LOW values lies what is generally called a "no-man's land"
(the blue area's above) and if we apply a signal voltage of a value within this no-man's land area we do not know whether
the logic gate will respond to it as a level "0" or as a level "1", and the output will become unpredictable. Noise
is the name given to a random and unwanted voltage that is induced into electronic circuits by external interference,
such as from nearby switches, power supply fluctuations or from wires and other conductors that pick-up stray electromagnetic
radiation. Then in order for a logic gate not to be influence by noise in must have a certain amount of noise margin or
noise immunity.
Noise Immunity
In the example above, the noise signal is superimposed onto the Vcc supply voltage and as long as it
stays above the min level (Von-min) the input an corresponding output of the logic gate are unaffected. But when the noise
level becomes large enough and a noise spike causes the HIGH voltage level to drop below this minimum level, the logic gate
may interpret this spike as a LOW level input and switch the output accordingly producing a false output switching. Then
in order for the logic gate not to be affected by noise it must be able to tolerate a certain amount of unwanted noise on
its input without changing the state of its output.
Then binary numbers are represented by either a logic "0" or a logic "1" and in the next tutorial about
Binary Logic we will look at converting decimal numbers into binary numbers and vice versa and
introduce the concept of the Byte and the Word to represent parts of a binary number.
|
Help us to Share It