Anda di halaman 1dari 110

DIGITAL ELECTRONICS BASICS

UNIT IV - DIGITAL ELECTRONICS


Number systems used in digital electronics, decimal, binary, octal, hexadecimal, their complements, operation and conversion, floating point and signed numbers, Demorgans theorem, AND, OR, NOT, NOR, NAND, EX-NOR, EX-OR gates and their representation, truth table, half and full adder circuits, RS flip flop, J-K flip flop.

UNIT V - ELECTRONIC COMPONENTS AND CIRCUITS


Introduction to Semiconductors, Diodes, V-I characteristics, Bipolar junction transistors (BJT) and their working, introduction to CC, CB & CE transistor configurations, different configurations and modes of operation of BJT, DC biasing of BJT.

UNIT- 4
1) Number systems used in digital electronics 2) Decimal, binary, octal, hexadecimal 3) Their complements, operation and conversion, 4) Floating point and signed numbers, 5) Demorgans theorem 6) AND, OR, NOT, NOR, NAND, EXNOR, EX-OR gates 7) Half and full adder circuits 8) R-S flip flop, J-K flip flop.

NUMBER SYSTEMS USED IN DIGITAL ELECTRONICS

ASCII

It depends on the number system

Number Systems
The system used to count discrete units is called number system. There are four systems of arithmetic which are often used in digital electronics.
Decimal Number System Binary Number System Octal Number System Hexa Decimal System

Decimal Number system


Decimal number system contains 10 digits: 0,1,2,3,4,5,6,7,8,9; and that is why its base or radix is 10.
Here radix means total number of digits used in any system.

To indicate digits greater than 9 (nine) we shall use the sum of these digits times power of 10.

Decimal Number System


The decimal number system is a positional

number system.
Example:

5 6 2 1
103 102 101 100

1 X 100 2 X 101 6 X 102 5 X 103

= 1 = 20 = 600 = 5000

Binary Number System


The binary number system is also a positional numbering system. Instead of using ten digits, 0 - 9, the binary system uses only two digits, 0 and 1.

Binary Number System


The binary number system is also known as

base 2. The values of the positions are calculated by taking 2 to some power.
Why is the base 2 for binary numbers?
o

Because we use 2 digits, the digits 0 and 1.

Fractional BINARY SYSTEM


In the binary system, there are only two symbols or possible digit values, 0 and 1. This base-2 system can be used to represent any quantity that can be represented in decimal or other number system.
24 23 22 21 20 21 22 23
24 25

In digital systems the information that is being processed is usually presented in binary form. Binary quantities can be represented by any device that has only two operating states or possible conditions. Eg. a switch has only open or closed. We arbitrarily (as we define them) let an open switch represent binary 0 and a closed switch represent binary 1. Thus we can represent any binary number by using series of switches.

Octal Number System


Also known as the Base 8 System Uses digits 0 - 7 Readily converts to binary Groups of three (binary) digits can be used to represent each octal digit Also uses multiplication and division algorithms for conversion to and from base 10

Fractional OCTAL NUMBER SYSTEM


The octal number system has a base of eight, meaning that it has eight possible digits: 0,1,2,3,4,5,6,7.
84 83 82 81 80 81 82 83 84 85

Use to represent long binary numbers in computers and microprocessors.

Hexadecimal Number System


Base 16 system Uses digits 0-9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit

Fractional HEXADECIMAL NUMBER SYSTEM


The hexadecimal system uses base 16. Thus, it has 16 possible digit symbols. It uses the digits 0 through 9 plus the letters A, B, C, D, E, and F as the 16 digit symbols.

164 163 162 161 160 161 162 163 164 165

Use to represent long binary numbers in computers and microprocessors. These digits can use to program machine language.

Binary Numbering Scale


Base 2 Number Base 10 Equivalent Power Positional Value

000
001 010 011

0
1 2 3

20
21 22 23

1
2 4 8

100 101 110 111

4 5 6 7

