Sunteți pe pagina 1din 15

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : P.Swarupa
Designation : Lecturer
Branch : ECE
Institute : Govt. Polytechnic, Masabtank, Hyd.
Semester : III Semester
Subject : Digital Electronics
Subject Code : EC – 304
Topic : Basics of Digital Electronics
Duration : 50 Mts.
Sub-Topic : Binary subtraction, Uses of codes
Teaching Aids : PPT Animations

EC304.5 1
Objectives
On the completion of this period, you would be able

to
• Perform Subtraction of Binary numbers
using 2’s complement method.
• know Use of Codes

EC304.5 2
Binary Subtraction

Case[1] Subtrahend is smaller than minuend.

• Find 2’s complement of subtrahend.

• Add this 2’s complement to the minuend,

• Neglect the carry

EC304.5 3
Example : Subtract 0110 from 1101 by using
2’s complement method.
1 1 0 1 ………. Minuend
0 1 1 0 ……...Subtrahend
2’s complement of 0110 is 1001 + 1 = 1010
So
1101
1010
10111 neglect the carry

The difference is 0 1 1 1

EC304.5 4
Case [ii] Subtrahend is larger than minuend

• Find 2’s complement of Subtrahend.

• Add the 2’s Complement to the minuend.

• The result is negative & in 2’s complement form. No carry

• To get the difference take the 2’s complement & put


minus sign.

EC304.5 5
EXAMPLE

Subtract 1101 from 1000 using 2’s complement method.


Subtrahend = 1101
2’s complement = 0010 + 1= 0011
minuend = 1000
2’s complement of subtrahend = 0011
1011
No carry. Answer is 2’s complement of 1011
ie , 0100 + 1= 0101

EC304.5 6
Use of digital codes

• All digital computers & systems are based on Binary


operation.

• Binary numbers are useful in analyzing or designing


digital circuits.

• A digital system requires less circuitry because it is


easier.

• To read and print out octal numbers.

EC304.5 7
Use of digital codes (Contd)

Hexadecimal numbers are used extensively in
microprocessor work.

• Excess -3 code is used with BCD numbers.

• Excess-3 code simplifies BCD addition.

• BCD code is used in calculators which deal


directly with Decimal numbers.

• Gray code is used in encoders.

EC304.5 8
Use of alphanumeric codes
• ASCII code is used by manufacturers to standardize Computer

Hardware.

• ASCII Code is used for sending digital data over telephone

lines.

• EBCDIC is the code of IBM.

EC304.5 9
Quiz
1.What is the complement of 1001

a. 0110

b. 1000

c.1011

d. 1111

EC304.5 11
2. The advantage of 2’s complement
subtraction is

a. Subtraction can be done using adder circuit

b. Increases Arithmetic hardware

c. Decreases Arithmetic software

d. Addition made simple

EC304.5 12
Frequently asked Questions
1. Use the 2’s complement method to perform the following

Subtractions

a. 1111 – 1011

b. 110011 – 100101

c. 100101 -110011

d. 1011 -1111

EC304.5 13
Frequently asked Questions(contd..)

2. Use the 2’s complement method to perform


subtraction of the following Decimal numbers

f. 54 – 65

b. 68 -32

j. 43 – 68

d. 65 – 54

EC304.5 14
Frequently asked Questions(contd..)

3. what are the uses of Digital codes?

4. what are the uses of alphanumeric codes?

EC304.5 15

S-ar putea să vă placă și