Anda di halaman 1dari 23

Chapter 10

BINARY ARITHMETIC, DECODING AND MUX LOGIC UNITS

Lesson 1

Binary Addition and Subtraction

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

Outline Half Adder Full Adder Addition of two 4-bit numbers Addition using a MSI IC Subtraction
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 3

Half adder
Cy'0 carry bit obtained at an output of adder circuit, S sum bit obtained at another output Circuit is called half adder (H.A.) if A add B = S plus Cy0

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

Half Adder 2 inputs and 2 outputs


Inputs A B
0 0 1 1 0 1 0 1

Outputs S Cy0
0 1 1 0 0 0 0 1

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

Half Adder
Circuit Cy0 S
A B
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 6

Outline Half Adder Full Adder Addition of two 4-bit numbers Addition using a MSI IC Subtraction
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 7

Full adder
Cyi1 and Cyi carry bits at the input and output of adder circuit at ith place, S sum bit obtained at another output Circuit is called full adder (H.A.) if Cyi1 add A add B = S plus Cyi' Place from right most to the leftmost in a number 0 to n1
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 8

Full Adder 2 inputs and 2 outputs


A
0 0 0 0 1 1 1 1

Inputs B Cyi1

Outputs S Cyi

0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

Full Adder
Circuit Cy0

A B Cyi1

S
10

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

Outline Half Adder Full Adder Addition of two 4-bit numbers Addition using a MSI IC Subtraction
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 11

4-bit Adder
A3 B3 A2 B2 A1 B1 A0 B0 Cy3 Cy2 Cy1 Cy0 Cy-1 0

F.A
S3

F.A
S2

F.A
S1

F.A
S0

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

12

Outline Half Adder Full Adder Addition of two 4-bit numbers Addition using a MSI IC Subtraction
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 13

4-bit Adder circuit MSI IC S3 S2 S1 S0 7483

Cyi-1

A3B3A2B2A1B1A0B0
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 14

Outline Half Adder Full Adder Addition of two 4-bit numbers Addition using a MSI IC Subtraction
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 15

Subtraction
Subtraction of B from A is addition of binary number A and twos complement of B Twos complement of B is addition of 1 with 1s complement of B. A method to find 1s complement of a bit is using an XOR at which one of the input = 1
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 16

B3

B2 A3 Cy3 Cy2 A2

B1 A1 Cy1

B0 A0 Cy0 Cy-1 = 0 for Add = 1 for subtract


17

F.A
S3

F.A
S2

F.A
S1

F.A
S0

4-bit Adder Cum subtractor


Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

4-bit Adder/Subtractor circuit MSI IC 7483

S3 S2 S1 S0 Cyi-1

Add/subtract
A3B3A2B2A1B1A0B0
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 18

Summary

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

19

Addition
Full adder takes two bits in input and outs sum bit and carry bit Full adder takes carry and two bits in input and outs sum bit and carry bit XOR gate generates carry 3-AND- 1-OR array generated Sum
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 20

Subtraction
Second input of full adder is through an XOR XOR connects other input to Sub/Add control signal and when 1 then full adder implements subtractor.

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

21

End of Lesson 1 on

Binary Addition and Subtraction

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

22

THANK YOU

Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005

23

Anda mungkin juga menyukai