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

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

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

View Full Document Right Arrow Icon
ECE 301 – Digital Electronics Negative numbers, Addition of negative numbers, and Binary codes
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
Reading Spring 2012 ECE 301 - Digital 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Negative Numbers (continued) Spring 2012 ECE 301 - Digital 4
Background image of page 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
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.
Background image of page 7

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

View Full DocumentRight Arrow Icon
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 .
Background image of page 8
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
Background image of page 9

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

View Full DocumentRight Arrow Icon
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
Background image of page 10
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
Background image of page 11

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

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

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 Right Arrow Icon
Ask a homework question - tutors are online