You are on page 1of 18

DIGITAL

ELECTRONICS

National Diploma in Electrical and Electronics


National Award in Electrical and Electronics

YEAR 1

© Alfred Galea – 2008/09 Page 1


Introduction to Digital Electronics:

Sounds produced by the human voice and by musical instruments vary continuously
in both Amplitude and Frequency. They are said to be Analogue Signals. Analogue
signals include waveforms such as Sinosoidal and Triangular waveforms. Voltage in
these waveforms varies in a continuous manner with respect to time as shown below:

Sinosoidal (Sine) Waveform Triangular Waveform

Examples of Analogue devices which we see in our every day life are the
Speedometer and the Petrol Gauge found in the dashboard of a car. They both give an
indication that varies continuously.

The Amplitude of a Digital Signal does not vary continuously. The amplitude of a
digital signal will suddenly change from one value to another and it will never have
an undefined value. A Binary Digital System will only have either one of two values;
it may be either HIGH or it may be LOW. The use of these signals allows relatively
simple TWO-STATE devices to be employed. Examples of such devices may be a
lamp which is either glowing or not; a buzzer which is either producing an audible
sound or not; a switch which either completes or breaks a circuit; or a semiconductor
diode or transistor which is either conducting (turned ON) or is non-conducting
(turned OFF).

The Digital Signal:

A digital signal consist of two


defined voltage values. These
voltage values area defined as the
HIGH or Logic State 1, and the
LOW or Logic State 0.

Examples of voltage levels are


+5Volts for logic 1 and 0Volts for a
logic 0. These voltages are used in
the TTL logic family of Integrated
Circuits (IC). TTL means Transistor
Transistor Logic because circuits are
built using Bi-Polar Transistors.

© Alfred Galea – 2008/09 Page 2


TTL logic family is represented by the 74 series of IC’s. Another logic family of IC is
the Complementary Metal Oxide Semiconductors or CMOS. They are represented by
the 4000 series of IC’s and are mainly built using the Field Effect Transistor. They
use different voltage levels. Logic state 1 can be as high as 15 Volts. Special
precautions must be taken in handling this type of IC’s as they are affected by Static
Electricity which might permanently damage the IC. To prevent from damaging these
type of semiconductors one must ground himself and the workbench during handling.
During transportation the pins of the IC must be either shorted out or inserted in a
conductive piece of foam.

Numbering Systems:

Introduction:

The most common numbering system we use in everyday life is the DECIMAL, also
called the DENARY system. The name by which this system is called indicates that
the numbers have a base of 10. Every number consists of 0 to 9 units; 0 to 9 tens; 0 to
9 hundreds; 0 to 9 thousands; and so on.

If we break up the decimal number 3475 we get:

3 x 1000 or 3 x 103
4 x 100 or 4 x 102
7 x 10 or 7 x 101
5 x 1 or 5 x 100

The Base or Radix of a number system can be another number instead of 10. This will
indicate a different numbering system from the Decimal or Denary one. For example:

Base 2 indicates a Binary System


Base 8 indicates an Octal System
Base 16 indicates a Hexadecimal System

All of these systems will be described further on in these notes.

(1) BINARY Numbers:

This system is used in Digital Electronics since it has only two digits, one (1) or zero
(0). In Digital Electronics only two states of voltage are utilized. A High or a Low, a
Logic 1 or a Logic 0.

A Binary number is a series of ones and zeros. The First digit on the right hand side is
the one with the lowest value. It is called the Least Significant Bit (LSB) or Digit. The
last digit on the left hand side is the one with the largest value and is called the Most
Significant Bit (MSB) or Digit.

As we did in the Decimal system, we can break up a Binary Number, this time using
the Base or Radix 2 instead of 10:

© Alfred Galea – 2008/09 Page 3


Example: Binary Number 1101 becomes:

1 x 23
1 x 22
0 x 21
1 x 20

The 2n for every digit forming the number is called the weight of the respective digit
in decimal form. See table below:

