Download presentation
Presentation is loading. Please wait.
Published byMyron Morgan Modified over 9 years ago
1
New Mexico Computer Science for All Author: Ed Angel Title: Bits and Bytes
2
Representing Numbers Base 10 integers ▫Whole numbers ▫Ex: 1234, 123, 12, 1 What is its value? Consider abc where each digit is {0,1,…9}
3
Fractional Numbers
4
Base N Numbers “Digits” = {0, 1, …, N -1} Value computes as with base 10 Consider abc.def again
5
Avoiding Ambiguity A number such as 101101 could be in base 2, base 10 or any other base Use subscript if there is any doubt 101101 2 =45 10 Note: when using binary K = 2 10 =1024 and M= 2 20 = 1024 2
6
Binary Arithmetic Same as familiar base 10 arithmetic Example: addition ▫Add bit by bit ▫0+0 =0 ▫1+0 = 0+1 =1 ▫1+1 = 10 101101 +011110 ______ 1001011 carry
7
Question Can you come up with an algorithm for adding two binary numbers? How can you do subtraction of two binary numbers? What about multiplication?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.