24 25 26 27

16 32 64 128

Significant Digits
Binary: 11101101
Most significant digit Least significant digit

Hexadecimal: 1D63A7A
Most significant digit Least significant digit

Number systems conversion between 1) ) Decimal 2 , binary, 3 octal, 4 hexadecimal

Number systems conversion between decimal, binary, octal, hexadecimal


DECIMAL BINARY
Repeat division method

OCTAL
Repeat division method

HEXADECIMAL
Repeat division method

DECIMAL

BINARY

OCTAL

HEXADECIMAL

CONVERTING FROM DECIMAL TO BINARY

Make a list of the binary place values up to the number being

converted. Perform successive divisions by 2, placing the remainder of 0 or 1 in each of the positions from right to left. Continue until the quotient is zero. Example: 4210
25 24 23 22 21 20 32 16 8 4 2 1 1 0 1 0 1 0

DECIMAL TO BINARY CONVERTION


There are two methods to convert it:-

i. Revese of Binary-To-Digital Method Decimal number write as the sum of square


0 & 1 is write on the byte Example 1: Convert 4510 to the binary value Solve = 45 10 = 32 + 8 + 4 + 1 = 25 0 2 3 2 2 0 2 0
=

12

ii. Repeat division method The numbers is divide by 2. Balance for the question is written until the last answer.

Example : convert 2510 to binary


Solve = 2510 = ?2 = 25 2

12 balance 1

LSB

= 12 6 balance 0 2 = 6 3 balance 0 2 3 = 2 1 balance 1 = 1 0 balance 1 2 ... Answer = 110012

MSB

Decimal to Binary Conversion


The easiest way to convert a decimal number to its binary equivalent is to use the Division Algorithm This method repeatedly divides a decimal number by 2 and records the quotient and remainder
The remainder digits (a sequence of zeros and ones) form the binary equivalent in least significant to most significant digit sequence

Convert 67 to its binary equivalent:


6710 = x2
Step 1: 67 / 2 = 33 R 1 Step 2: 33 / 2 = 16 R 1 Step 3: 16 / 2 = 8 R 0 Step 4: 8 / 2 = 4 R 0 Step 5: 4 / 2 = 2 R 0 Step 6: 2 / 2 = 1 R 0 Step 7: 1 / 2 = 0 R 1

DIVISION ALGORITHM
Divide 67 by 2. Record quotient in next row Again divide by 2; record quotient in next row Repeat again Repeat again Repeat again Repeat again STOP when quotient equals 0

1 0 0 0 0 1 12

Decimal to binary (fractional)


Examples: Convert the decimal number (12.0625)10 into binary number. Solution: Fractional part: 0.0625 x 2 = 0.1250 0 0.1250 x 2 = 0.2500 0 0.2500 x 2 = 0.500 0 0.500 x 2 = 1.000 1

(12.0625)10 = (1100.0001)2

DECIMAL TO OCTAL CONVERSION

Decimal to Octal Conversion


Examples: (315)10 = (473)8
8 315 8 39 8 4 0 3 7 4 LSD MSD

DECIMAL TO OCTAL CONVERTION


Convert from decimal to octal by using the repeated division method used for decimal to binary conversion. Divide the decimal number by 8 The first remainder is the LSB and the last is the MSB.

Example : convert 35910 to Decimal Value Solve = 35910 = ?8 = 359 44 balance 7 8 = 44 5 balance 4 8 = 5 0 balance 5 8 ... Answer = 5478

LSB

MSB

Decimal to Octal Conversion


Convert 42710 to its octal equivalent:
427 / 8 = 53 R3 53 / 8 = 6 R5 6 / 8 = 0 R6 Divide by 8; R is LSD Divide Q by 8; R is next digit Repeat until Q = 0

6538

Decimal to Octal (fractional)


