binary addition

18
Binary Addition CSC 103 September 17, 2007

Upload: mirra

Post on 25-Feb-2016

43 views

Category:

Documents


0 download

DESCRIPTION

Binary Addition. CSC 103 September 17, 2007. Recap: Binary Numbers. Physical representation Transistor Concept of “on” and “off” for physical manufacturing of computers  T/F… Abstract representation Logic: NOT, AND, OR Truth tables - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Binary Addition

Binary Addition

CSC 103September 17, 2007

Page 2: Binary Addition

Recap: Binary Numbers

• Physical representation– Transistor– Concept of “on” and “off” for physical

manufacturing of computers T/F…• Abstract representation

– Logic: NOT, AND, OR – Truth tables

• ANY Boolean expression can be built with transistors – wired as AND, OR or NOT

Page 3: Binary Addition

Recap: Transistors

= 0 = 1

= 0 or

= 1= 1

= 1 or

= 0

Page 4: Binary Addition

Logic Functions: NOT

• The ‘NOT’ function

A A’0 11 0

Page 5: Binary Addition

Recap Logic Gate: AND Function

1

1

(=1) 0

(=1)

0

0 0

0

Page 6: Binary Addition

Logic Gate: OR Function

1

1

0

0

0

1 1

Page 7: Binary Addition

Onto Addition and the Adder Circuit...

Page 8: Binary Addition

Binary Addition

• Add • 0 + 0 =• 0 + 1 =• 1 + 0 =• 1 + 1 =

• Add these numbersc:

1000111 1011010 0100110 0111001 s:

Page 9: Binary Addition

Binary Addition: Half Adder

• We need a circuit to add two bits– Either bit can be ‘0’ or ‘1’

• The function in the truth table is– Sum = A’B + AB’ Exclusive-OR function – Carry = AB

Page 10: Binary Addition

The Half-Adder and Exclusive OR Gate

• A’B + AB’ = Exclusive OR– Typically abbreviated to XOR– Simulator uses EOR

A B | S C0 0 | 0 00 1 | 1 01 0 | 1 01 1 | 0 1

AB’

A’ B

A B

A

B

Page 11: Binary Addition

Recap Logic Gates: Symbols

XOR

AB, AB A+B A, A’

Page 12: Binary Addition

Summary: The Half-Adder and Exclusive OR Gate

• Exclusive OR– Typically abbreviated to XOR– Simulator uses EOR

A

B

Page 13: Binary Addition

Binary Addition: Half Adder

Page 14: Binary Addition

Half-Adder Full-Adder

Page 15: Binary Addition

The Full Adder

• A full adder is a circuit with three inputs (including a ‘carry-in’) and two outputs (the sum and carry-out)– What is the third input?– Exercise: Add 111+ 101 (carry)

1 1 1 ( ‘A’ )

1 0 1 ( ‘B’ )

(sum)

• For adding two numbers, we need three inputs

Page 16: Binary Addition

The Full Adder

• Cascade two half-adders to get a full adder

A

B

Cin

Page 17: Binary Addition

HW: Cascade 2 Full Adders for a 2-Bit Adder

Full AdderFull Adder

B2 A2 B1 A1

S2 S1

Cout2 Cin2 = Cout1 Cin1

A2A1 1 1+ B2B1 + 1 0

Page 18: Binary Addition

Summary

• Binary addition– Concept of ‘sum’ and ‘carry’– Half adder and full adder circuits– Cascading circuits to make larger ones