Download presentation

Presentation is loading. Please wait.

Published byBrandon Greer Modified over 4 years ago

2
Introduction Were learnin bout numberrrrs! O_O >_< ^_^

3
Okay, so this is how you add… The general premise of addition is adding numbers and carrying when necessary. Carrying is the important part Like, so important that you could fail epically if you dont. Just wait.

4
Adding some more. Start on the right side as normal 1+1 = 2; since this cannot be expressed with one digit, we carry a 1 (just like normal addition) 1+0+0=1 0+1 = 1 1+1=2, carry again 1+0 = 1 1 0 0 1 1 1 0 1 + ----------- 11 11100

5
Subtracting… Its like James and me. I borrow from him all the time. The difference is that I give him some back, sometimes. And apparently this pays back as well.

6
Subtracting some more. Start on the right side as normal 0<1, so borrow 10 10-1=1 (in binary) Pay back 1 1+1=10, 1 < 10, so borrow 10 11-10 = 1 Pay back 1 1-1 = 0 1 1 0 0 1 - -------------- 101 (10) 1+ (10) 1 1+

7
Addition of Hex Values Hex is base 16, uses 0-9 and A-F. Same process as any other base: carry over when the current column capacity has been exceeded.

8
Hex Addition 5+D = 5+14 = 19 10 19 10 = 16+3 = (10 + 3) 16 This means we carry a 1 into the next column A+F+1= 10+15+1 = 26 10 26 10 = 16 + 10 = (10 + A) This means we carry a 1 A5 +FD ---------------------- 1 1A3

9
Integer Representation A byte has 8 bits, which allows for 256 variations (different numbers) [2 8 ] If we want positive and negative though, we use the Most Significant Bit (MSB) to determine sign (1 = negative, 0 = positive) This lets us go from -127 to 127 Notice a number is lost in the range (+/- 0), meaning only 255 distinct numbers possible

10
Questions!? What range of numbers can be gotten from 6 bits?(unsigned) What is 100000 unsigned? Signed? 011111 unsigned? Signed?

11
Representing Negative Numbers Using Two complement Another method involves setting the MSB to be -128 and making the rest positive to get a range of negative numbers. 10000000 base 2 = -128 10000001 base 2 = -127 Etc. To go from positive to negative, just flip the bits and add 1 base 2: 8 base 10 = 00001000 -8 base 10 = 11110111+1 = 11111000 base 2

12
Practice Convert to Twos Complement: -10001000 -1010

13
Representing Real Numbers Two ways of representing: – Fixed point or floating point – Fractional and Whole parts separated by a Radix point. With fixed point between bits 3 and 4, making bits 3, 2, and 1 negative, max range is from -15.875 to 15.875 Everything after the decimal place gains a negative exponent 0.1 base 2 = 2 -1, 0.001 base 2 = 2 -3

14
(cont.) This can be created with twos complement, which places the fixed point between 4 and 5. Fixed point just doesnt have a lot of range with a given set of bits.

15
Floating Point Representation Until recently, floating point has been a pain. IEEE 734 created a standard for them. However, its hard and junk apparently, so they wont tell us about it. BUT. They explicitly reference wikipedia. Such a terrible source. The mantissa is basically the decimalised version of the number.

16
Floating Point Algorithmic example Convert 12.5 to normalised binary format. 1.Convert 12.5 to binary: 1100.1 2.Move the point four to the left: 0.11001 (mantissa) 3.That four becomes the exponent, write it in binary: 0100 4.Write the number as mantissa * 2 exponent 5.0.11001 * 2 0100

17
Advantages of Integer and Floating Point Integers can be stored accurately Floating point allows more numbers to be represented Floating points allows fractional values (kinda ties in with the above)

18
Truncation, Underflow, and Overflow Errors Truncation cuts off anything after the radix point. Happens when you try to put a decimal/real number in an integer slot. Overflow basically is trying to put a number that is too big into a slot… like when you enter 2309472349072309472097429579347530453 into something. This can also occur when the mantissa of floating point or exponent are to large to be represented in the number of bits. Underflow is when a number to be stored is too small. The underflow case for floating point can be the same as the overflow case if the exponent is too large to be represented in both cases.

Similar presentations

OK

1 5 th Grade Multiply 3 or more digits by 2 Multiplication.

1 5 th Grade Multiply 3 or more digits by 2 Multiplication.

© 2018 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on atrial septal defect Download ppt on conic sections for class 11 Ppt on us health insurance Ppt on quality education academy Ppt on water scarcity in california Ppt on conservation of wildlife and natural vegetation in italy Ppt on impact of unemployment in india View my ppt online maker Ppt on next generation 2-stroke engine upgrade Ppt on human nutrition and digestion of cnidarians