# ece 331 – digital system design representation of negative numbers, binary arithmetic of...

Click here to load reader

Post on 19-Dec-2015

218 views

Embed Size (px)

TRANSCRIPT

- Slide 1
- ECE 331 Digital System Design Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6 th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.
- Slide 2
- Spring 2011ECE 331 - Digital System Design2 Representation of Negative Numbers (continued)
- Slide 3
- Spring 2011ECE 331 - Digital System Design3 Signed Binary Numbers Representations for signed binary numbers: 1. Sign and Magnitude 2. 1's Complement 3. 2's Complement
- Slide 4
- Spring 2011ECE 331 - Digital System Design4 Signed Binary Numbers Arithmetic circuits are difficult to design for Sign and Magnitude binary numbers. Consequently, this number system is not typically used in digital (computer) systems. Instead other number systems, namely the 1's and 2's Complements, are more commonly used. As we will see, it is rather easy to design arithmetic circuits for binary numbers represented in these number systems.
- Slide 5
- Spring 2011ECE 331 - Digital System Design5 1's Complement A positive number, N, is represented in the same way as in the Sign and Magnitude representation. For an n-bit number, The leftmost bit (sign bit) = 0. Indicating a positive number. The remaining n-1 bits represent the magnitude.
- Slide 6
- Spring 2011ECE 331 - Digital System Design6 1's Complement A negative number, -N, is represented by the 1's complement of the positive number, N. N' = 1's complement representation for -N. For an n-bit signed binary number, The leftmost bit (sign bit) = 1 for all negative numbers in the 1's Complement system. N' = (2 n 1) N
- Slide 7
- Spring 2011ECE 331 - Digital System Design7 1's Complement: Examples Using 8 bits, determine the 1's Complement representation for the following negative numbers: -15 -102
- Slide 8
- Spring 2011ECE 331 - Digital System Design8 1's Complement The 1's Complement representation for -N can also be determined by taking the bit-wise complement of N. N' = 1's Complement representation for -N. For an n-bit signed binary number, i.e. complement N, bit-by-bit N' = bit-wise complement of N
- Slide 9
- Spring 2011ECE 331 - Digital System Design9 1's Complement: Examples Using 8 bits, determine the 1's Complement representation for the following negative numbers: -15 -102 (Use the bit-wise complement)
- Slide 10
- Spring 2011ECE 331 - Digital System Design10 1's Complement For an n-bit 1's Complement binary number, Includes a representation for +0 and -0. Represents an equal number of positive and negative values. - (2 n-1 1)