Examples: Convert the decimal number (225.225)10 into octal number. Solution: Fractional part: 0.225 x 8 = 1.800 1 0.800 x 8 = 6.400 6 0.400 x 8 = 3.200 3 0.200 x 8 = 1.600 1 0.600 x 8 = 4.800 4 (225.225)10 = (341.16314)8

Decimal to Hexadecimal Conversion

Decimal to Hexadecimal Conversion


Examples

(315)10 = (13B)16

16 315 16 19 16 1 0

B 3 1

LSD MSD

Decimal to Hexadecimal Conversion

Convert 83010 to its hexadecimal equivalent:


830 / 16 = 51 R14 51 / 16 = 3 R3 3 / 16 = 0 R3
= E in Hex

33E16

Decimal to Hexadecimal (fractional)


Examples: Convert the decimal number (225.225)10 into hexadecimal number. Solution: Fractional part: 0.225 x 16 = 3.600 3 0.600 x 16 = 9.600 9

(225.225)10 = (E1.39)16

01
Binary to Decimal

The easiest method for converting a binary number to its decimal equivalent is to use the Multiplication Algorithm Multiply the binary digits by increasing powers of two, starting from the right Then, to find the decimal number equivalent, sum those products

Multiplication Algorithm
Convert (10101101)2 to its decimal equivalent: Binary

x x x x x x x x
128 32 8 4 1

0 1 0 1 1 0 1

Positional Values
Products

27 26 25 24 23 22 21 20

128 + 32 + 8 + 4 + 1 =17310

Example (1 0 0 1 1 0 1)2 = ( )10 Solution20 = 1 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 1 X 20 = 1 0 X 21 = 0 1 X 22 = 4 1 X 23 = 8 0 X 24 = 0 0 X 25 = 0 1 X 26 = 64 total = 72 10

(Ans)

Practice conversions:
Binary Decimal

11101 1010101 100111 100001 101010

BINARY TO OCTAL

Can be converted by grouping the binary bit in group of three starting from LSB Octal is a base-8 system and equal to two the power of three, so a digit in Octal is equal to three digit in binary system.

Example- (111001) binary =( ) octal


Solution - By grouping the binary bit in group of three .

1
7

0
1

Ans - 71

Practice conversions: Binary 1110101 101010111 10011100 10000100 10101011 Octal

03 Binary tO hexadecimal

binary to hexadecimal system

1 Group the digits of the binary number by four starting from the right. 2 Replace each group of four digits by an equivalent hexadecimal digit.
Convert 101101012 into a hexadecimal number. 1011 01012 = B516 B 5

Exercise
1) 2) 3) 4) 5) 6) 7) Convert 11110002 into a hexadecimal number. Convert 10101002 into a hexadecimal number. Convert 10100102 into a hexadecimal number. Convert 111011112 into a hexadecimal number. Convert 10100012 into a hexadecimal number. Convert 11100102 into a hexadecimal number. Convert 10111002 into a hexadecimal number.

01 BINARY

OCTAL

02

03- HEXA

DECIMAL

DECIMAL

01 Octal To Decimal

Convert 6538 to its decimal equivalent:

Octal Digits
Positional Values Products

5
x

3
x

82 384

81 40

80 + 3

42710

02 OCTAL TO BINARY

OCTAL TO BINARY CONVERTION


Convert from octal to binary by converting each octal digit to a three bit binary equivalent
Octal digit Binary Equivalent 0 1 2 3 4 5 6 7 000 000 000 000 000 000 000 000

Convert from binary to octal by grouping bits in threes starting with the LSB. Each group is then converted to the octal equivalent Leading zeros can be added to the left of the MSB to fill out the last group.

Each octal number converts to 3 binary digits

Q - To convert 6538 to binary, just substitute code:


SOLUTION -

110 101

011

03 Hexadecimal to Decimal

Hexadecimal to Decimal Conversion


Convert 3B4F16 to its decimal equivalent:
Hex Digits

Positional Values
Products

B
x

4
x

F
x

163 162 161 160

12288 +2816 + 64 +15

15,18310

