Lesson 1
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
Outputs S Cy0
0 1 1 0 0 0 0 1
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
Inputs B Cyi1
Outputs S Cyi
Full Adder
Circuit Cy0
A B Cyi1
S
10
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
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
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
F.A
S3
F.A
S2
F.A
S1
F.A
S0
S3 S2 S1 S0 Cyi-1
Add/subtract
A3B3A2B2A1B1A0B0
Ch10L1-"Microcontrollers....", Raj Kamal, from Pearson Education, 2005 18
Summary
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.
21
End of Lesson 1 on
22
THANK YOU
23