Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality 1100110101100011 1100110101101011 1100 1010 = A B A = B Two bit strings.

Similar presentations


Presentation on theme: "Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality 1100110101100011 1100110101101011 1100 1010 = A B A = B Two bit strings."— Presentation transcript:

1 Computer Science 101 More Devices: Arithmetic

2 From 1-Bit Equality to N-Bit Equality 1100110101100011 1100110101101011 1100 1010 = A B A = B Two bit strings are equal iff the pair of bits at each position are equal

3 From 1-Bit Equality to N-Bit Equality = A0A0 B0B0 A 0 = B 0 = A1A1 B1B1 A 1 = B 1 = A2A2 B2B2 A 2 = B 2 = A3A3 B3B3 A 3 = B 3 Add a = circuit for each column of bits 1100 (A) 1100 (B) 3 2 1 0

4 From 1-Bit Equality to N-Bit Equality 1100 (A) 1100 (B) = A0A0 B0B0 A 0 = B 0 = A1A1 B1B1 A 1 = B 1 = A2A2 B2B2 A 2 = B 2 = A3A3 B3B3 A 3 = B 3 AND all the results 3 2 1 0

5 From 1-Bit Addition to N-Bit Addition 0 + 0 0 1 + 0 1 0 + 1 1 + 1 10 Rules: 1011 + 0011 1110 1 The rules require us to carry a 1 to the next column We also must carry a 1 from the previous column

6 From 1-Bit Addition to N-Bit Addition 0 + 0 0 1 + 0 1 0 + 1 1 + 1 10 1011 + 0011 1110 0 0 1 1 0 A one-bit adder will always add a column of three bits and always carry to the next column So, let’s carry a 0 or 1 from each previous column and to each next column We now have 8 rules! 1 00 + 0 1 + 0 10 0 + 1 1 0 1 + 1 11 1 0 1

7 A 1-Bit Adder 1011 + 0011 1110 + A B S Cin Cout Has three inputs: A, B, and Cin (Carry in) Has two outputs: S (Sum) and Cout (Carry out) 0 0 1 1 0 0 + 0 0 1 + 0 1 0 + 1 1 + 1 10 0 + 0 1 + 0 10 0 + 1 10 1 0 1 1 + 1 11 1

8 Truth Table for 1-Bit Adder 0 + 0 0 1 + 0 1 0 + 1 1 + 1 10 0 + 0 1 + 0 10 0 + 1 10 1 0 1 1 + 1 11 1 ABCinSCout 00000 00110 01010 01101 10010 10101 11001 11111 Now apply sum of products algorithm!

9 Boolean Expression for S ABCinSCout 00000 00110 01010 01101 10010 10101 11001 11111 + A B S Cin Cout _ ABCin _ _ ABCin _ ABCin _ _ _ ABCin + ABCin + ABCin + ABCin

10 Boolean Expression for Cout ABCinSCout 00000 00110 01010 01101 10010 10101 11001 11111 + A B S Cin Cout ABCin _ ABCin _ ABCin _ ABCin _ _ _ ABCin + ABCin + ABCin + ABCin _ _ _ ABCin + ABCin + ABCin + ABCin

11 Construct the Circuit B A + A B S Cin Cout Cin S Cout _ _ _ _ _ _ ABCin + ABCin + ABCin + ABCin _ _ _ ABCin + ABCin + ABCin + ABCin YIKES!!!!

12 From 1-Bit Addition to N-Bit Addition 1011 + 0011 1110 1 + A0A0 B0B0 S 0 0 Cout 0 + A1A1 B1B1 S 1 Cin 1 Cout 1 + A2A2 B2B2 S 2 Cin 2 Cout 2 + A3A3 B3B3 S 3 Cin 3 Cout 3 Carry out of adder N - 1 can indicate overflow Carry in of adder 0 is always 0


Download ppt "Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality 1100110101100011 1100110101101011 1100 1010 = A B A = B Two bit strings."

Similar presentations


Ads by Google