lec2 - 6 6 6 7 1 1 1 7 7 7 8 1-0-7-8 9 1 1-1-6-7 10 1...

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

View Full Document Right Arrow Icon
CSE20 Lecture 2: Number Systems: Binary Numbers, Gray Code, and Negative Numbers CK Cheng 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Number Systems 1. Introduction 2. Binary Numbers 3. Gray code 4. Negative Numbers 5. Residual Numbers 2
Background image of page 2
2. Binary Numbers b 2 b 1 b 0 Value 0 0 0 0 0 0 1 1 0 1 0 2 0 1 1 3 1 0 0 4 1 0 1 5 1 1 0 6 1 1 1 7 8 4 2 1 0 0 1 1 0 1 0 1 1 0 0 0 3 + 5 = 8 8 4 2 1 0 0 1 1 0 1 1 0 1 0 0 1 3 + 6 = 9 + + Examples : (3) (5) (8) (3) (6) (9) This is a non-redundant number system 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
2. Binary Cont. a b Carry Sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 id a b c Carry Sum 0 0 0 0 0 0 1 0 0 1 0 1 2 0 1 0 0 1 3 0 1 1 1 0 4 1 0 0 0 1 5 1 0 1 1 0 6 1 1 0 1 0 7 1 1 1 1 1 2*0 + 0 = 0 0 0 id 0 2*0 + 1 = 0 0 1 id 1 2*1 + 0 = 1 1 0 id 6 2*1 + 1 = 1 1 1 id 7 RULE: 2 x Carry + Sum = a + b + c 4
Background image of page 4
3. Gray Code reflection Low power (reliability) when the numbers are consecutive in series. The idea is to only change ONE bit at a time. e.g. addresses, analog signals NOTE: Not for arithmetic operations (the rule is too complicated) 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
4. Negative Numbers Given a positive integer x, represent the negative integer –x in (b n-1 , …, b 0 ) (i) Signed bit system b n-1 =1: negative, (b n-2 ,…,b 0 )=x. (ii) One's Complement Present 2 n - 1 - x in binary. (iii) Two's Complement Present 2 n – x in binary. Ignore bit b n . 6
Background image of page 6
4. Negative Numbers NOTE: Back to binary system id b 3 b 2 b 1 b 0 Signed One's Two's 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 1 2 0 0 1 0 2 2 2 3 0 0 1 1 3 3 3 4 0 1 0 0 4 4 4 5 0 1 0 1 5 5 5 6 0 1 1
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6 6 6 7 1 1 1 7 7 7 8 1-0-7-8 9 1 1-1-6-7 10 1 1-2-5-6 11 1 1 1-3-4-5 12 1 1-4-3-4 13 1 1 1-5-2-3 14 1 1 1-6-1-2 15 1 1 1 1-7-0-1 (i) Signed bit - x b3: negative (ii) One's Complement 2 n - 1 - x (iii) Two's Complement 2 n - x n is the number of bits (in this case n=4) One's Complement Two's Complement 8 = 16 - 1 - x 8 = 16 - x 9 = 16 - 1 x Use the above formulas to solve for x when number is negative Two's (b 4 ) b 3 b 2 b 1 b 7 1 1 1 1 6 1 1 1 5 1 1 1 4 1 1 3 1 1 1 2 1 1 1 1 1 1-1 1 1 1 1-2 1 1 1-3 1 1 1-4 1 1-5 1 1 1-6 1 1-7 1 1-8 1 Deriving Ones and Twos Reverse Derivation 7...
View Full Document

Page1 / 7

lec2 - 6 6 6 7 1 1 1 7 7 7 8 1-0-7-8 9 1 1-1-6-7 10 1...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online