Department of Management School of Business, Economics and Informatics Binary Numbers 2 Eva Szatmari
Learning Objectives Recap BIN Fractions in BIN Two’s complement notation Excess notation Floating point notation
Video Tutorials /mathstutorials y-5oxIlb6cG15wxnhRdAmdskil_3-7 Warning: floating point notation!
Recap BIN What are BIN nos? How do we convert BIN to DEC? How do we convert DEC to BIN?
Fractions in BIN Example 1: Example 2:
Fractions in BIN
Two’s Complement Notation Negative numbers in BIN? Two’s complement Sign bit, distinguishing between negative and positive numbers What is 0 represented as in two’s complement notation?
Two’s Complement Notation First fix the number of digits, e.g.: 4 bits Find the positive BIN equivalent Copy all digits from right to left till a 1 had been copied Complement (invert/flip) the rest of the digits
Two’s Complement Notation 4 bits two’s complement Example 1:Example 2: bits two’s complement Example 3:Example 4:
Two’s Complement Notation 5 bits two’s complement: a)– 8 b)– 13 c)10101 d)11010
Two’s Complement Notation 5 bits two’s complement: a)– 8 = b)– 13 = c)10101 = - 11 d)11010 = - 5
Excess Notation Another way of representing negative numbers in BIN What is 0 represented as in excess notation? What positive numbers look like? What negative numbers look like? How many digits do you use?
Excess Notation 4 bits excess: Example 1:Example 2: Example 3:Example 4: 42
Excess Notation 4 bits excess: a)- 6 b)- 1 c) 5 d) 7
Excess Notation 4 bits excess: a)- 6 = 0001 b)- 1 = 0111 c) 5 = 1101 d) 7 = 1111
Floating Point Notation s e1e2e3 m1m2m3m4 What does this sequence mean? What is s? What are e1e2e3? What are m1m2m3m4?
Floating Point Notation Normalization Example 1: Exponent:Mantissa: Example 2: Exponent:Mantissa:
Floating Point Notation Step1 : identify the sign bit (0 for +, 1 for – numbers) Step 2 : find the mantissa (move the radix point to 0.1… format, record the first 4 digits after the point) Step 3 : find the exponent in 3 bits excess notation Step 4 : record the number: s e1e2e3 m1m2m3m4
Floating Point Notation
Example 1:Example 2: Example 3: Example 4:
Floating Point Notation a) b)
Floating Point Notation
Any Questions?
Contact Details Eva Szatmari Or GOOD LUCK