Lecture #3 - Negative Numbers, Addition of negative numbers, Binary codes

# Lecture #3 - Negative Numbers, Addition of negative numbers, Binary codes

This preview shows pages 1–13. Sign up to view the full content.

ECE 301 – Digital Electronics Negative numbers, Addition of negative numbers, and Binary codes

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Learning Objectives Representation of negative numbers One’s complement Two’s complement Addition (and subtraction) of negative numbers Binary codes Weighted and unweighted codes ASCII Spring 2012 ECE 301 - Digital 2
Reading Spring 2012 ECE 301 - Digital 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Negative Numbers (continued) Spring 2012 ECE 301 - Digital 4
Spring 2012 ECE 301 - Digital 5 Signed Binary #s For an n-bit signed binary number n-1 bits are used to represent the magnitude. Can represent both positive and negative numbers. The leftmost bit indicates the sign of the number. There are three ways of representing signed binary numbers: Sign and Magnitude

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Spring 2012 ECE 301 - Digital 6 Sign and Magnitude For an n-bit Sign and Magnitude binary number The leftmost bit is the sign bit. The remaining n-1 bits represent the magnitude. b n 1 b 1 b 0 Magnitude Sign b n 2 0 denotes 1 denotes + MSB
Spring 2012 ECE 301 - Digital 7 Signed Binary #s Difficult to design arithmetic circuits for binary numbers using Sign and Magnitude representation. Consequently, this number system is not used in the design of most computer systems. Instead, the One's and Two's Complement number systems are more commonly used.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Spring 2012 ECE 301 - Digital 8 1's Complement A positive number, N, is represented in the same way as in the Sign and Magnitude representation. For an n-bit binary number, The sign bit (leftmost bit) = 0 The remaining n-1 bits represent the magnitude .
Spring 2012 ECE 301 - Digital 9 1's Complement A negative number, –N, is represented by the “1's Complement” of the positive number N. N' = 1's Complement representation of –N For an n-bit binary number, The sign bit (leftmost bit) = 1 for all negative numbers in the 1's Complement N' = (2n – 1) – N

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Spring 2012 ECE 301 - Digital 10 1's Complement: Example Using 8 bits, determine the 1's Complement representation for – 43. 28 – 1 = 255 = 11111111 43 = 00101011 11111111 00101011 11010100 1's Complement representation of - 43
Spring 2012 ECE 301 - Digital 11 1's Complement However, there is an easier way to determine the 1's Complement representation of –N. Take the bitwise complement of N. N' = 1's Complement representation of – N. For an n-bit binary number, N' = bitwise complement of N

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ECE 301 - Digital 12 1's Complement: Example Using 8 bits, determine the 1's Complement representation of – 58. 58 = 00111010
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 50

Lecture #3 - Negative Numbers, Addition of negative numbers, Binary codes

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online