HEXADECIMAL TO

BIANRY DECIMAL

OCTAL

01 HEXADECIMAL TO BINARY

HEXADECIMAL TO binary
To convert a hexadecimal to binary number, convert each hexadecimal digit to its 4 bit equivalent using the hexa number.
Example: (23.AB)16 = ()2 Solution: (23.AB)16 = 2 3 . A 1010 B 1011

0010 0011 Ans- (23.AB)16 = (00100011.10101011)2

02 HEXADECIMAL TO OCTAL

HEXADECIMAL TO OCTAL CONVERTION


There is two ways to convert it:i. Hexadecimal Decimal Octal ii. Hexadecimal Binary Octal

i.

Hexadecimal Binary Octal

Hexadecimal Number System


Binary Decimal Hexadecimal Binary Decimal Hexadecimal

0 1 10 11 100 101 110 111 1000 1001

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

1010 1011 1100 1101 1110 1111

10 11 12 13 14 15

A B C D E F

COMPLEMENTS & OPERATION OF NUMBER SYSTEM

COMPLEMENTS OF NUMBER SYSTEM

Complements of number
Two types of compliments N and N-1 compliments. N- base of number system.

Number system 1) Binary 2) Decimal3) Octal 4) Hexadecimal -

Base N=2 N=10 N=8 N=16

N-1 1 9 7 15

N 2 10 8 16

Binary 1s and 2s Complements

Introduction

Subtraction of a number from another can be accomplished by adding the complement of the subtrahend to the minuend.

1s Complement Subtraction
Subtraction of binary numbers using the 1s complement method allows subtraction only by addition.

Cont.,

The 1s complement of a binary number can be

obtained by changing all 1s to 0s and all 0s and 1s.


Ex- 10101001

1st compliment- 01010110

1s complement method

To subtract a smaller number from a larger number, the 1s complement method is as follows

1. Determine 2. Add this the tothe the 1s larger complement the smaller number. 3. Remove carry andnumber add it to of the result. This carry is called end-around-carry

Example of 1s complement
Subtract (1010)2 from (1111) 2
1s complement method

Direct Subtraction
1 1 1 1
1 0 1 0 0 1 0 1

1 1 1 1

1s complement Carry Add Carry

0 1 0 1 1 0 1 0 0 1 0 10 1

Subtraction Steps

Subtraction of a large number a smaller one by the 1s complement method involves the following steps

1. The 2. 3. Determine Add answer this to the the is the 1s smaller 1s complement complement number of of a large the result number and is opposite in sign. There is no carry.

2s Complement Subtraction
The 2s complement of a binary number can be obtained by adding 1 to its 1s complement.

Steps
Subtraction of a smaller number from a larger one by
the 2s complement method involves the following

steps
1. 2. 3. Determine the ( 2s complement the smaller number Add this Omit theto carry larger there number is always of a carry in this case )

Example of 2s complement
Subtract (1010)2 from (1111) 2
Direct Subtraction
1 1 1 1 1 0 1 0 0 1 0 1

2s complement method
1 1 1 1

2s complement Carry

0 1 1 0 1 0 1 0 1

Subtraction Steps
The carry is discarded. Thus answer is (0101)2 The 2s complement method for subtraction of a

large number from a smaller one is as follows.

1. To 2. 3. Determine Add There the is no 2s the carry complement 2s . in The complement result to the is in smaller of 2s the complement larger number form 4. get an answer true form, take the 2s number is negative and change the sign. complement

Comparison between 1s and 2s complements


1s Complement It can be easily obtained using an Inverter 2s Complement It has to be arrived at by first obtaining the 1s complement and then adding one (1) to it Only one arithmetic operation is required It is used only for arithmetic applications

It requires two operations

It is often used in logical manipulations for inversion operation

ADDITION

DIVISION

BINARY ARTHMATICS

SUBTRCTION

MULTIPLIC ATION

