Digital Electronics Notes
Digital Electronics Notes
Digital Electronics Notes
1 Introduction..................................................................................................... 2
1.1 Analog and Digital Signals.......................................................................2
1.2 Binary Digits............................................................................................ 3
1.3 Digital Waveforms.................................................................................... 3
1.4 Waveform characteristics........................................................................4
1.5 The Clock................................................................................................. 4
1.6 Timing diagrams...................................................................................... 5
2 Binary Arithmetic Operations and Number Systems.......................................5
2.1 Number Systems...................................................................................... 5
1. Binary to decimal conversion...................................................................5
2. Hexadecimal Number Systems................................................................6
3. Octal Number Systems............................................................................ 7
4. BCD or Binary Coded Decimal................................................................11
5. GRAY Code............................................................................................. 12
2.2 Binary Arithmetic Operations.................................................................14
Signed Binary Numbers................................................................................. 14
2’s Complement Form................................................................................... 14
Addition/Subtraction...................................................................................... 14
6. Overflow Condition................................................................................. 14
7. Multiplication......................................................................................... 15
3 Logic Gates.................................................................................................... 16
3.1 NOT Gate............................................................................................... 16
3.2 AND Gate............................................................................................... 17
3.3 OR.......................................................................................................... 18
3.4 NAND..................................................................................................... 19
3.5 NOR........................................................................................................ 20
3.6 XOR........................................................................................................ 21
3.7 XNOR..................................................................................................... 22
1 Introduction
1.1 Analog and Digital Signals
Analog signals are continuous electrical signals that vary in time. The signal can take
any value on the amplitude/intensity axis, as shown in Figure 1.
Digital signals can be continuous or non-continuous. They change in individual,
abrupt steps and they take discrete levels on the amplitude/intensity axis (0 or 1,
LOW or HIGH, FALSE or TRUE). The value of each pulse is constant for a period of
time, as shown in Figure 2.
1.2 Binary Digits
The binary system consists of two digits, 1 and 0, and each of the two digits is called
a bit, which is a contraction of the words binary digit.
This is called positive logic and will be used throughout this course.
Another system in which a 1 is represented by a LOW and a 0 is represented by a
HIGH is called negative logic.
Groups of bits (combinations of 1s and 0s), called codes, are used to represent
numbers, letters, symbols, instructions, and anything else that may be required in a
given application.
Digital waveforms consist of voltage levels that are changing back and forth between
the HIGH and LOW levels or states.
a leading edge that occurs first at time t 0 and a trailing edge that occurs last at time t 1
.
What Is Overshoot?
Overshoot and Undershoot Measures the times,
locations, and amounts by
which a waveform rises
above and falls below a
state level before or after a
transition.
Pulse Width
Measure of the duration of
pulse and is defined as the
time intervals between 50%
points on rising and falling
edges.
Octal to decimal
Decimal to octal
Equivalent Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
49 ÷ 16 3 1 1
3 ÷ 16 0 3 3
4910 = 3116.
1228 ÷ 16 76 12 C
76 ÷ 16 4 12 C
4 ÷ 16 0 4 4
122810 = 4CC16
600 ÷ 16 37 8 8
37 ÷ 16 2 5 5
2 ÷ 16 0 2 2
60010 = 25816
Now convert this decimal number into its equivalent binary number.
Decimal Number divided by 2 Quotient Remainder
33 divided by 2 16 1
16 divided by 2 8 0
8 divided by 2 4 0
4 divided by 2 2 0
2 divided by 2 1 0
1 divided by 2 0 1
8 divided by 2 4 0
4 divided by 2 2 0
2 divided by 2 1 0
1 divided by 2 0 1
108 = 10002
Convert Octal to Binary Using Table
We can also use the octal number table to convert a number with base 8 to a number with
base 2.
Octal Number Equivalent Binary Number
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
0 0
1 01
2 010
3 011
4 100
5 101
6 110
7 111
GRAY Code
Steps to convert octal or decimal to GRAY:
Octal to binary:
1. Convert each digit into 3 digit binary numbers
2. Put the 3 digit binary numbers together
Decimal to binary:
1. Convert from decimal to binary by division method
2. Put the binary digits together
5. Binary to GRAY:
3. The left most 1 is the MSB
4. Do XOR operation between adjacent digits
5. Put all digits together
Converting 138 to binary then GRAY:
1) Octal to Binary
Octal 1 3
3-bit Binary 001 011
138 = 0010112
2) Binary to GRAY
GRAY 1 1 1 0
138 = 1110GRAY
6. Overflow Condition
When two numbers are added and the number of bits required to represent the sum
exceeds the number of bits in the two numbers, an overflow results.
This is indicated by an incorrect sign bit.
An overflow can occur only when both numbers are positive or both numbers are
negative.
If the sign bit of the result is different than the sign bit of the numbers that are added,
overflow is indicated.
7. Multiplication
3 Logic Gates
3.1 NOT Gate
The inverter (NOT gate) performs the operation called inversion or complementation.
Input
Combinations
Truth Table
Timing
Diagram
3.3 OR
The OR gate is another of the basic gates from which all logic functions are
constructed.
An OR gate can have two or more inputs and performs what is known as logical
addition.
An OR gate produces a HIGH on the output when any of the inputs is HIGH. The
output is LOW only when all of the inputs are LOW.
Input Combinations
Truth Table
Timing Diagram
3.4 NAND
The NAND gate is a popular logic element because it can be used as a universal
gate; that is, NAND gates can be used in combination to perform the AND, OR, and
inverter operations.
This universal property of the NAND gate will be examined thoroughly in Chapter 5
The term NAND is a contraction of NOT-AND and implies an AND function with a
complemented (inverted) output
Input Combinations
Truth Table
Timing Diagram
Notation
3.5 NOR
The NOR gate, like the NAND gate, can be used as a universal gate.
The term NOR is a contraction of NOT-OR and implies an OR function with a
complemented (inverted) output
Input Combinations
Truth Table
Timing Diagram
Notation
3.6 XOR
The standard symbol and the truth table for an exclusive-OR (XOR for short) gate are
shown below
The XOR gate has only two inputs and it performs modulo-2 addition.
Input
Combinations
Truth Table
Timing
Diagram
Notation
Gate
3.7 XNOR
The standard symbol and the truth table for an exclusive-NOR (XNOR for short) gate
are shown below
The bubble on the output of the XNOR symbol indicates that its output is opposite
that of the XOR gate.
When the two input logic levels are opposite, the output of the exclusive-NOR gate is
LOW.
Input
Combinations
Truth Table
Timing
Diagram
Notation
Gate