(MSB) (LSB)
27 2 6
2 5
24 3
2 22
21
20
128 64 32 16 8 4 2 1

Conversion from Numbering System to another:

Decimal to Binary:

There are two main methods for converting a decimal number to Binary:

Method (a):

Divide decimal number by 2, and continue to divide answers by 2 until you get a final
result of zero. Read remainders of every answer, starting from remainder of last
answer. The binary number you get is the conversion of the decimal number given.
(To convert to octal – divide by 8. For Hexadecimal – divide by 16. Always divide by
the base of the number into which you want to convert)

÷2 1375
Read the Remainders (Rem.)
÷2 687 Rem. 1 from Bottom to Top to get the
÷2 343 Rem. 1 equivalent Binary number.
÷2 171 Rem. 1
÷2 85 Rem. 1
÷2 42 Rem. 1
÷2 21 Rem. 0
÷2 10 Rem. 1
÷2 5 Rem. 0
÷2 2 Rem. 1
1375Decimal = 10101011111 Binary
÷2 1 Rem. 0
0 Rem. 1

© Alfred Galea – 2008/09 Page 4


Method (b):

1375 Decimal
(1024) (512) (256) (128) (64) (32) (16) (8) (4) (2) (1)
1 0 1 0 1 0 1 1 1 1 1 Binary

(i). Write down the decimal weights for every binary digit up to the weight next lower
to the decimal number to convert.

(ii). Subtract the next lower weight from the decimal number. Continue to subtract the
answer by its next lower decimal binary weight until you cannot subtract anymore or
you get a zero answer.

(ii). Write a 1 under every weight used in the subtractions, and a 0 under those
weights not used. The result is the conversion to Binary.

1375 - 1024 = 351


351 - 256 = 95
95 - 64 = 31
31 - 16 = 15
15 - 8 = 7
7 - 4 = 3
3 - 2 = 1
1 - 1 = 0

Question 1: Convert the following Decimal Numbers into Binary: 98, 157, 376, 8575.

© Alfred Galea – 2008/09 Page 5


Conversion of Binary into Decimal:

Method 1:

You can convert from binary to decimal by reversing one method given

for going from decimal to binary. That is, let ans start at 0 and suppose

the binary number is 11010111. Then compute new values of ans as shown

below (start from most significant bit):

ans * 2 + 1 =>ans

ans * 2 + 1 =>ans

ans * 2 + 0 =>ans

ans * 2 + 1 =>ans

ans * 2 + 0 =>ans

ans * 2 + 1 =>ans

ans * 2 + 1 =>ans

ans * 2 + 1 =>ans

At this point, ans contains the converted number.

Example: Convert Binary 10101011111 into Decimal.

0 1 0 1 0 1 0 1 1 1 1 1 2

(x2)+ (=) (=) (=) (=) (=) (=) (=) (=) (=) (=) (=)

1 2 5 10 21 42 85 171 343 687

