Digital Electronics Notes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

Contents

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.

1.3 Digital Waveforms

 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.

Overshoot is a phenomenon where a


system’s response to a
sudden input change
exceeds the intended output
level.
Undershoot is a phenomenon where a
system’s response to a
sudden input change drops
below the intended output
level.
Ringing output signal oscillates at a
fading rate around a sharp
transition in the input, similar
to a bell after being struck
Droop Voltage droop is the
intentional reduction of a
signal’s voltage levels to
lessen the effects of t
response on a system

Rise Time Time required for pulse to


transition from its LOW level
to HIGH level

Fall Time Time required for pulse to


transition from its HIGH
level to LOW level

Pulse Width
Measure of the duration of
pulse and is defined as the
time intervals between 50%
points on rising and falling
edges.

1.4 Waveform characteristics


 Most waveforms encountered in digital systems are composed of series of pulses,
sometimes called pulse trains, and can be classified as either periodic or
nonperiodic / aperiodic.
 A periodic pulse waveform is one that repeats itself at a fixed interval, called a period
(𝑇). The frequency (𝑓) is the rate at which it repeats itself and is measured in hertz
(Hz).
 An important characteristic of a periodic digital waveform is its duty cycle, which is
the ratio of the pulse width (t w) to the period (𝑇). It can be expressed as a
percentage:

1.5 The Clock


 In digital systems, all waveforms are synchronized with a basic timing waveform
called the clock. This is a periodic waveform in which each interval between pulses
(the period) equals the time for one bit.
 each change in level of waveform A occurs at the leading edge of the clock
waveform.

1.6 Timing diagrams


 A timing diagram is a graph of digital waveforms showing the actual time relationship
of two or more waveforms and how each waveform changes in relation to the others.
By looking at a timing diagram, you can determine the states (HIGH or LOW) of all
the waveforms at any specified point in time and the exact time that a waveform
changes state relative to the other waveforms.

2 Binary Arithmetic Operations and Number Systems

2.1 Number Systems

1. Binary to decimal conversion


Binary to decimal conversion
Decimal to binary

Octal to decimal

Decimal to octal

2. Hexadecimal Number Systems


Decimal Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Equivalent Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F

Problem 1: Convert decimal number 49 into hexadecimal.

Divide by 16 Quotient Remainder Hex Value

49 ÷ 16 3 1 1

3 ÷ 16 0 3 3

4910 = 3116.

Problem 2: Convert 122810 into hex.


Divide by 16 Quotient Remainder Hex Value

1228 ÷ 16 76 12 C

76 ÷ 16 4 12 C

4 ÷ 16 0 4 4

122810 = 4CC16

Problem 3: Convert 60010 into a hexadecimal number.

Divide by 16 Quotient Remainder Hex Value

600 ÷ 16 37 8 8

37 ÷ 16 2 5 5

2 ÷ 16 0 2 2

60010 = 25816

3. Octal Number Systems


 Octal to Decimal Conversion
 Count the number of digits present in the given number. Let the number of digits be
‘n’.
 Now multiply each digit of the number with 8 n-1, when the digit is in the nth position
from the right end of the number. If the number has a decimal part, multiply each digit
in the decimal part by `8-m` when the digit is in the mth position from the decimal point.
 Add all the terms after multiplication.
 The obtained value is the equivalent decimal number.

 Decimal to Binary Conversion


 Take the above-produced decimal number and divide it by 2.
 Note down the remainder.
 Continue the above two steps for the quotient till the quotient is zero.
 Write the remainder in the reverse order.
 The received number is the equivalent binary number for the given octal number.
Example: Convert 418 to a binary number
Solution: Given number is 418
418 = (4 * 81) + (1 * 80)
=4*8+1*1
= 32+1
= 33(Decimal number)

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

Q.2: Convert 108 to a binary number.


Solution: Given number is 108
108 = (1 * 81) + (0 * 80)
=1*8+0*1
=8+0
= 8 (Decimal number)
Now convert this decimal number into its equivalent binary number.

Decimal Number divided by 2 Quotient Remainder

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

Example: Convert 128 into a binary number.


Solution: Given, 128 is the octal number.
Now with the help of the table, we can write;
128 = (001 010)2
Since zeros on the left, most of digit 1 does not have any significance. Thus,
128 = (1010)2

 Conversion from Binary to Octal


steps:
1) Take the given binary number
2) Multiply each digit by 2n-1 where n is the position of the digit from the decimal
3) The resultant is the equivalent decimal number for the given binary number
4) Divide the decimal number by 8
5) Note the remainder
6) Continue the above two steps with the quotient till the quotient is zero
7) Write the remainder in the reverse order
8) The resultant is the required octal number for the given binary number

Decimal Number Octal Number

0 0

1 01

2 010

3 011
4 100

5 101

6 110

7 111

Binary to Octal conversion Examples


Example 1: Convert 10101012 to octal
Given binary number is 10101012
First, we convert given binary to decimal
10101012 = (1 * 26) + (0 * 25 ) + (1 * 24) + (0 * 23) + (1 * 22) + (0 * 21) + (1 * 20)
= 64 + 0 + 16 + 0 + 4 + 0 + 1
= 64 + 21
0101012= 85 (Decimal form)
Now we will convert this decimal to octal form

Therefore, the equivalent octal number is 1258.

Example 2: Convert 011012 to octal


Solution:
Given binary number is 011012
First, we convert given binary to decimal
011012 = (0 * 24) + (1 * 23) + (1 * 23) + (0 * 2) + (1 *20)
= 0 + 8 + 4 + 0 +1
011012= 13 (Decimal form)
Now we will convert this decimal to octal form

Therefore, the equivalent octal number is 158.

4. Binary Coded Decimal (BCD)


 4 bits of BCD per decimal digit
 Steps to convert decimal to BCD:
1. Convert each digit into 4-bit binary numbers
2. Put the 4-bit binary numbers together
 Converting Decimal to BCD example: Convert 1210 to BCD
Decimal 1 2
4-bit Binary 0001 0010
1210 = 00010010BCD

 Steps to convert BCD to decimal:


1. Group the number into 4 bits
2. Convert each group of 4-bit number into decimal
 Converting BCD to decimal example: Convert 00010010 to Binary
BCD 0001 0010
Decimal 20 = 1 21 = 2
00010010BCD = 1210

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

Binary MSB 1 XOR 0 XOR 1 XOR 1

GRAY 1 1 1 0

138 = 1110GRAY

2.2 Binary Arithmetic Operations

Signed Binary Numbers


 Digital systems, such as the computer, must be able to handle both positive and
negative numbers.
 A signed binary number consists of both sign and magnitude information.
 The left-most bit in a signed binary number is the sign bit, which tells you whether
the number is positive or negative.
2’s Complement Form
 Positive numbers in 2’s complement form are represented the same way as in the
signed magnitude and 1’s complement forms.
 Negative numbers are the 2’s complements of the corresponding positive numbers.
 For the decimal number -25, we express it as the 2’s complement of +25 (00011001).
Inverting each bit and adding 1, you get
−25=11100111
Addition/Subtraction
 There are four cases that can occur when two signed binary numbers are added:
1. Both numbers positive
2. Positive number with magnitude larger than negative number
3. Negative number with magnitude larger than positive number
4. Both numbers negative

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.

GATE Truth Table Timing Diagram Timing Diagram

3.2 AND Gate


 The AND gate is one of the basic gates that can be combined to form any logic
function.
 An AND gate can have two or more inputs and performs what is known as logical
multiplication.

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

Truth table with 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

You might also like