1 / 12

Computer Science 101

Computer Science 101. More Devices: Arithmetic. From 1-Bit Equality to N -Bit Equality. 1 0. A. =. A = B. B. 1100 1100. Two bit strings are equal iff the pair of bits at each position are equal. 1100110101100011 1100110101101011. From 1-Bit Equality to N -Bit Equality. A 0. =.

heidi
Download Presentation

Computer Science 101

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science 101 More Devices: Arithmetic

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

  3. From 1-Bit Equality to N-Bit Equality A0 = A0 = B0 B0 A1 = 3 2 1 0 A1 = B1 1100 (A) 1100 (B) B1 3 2 1 0 A2 = A2 = B2 B2 A3 = A3 = B3 B3 Add a = circuit for each column of bits

  4. From 1-Bit Equality to N-Bit Equality A0 = A0 = B0 B0 A1 = 3 2 1 0 A1 = B1 1100 (A) 1100 (B) B1 3 2 1 0 A2 = A2 = B2 B2 A3 = A3 = B3 B3 AND all the results

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

  6. From 1-Bit Addition to N-Bit Addition 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 0 + 0 0 1 + 0 1 0 + 1 1 1 + 1 10 0 + 0 1 1 + 0 10 0 + 1 1 0 1 + 1 11 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! 0 0 1 1 0 1011 + 0011 1110

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

  8. Truth Table for 1-Bit Adder 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 0 + 0 0 1 + 0 1 0 + 1 1 1 + 1 10 0 + 0 1 1 + 0 10 0 + 1 10 1 + 1 11 Now apply sum of products algorithm!

  9. Boolean Expression for S _ _ _ _ _ _ ABCin + ABCin + ABCin + ABCin Cin + S A Cout B _ _ ABCin _ _ ABCin _ _ ABCin ABCin

  10. Boolean Expression for Cout _ _ _ _ _ _ ABCin + ABCin + ABCin + ABCin Cin + S A _ _ _ ABCin + ABCin + ABCin + ABCin Cout B _ ABCin _ ABCin _ ABCin ABCin

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

  12. From 1-Bit Addition to N-Bit Addition 0 Carry in of adder0 is always 0 + S0 A0 Cout0 B0 Cin1 + S1 A1 Cout1 1 1 B1 1011 + 0011 1110 Cin2 + S2 A2 Cout2 B2 Cin3 + S3 Carry out of adderN - 1 can indicate overflow A3 Cout3 B3

More Related