Department of Management School of Business, Economics and Informatics Binary Numbers 2 Eva Szatmari...
-
Upload
annice-price -
Category
Documents
-
view
214 -
download
0
Transcript of Department of Management School of Business, Economics and Informatics Binary Numbers 2 Eva Szatmari...
Department of ManagementSchool of Business, Economics and Informatics
Binary Numbers 2Eva Szatmari
Learning Objectives
• Recap BIN• Fractions in BIN• Two’s complement notation• Excess notation• Floating point notation
Video Tutorials
http://bbk.libguides.com/computerscience/mathstutorials
http://www.bbk.ac.uk/mathstutorials/
https://www.youtube.com/playlist?list=PL2Fy-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:11.101
Example 2: 1010.1101
Fractions in BIN
Example 1:5 ¼
Example 2:7 ¾
Example 3:2
Fractions in BIN
a) 101.0011b) 1100.101
c) 7 d) 12
Fractions in BIN
a) 101.0011 = 5 b) 1100.101 = 12
c) 7 = 111.0111d) 12 = 1100.11
Two’s Complement Notation
Negative numbers in BIN?Two’s complementSign bit, distinguishing between negative and positive numbersWhat is 0 represented as in two’s complement notation?
Two’s Complement Notation
First fix the number of digits, e.g.: 4 bitsFind the positive BIN equivalentCopy all digits from right to left till a 1 had been copiedComplement (invert/flip) the rest of the digits
Two’s Complement Notation
4 bits two’s complementExample 1: Example 2:-2 -4
6 bits two’s complementExample 3: Example 4:100100 011001
Two’s Complement Notation
5 bits two’s complement:a) – 8 b) – 13
c) 10101d) 11010
Two’s Complement Notation
5 bits two’s complement:a) – 8 = 11000b) – 13 = 10011
c) 10101 = - 11 d) 11010 = - 5
Excess Notation
Another way of representing negative numbers in BINWhat 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:- 7 - 5
Example 3: Example 4:4 2
Excess Notation
4 bits excess:a) - 6b) - 1c) 5d) 7
Excess Notation
4 bits excess:a) - 6 = 0001b) - 1 = 0111c) 5 = 1101d) 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
NormalizationExample 1:0.0011001Exponent: Mantissa:Example 2:101.10010Exponent: 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 notationStep 4: record the number:s e1e2e3 m1m2m3m4
Floating Point Notation
Example 1: Example 2:
Example 3: Example 4:
Floating Point Notation
a)
Floating Point Notation
a) = 11011111b) = 11111011
Floating Point Notation
Example 1: Example 2:01011001 10101101
Example 3: Example 4:10101100 11011100
Floating Point Notation
a) 10111011b) 10011100
Floating Point Notation
a) 10111011 = b) 10011100 =
Any Questions?