(x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+

1375 10

© Alfred Galea – 2008/09 Page 6


Method 2:

Write down a table with the binary number and over each digit write the weight 2n.
Add together the weights which are over the 1’s.

Example: Binary number 10101011111

1024 512 256 128 64 32 16 8 4 2 1


1 0 1 0 1 0 1 1 1 1 1

If we add the weights over the 1’s we get:

1 + 2 + 4 + 8 + 16 + 64 + 256 + 1024 = 1375

Question 2: Convert the following Binary numbers into decimal: 1101, 10111,
101101, 11001100.

Other numbering systems:

The Octal numbering system:

This system is sometimes employed as a more convenient way of grouping binary


numbers to make them easier to read. The base, or radix of the octal system is eight
and, hence, the digits 0 through 7 are used. Number 8 becomes 10 in octal.

To convert Decimal into Octal, we divide by eight and then we read the remainders
from the bottom to get the Octal equivalent. The same as we did in binary.

Example: Convert 200410 into octal:

÷8 2004
÷8 250 Rem. 4
÷8 31 Rem. 2 2004Decimal = 3724 Octal
÷8 3 Rem. 7
÷8 0 Rem. 3

To convert from Binary to Octal, just divide the binary number into groups of 3 digits
each and do a conversion of every group from binary to decimal.

0 1 1 1 1 1 0 1 0 1 0 02
3 7 2 48

To convert from octal to Binary, every digit in the octal number is converted into a 3
–bit binary number.

© Alfred Galea – 2008/09 Page 7


The Hexadecimal Numbering system:

Computer systems use address and data buses that carry digital data in groups of 4
binary bits, or multiples of 4, such as 8, 16, and 32. Because of this it is generally
more useful to employ the 4-bit Hexadecimal Numbering System which has a Base
of 16. Since groups of 4 bits are employed the hexadecimal system provides values
from 0 through 15. Numbers higher than 9 are indicated by letters A for 10, B for 11,
C for 12, ………., and F for 15. A hexadecimal number is usually indicated by a letter
H following the number (e.g. 1B H)
To convert Hexadecimal numbers into Binary and vice-versa, the same method for
octal will be used. The only difference is that every hexadecimal digit is represented
by a 4-digit (4-bit) binary number.

Binary weight

1375 Decimal
(1024) (512) (256) (128) (64) (32) (16) (8) (4) (2) (1)
1 0 1 0 1 0 1 1 1 1 1 Binary
5 5 FHexadecimal

Question 5:

Convert the following decimal numbers into binary and then convert each one into
Octal and Hexadecimal.

158, 356, 1456, 5876.

Binary Coded Decimal (BCD)

This is a 4-bit binary code representing decimal numbers 0 to 9. The binary code
representing units, tens, hundreds, etc. of a decimal number is separated into groups
of separate nibbles (4-bit binary numbers). The least significant nibble represents the
decimal units, the next the tens, etc. The lower nibble is counted from 0000 to 1001.
Following the 1001, the lower nibble is reset to 0000 and the tens nibble is set to
0001. Hence the result will be a Binary code directly representing a Decimal number.

Example: What is the BCD code for the decimal number 98 ?

9 8 10
1001 1000 BCD
Question 6:

(a). Convert the following Decimal numbers into BCD format: 75, 156, 2567, 10100

(b). Convert the following BCD numbers into Decimal format: 0001 1001, 1000
0111, 0010 0011 1000, 1000 0001 0010

© Alfred Galea – 2008/09 Page 8


Logic Gates:

A logic gate is a circuit that performs a logic function on a number of input Binary
(Digital) signals. One gate is the basic building block from which many different
kinds of logic circuits can be constructed. Signals at the inputs of the gate are either
HIGH or LOW. The output then gives another digital HIGH or LOW signal according
to the combinations of the inputs. The types of gates that will be considered in these
notes are: AND, OR, NOT, NAND, NOR, exclusive-OR (Ex-OR) and the exclusive-
NOR (Ex-NOR). Logic gates are represented with symbols. The mostly used are the
US or ANSI symbols, but nowadays there are also the IEC (BS3939) (International
Electro-technical Commission) symbols for Logic Gates. Both symbols will be
illustrated in these notes.

The Truth Table:

The table is used to define the logic functions of a gate. It lists all the possible
combinations of the input variables that can be applied. Every variable can only be at
either logic 1 or logic 0 voltage level. Under the Output column the table gives the
resulting output according to the input combination.

The Boolean Equation:

This is an algebraic equation representing the logic function of the logic gate or digital
circuit.

Building the Truth Table :

Let us consider a logic circuit having 4 inputs A, B, C, and D, and 1 output Y

The variables A, B, C and D are the inputs of the digital circuit or gate. The variable Y
represent the output of the digital circuit or gate. The output of the circuit will attain a logic 0
or 1 state according to the logic 0 or 1 state of the input variables. If we have only 1 input
variable, the logic states possible that we can have in the input are a 1 or a 0 (a total 0f 2).
When we have more than one input however, we will have more input, since there must be a
combination of the inputs. So, how can we decide the number of combinations we can have at
the inputs?

When we have only 1 input, the possible number of different inputs is 2 (0 or 1). This result is
the same as if we have 21. We agree that the power is actually the number of input/s we have
on our gate or circuit. So we can say that if we have a number of n inputs, the number of input
combinations that we can apply to the gate or circuit is equal to 2n.

So for the equation considered above, we will have 24 input combinations, or 16 different
combinations of inputs.

An easy way to create a truth table is as follows:

(1). From the number of inputs you have, decide how many combinations there can be during
the operation of the circuit.

© Alfred Galea – 2008/09 Page 9


(2). Draw the table with a number of columns equal to the number of inputs you have, and a
final column for the output, and a number of rows according to the number of combinations
you will have.

(3). Starting from the first input (column) on the left, fill in half of the rows with 0, and the
remaining half of the rows with 1.In the next input (column) to the right, there must be 4
groups of 0 and 1’s. In the following column, 8 groups, …… etc., until you end up with
alternating 0 and 1 under the last column of inputs. For a 4 input gate or circuit the table
becomes like this:

A B C D Y
0 0 0 0 X
0 0 0 1 X
0 0 1 0 X
0 0 1 1 X
0 1 0 0 X
0 1 0 1 X
0 1 1 0 X
0 1 1 1 X
1 0 0 0 X
1 0 0 1 X
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X

For the time being disregard the value of the output Y. That is why we listed it as a
result ‘X’. It can be either 0 or 1, but all depends upon the circuit particular function.
We will be understanding this as from now onwards by first doing the logic gates, and
then wiring the gates together to form our first digital circuits.

The AND gate:

For current to flow in circuit so that the lamp can


light up switches S1 AND S2 must be closed. The
switches are the inputs to the AND gate while the
lamp is the output. For input to be logic 1 the switch
must be closed. For the output to be logic 1 the lamp
must be ON.

© Alfred Galea – 2008/09 Page 10


The symbols for an AND gate are shown below:

A & Y
B

U.S. or ANSI Symbol IEC or BS3939 Symbol

The inputs to the gate are A and B while the output is Y.

The truth table for the AND gate is:

Inputs Output For Output Y to be at Logic 1, input A AND input B


must be at logic 1. Else Output is at logic 0.
A B Y
0 0 0 The Boolean Expression for the AND gate is:

0 1 0 Y=A.B
1 0 0
1 1 1

The OR gate:

For current to flow in circuit so that the lamp can light up


switches S1 OR S2 must be closed. The switches are the
inputs to the OR gate while the lamp is the output. For input
to be logic 1 the switch must be closed. For the output to be
logic 1 the lamp must be ON.

The symbols for the OR Gate are shown below:

A >1 Y
B

U.S. Symbol IEC Symbol

© Alfred Galea – 2008/09 Page 11


The truth table for the OR gate is:

Inputs Output For Output Y to be at Logic 1, input A OR input B


must be at logic 1. Output is at logic 0 only when both
A B Y inputs are at logic 0. Else Output is at logic 1.
0 0 0
The Boolean Expression for the OR gate is:
0 1 1
Y=A+B
1 0 1
1 1 1

Question 7: Draw the symbols for a 3-input AND Gate and then compile the truth
table and write the Boolean Expression for a 3-input AND Gate. Repeat question for a
3-input OR gate.

The NOT Gate:

A 1 Y
input

U.S. Symbol IEC Symbol

The NOT gate is also called ‘INVERTER’. This is because the function of this gate is
to invert the input at the output. So if the input is at logic 1, the output will be at logic
0 and vice-versa.

The truth table for the NOT gate is:

Input Output The Boolean Expression for the NOT gate is:

A Y
Y=A
0 1
The bar over a symbol
1 0 means ‘NOT’ that
symbol – i.e. Not A

© Alfred Galea – 2008/09 Page 12


The NAND logic function:

A & Y
B

U.S. Symbol IEC Symbol

The NAND gate does the same function as the AND gate, but the Output is inverted.
We can call this function as the ‘NOT AND function’.
The truth table for the NAND gate is:

Inputs Output For Output Y to be at Logic 0, input A AND input B


must be at logic 1. Else Output is at logic 1.
A B Y
0 0 1 The Boolean Expression for the NAND gate is:

0 1 1 Y=A.B
1 0 1
1 1 0

Hence the NAND gate can be constructed using an AND gate and a NOT gate in
series.

© Alfred Galea – 2008/09 Page 13


The NOR logic function:

A >1 Y
B

U.S. Symbol IEC Symbol

The NOR gate does the same function as the OR gate, but the Output is inverted. We
can call this function as the ‘NOT OR function’.

The truth table for the NOR gate is:

Inputs Output For Output Y to be at Logic 0, input A OR input B


must be at logic 1. Else Output is at logic 0.
A B Y
0 0 1 The Boolean Expression for the NOR gate is:

0 1 0 Y=A+B
1 0 0
1 1 0

Hence the NOR gate can be constructed using an OR gate and a NOT gate in series.

Question 8: Compile a truth table for the circuit above to show that it does the same
function as the NOR gate.

© Alfred Galea – 2008/09 Page 14


The Exclusive OR gate:

In the Exclusive-OR gate, known also as EX-OR gate, has just two inputs and only
one Output. The Output is HIGH (logic 1) only when either one, but not both, of the
inputs is also HIGH. The symbols for the EX-OR gate are shown below

A =1 Y
B

U.S. or ANSI Symbol IEC or BS3939 Symbol

The truth table for the EX-OR gate is:

Inputs Output

A B Y The Boolean Expression for the EX-OR gate is written


0 0 0 as shown below:

0 1 1 Y=A + B
1 0 1
1 1 0

The Exclusive NOR gate:

This is also sometimes called as the ‘Coincidence’ gate. It produces a logic 1 level at
the output only when the two inputs are at the same level. The symbols and the truth
table for the EX-NOR gate are given below.

Exclusive-NOR Gate A =1 Y
B

U.S. Symbol IEC Symbol

© Alfred Galea – 2008/09 Page 15


Truth Table:

Inputs Output

A B Y The Boolean Expression for the EX-NOR gate is


0 0 1 written as shown below:

0 1 0 Y = A.B + A.B
1 0 0
1 1 1

Logic Circuits and Boolean Expressions:

Combinational logic circuits are composed of basic logic gates connected together to
form a new, more complex, logic function.

Analysis (Understanding the operation) of logic circuits

A combinational logic circuit is analyzed by proceeding from its input terminals


through to its output. The Boolean equation or expression for the output of each gate
is written down and combined to obtain the equation for the output Y of the circuit. A
truth table then gives the output of the circuit for each of the possible combination of
the input signals. Logic function at intermediate points of the circuit can be
determined to simplify the determination of the output function of the circuit.

Consider the logic circuit shown below:

A
A+ B
B

Y = (A + B) . C

C C

Now write the truth table for the circuit above. Work out intermediate logic functions
first and then obtain the final output Y.

© Alfred Galea – 2008/09 Page 16


Truth Table for the circuit:

A B C A+B C Y=(A+B).C
0 0 0 0 1 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 1 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 1 1 1
1 1 1 1 0 0

Question 9: For the circuit shown below, produce the boolean expression of each
logic gate, and that of the circuit output. Produce the truth table of the circuit

A
B Y

Question 10: Analyze the circuit shown below. Write down the boolean expression of
the circuit and then produce the truth table. Use the truth table to determine the output
when (a) A = B = C = 1, and (b) A = C = 0 and B = 1. What is the logic function of
the circuit?
A
B
Y

© Alfred Galea – 2008/09 Page 17


Question 11: In the circuit shown below, find the boolean equation output of each
logic gate, and then produce the final boolean equation for the whole circuit (ie:
expression for Y). Find the condition of the circuit output Y when the inputs are:
(a) A = B = C = 1 (b) A = B = C = 0 (c) A =B = 0 and C = 1

A
B

© Alfred Galea – 2008/09 Page 18

You might also like