BINARY ARITHMETIC
Binary arithmetics is essential in all digital computers and in many other types of digital systems. To understand digital systems, you know the basic of binary addition, subtractionn , multiplication, and division.

AFTER COMPLETING THIS SECTION, YOU SHOULD BE ABLE TO 1 ) Add binary number. A+B
2 ) Subtract binary number. A-B 3 ) Multiply binary number. A*B
4 ) Divide binary number. A/B

Binary Addition & Subtraction

Addition Rules
0 + 0 = 00 ( sum = 0 with 0 carry )

0 + 1 = 01 ( sum = 1 with 0 carry )


1 + 0 = 01 ( sum = 1 with 0 carry ) 1 + 1 = 10 ( sum = 0 with 1 carry )

Addition Rules
0 +0 0 0 1 +0 0 1 0 +1 0 1 1 +1 1 0

87

Addition Rules w/Carries


0+0+0 = 00 (0 WITH 0 CARRY) 0+0+1 = 01 (1 WITH 0 CARRY) 0+1+1 = 10 (0 WITH 1 CARRY) 1+1+1 = 11 (1 WITH 1 CARRY)

Adding Binary Numbers

28 + 43 71

00011100 + 00101011

0 1 1 1 0 0 0

01000111

89

1S Complement
01010011

Invert All Bits

10101100

90

2S Complement
01010011

Invert All Bits


Add One

10101100 +1 10101101

91

Add/Sub : 4 Combinations
9 + 5 14
9 + (-5) 4

Positive / Positive Positive Answer

Negative / Positive Negative Answer

(-9) + 5 -4
(-9) + (-5) - 14
92

Positive / Negative Positive Answer

Negative / Negative Negative Answer

Positive / Positive Combination


9 + 5 14

Positive / Positive Positive Answer

00001001 + 00000101 00001110

Both Positive Numbers Use Straight Binary Addition

93

Positive / Negative Combination


9 + (-5) 4

Positive / Negative Positive Answer

00001001 + 11111011 1]00000100


8th Bit = 0 : Answer is Positive Disregard 9th Bit

1-Positive / 1-Negative Take 2s Complement Of Negative Number (-5)

00000101

11111010 +1 11111011

2s Complement Process

94

Negative / Positive Combination


(-9) + 5 - 4 11110111 + 00000101 11111100
8th Bit = 1 : Answer is Negative Take 2s Complement to Check Answer

Positive / Negative Negative Answer

1-Positive / 1-Negative Take 2s Complement Of Negative Number (-9)


2s Complement Process

11111100

00001001

00000011 +1 00000100

11110110 +1 11110111

2s Complement Process

95

Negative / Negative Combination


(-9) + (-5) - 14

Negative / Negative Negative Answer

11110111 + 11111011

2s Complement Numbers, See Conversion Process In Previous Slides

2-Negative Take 2s Complement Of Both Negative Numbers


2s Complement Process

1]11110010
8th Bit = 1 : Answer is Negative Disregard 9th Bit Take 2s Complement to Check Answer

11110010

00001101 +1 00001110
96

2S Complement Quick Method


Example:

11101100

1) Start at the LSB and write down all zeros moving to the left. 2) Write down the first 1 you come to. 3) Invert the rest of the bits moving to the left.

0 0 01 0 1 0 0
97

Question- Addition of 2 binary number 1110 and 111? Solution ,

Carry

Carry

1 + 0
1 0
SUM - 10101

1 1
1

1 0 1 1 0 1

Class work
Q1- Add the following binary no. 1) 101+111 2)11+01 3)1101101+1101 Ans1) 1100 2) 100 3)1111010

The End

.. Thank You

Nary substazB

FLOATING POINT AND SIGNED NUMBERS

DEMORGANS THEOREM

AND, OR, NOT, NOR, NAND, EXNOR, EX-OR gates and their representation

TRUTH TABLE

HALF AND FULL ADDER CIRCUITS

R-S FLIP FLOP

J-K FLIP FLOP