Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Number System

5,098
views

Published on

number system

number system

Published in: Technology

1 Comment
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Views
Total Views
5,098
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
269
1
Likes
1
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. Number Systems (Class XI)‏ Nita Arora (KHMS)‏ PGT Comp. Sc.
• 2. Why Binary?
• Early computer design was decimal
• Mark I and ENIAC
• John von Neumann proposed binary data processing (1945)‏
• Simplified computer design
• Used for both instructions and data
• Natural relationship between on/off switches and calculation using Boolean logic
0 1 No Yes False True Off On
• 3. Counting and Arithmetic
• Decimal or base 10 number system
• Origin: counting on the fingers
• “ Digit” from the Latin word digitus meaning “finger”
• Base : the number of different digits including zero in the number system
• Example: Base 10 has 10 digits, 0 through 9
• Binary or base 2
• Bit (binary digit): 2 digits, 0 and 1
• Octal or base 8: 8 digits, 0 through 7
• Hexadecimal or base 16: 16 digits, 0 through F
• Examples: 10 1 0 = A 16 ; 11 10 = B 16
• 4. Keeping Track of the Bits
• Bits commonly stored and manipulated in groups
• 8 bits = 1 byte
• 4 bytes = 1 word (in many systems)‏
• Number of bits used in calculations
• Affects accuracy of results
• Limits size of numbers manipulated by the computer
• 5. Numbers: Physical Representation
• Different numerals, same number of oranges
• Cave dweller: IIIII
• Roman: V
• Arabic: 5
• Different bases, same number of oranges
• 5 10
• 101 2
• 12 3
• 6. Number System
• Roman: position independent
• Modern: based on positional notation (place value)‏
• Decimal system: system of positional notation based on powers of 10.
• Binary system: system of positional notation based powers of 2
• Octal system: system of positional notation based on powers of 8
• Hexadecimal system: system of positional notation based powers of 16
• 7. Positional Notation: Base 10 43 = 4 x 10 1 + 3 x 10 0 Sum Evaluate Value Place 3 40 3 x1 4 x 10 1 10 10 0 10 1 1’s place 10’s place
• 8. Positional Notation: Base 10 527 = 5 x 10 2 + 2 x 10 1 + 7 x 10 0 500 5 x 100 100 10 2 Sum Evaluate Value Place 7 20 7 x1 2 x 10 1 10 10 0 10 1 1’s place 10’s place 100’s place
• 9. Positional Notation: Octal
• 624 8 = 404 10
Sum for Base 10 Evaluate Value Place 4 x 1 2 x 8 6 x 64 4 16 384 8 0 8 1 8 2 1 8 64 64’s place 8’s place 1’s place
• 6,704 16 = 26,372 10
4 x 1 0 x 16 7 x 256 6 x 4,096 Evaluate 4 0 1,792 24,576 Sum for Base 10 16 0 16 1 16 2 16 3 Place 1 16 256 4,096 Value 4,096’s place 256’s place 1’s place 16’s place
• 11. Positional Notation: Binary 1101 0110 2 = 214 10 Sum for Base 10 Evaluate Value Place 0 x 1 1 x 2 1 x 4 0 x 8 1 x16 0 x 32 1 x 64 1 x 128 0 2 4 0 16 0 64 128 1 2 4 8 16 32 64 128 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7
• 12. Estimating Magnitude: Binary 1101 011 02 = 214 10 1101 011 02 > 192 10 (128 + 64 + additional bits to the right)‏ Sum for Base 10 Evaluate Value Place 0 x 1 1 x 2 1 x 4 0 x 8 1 x16 0 x 32 1 x 64 1 x 128 0 2 4 0 16 0 64 128 1 2 4 8 16 32 64 128 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7
• 13. Range of Possible Numbers
• R = B K where
• R = range
• B = base
• K = number of digits
• Example #1: Base 10, 2 digits
• R = 10 2 = 100 different numbers (0…99)‏
• Example #2: Base 2, 16 digits
• R = 2 16 = 65,536 or 64K
• 16-bit PC can store 65,536 different number values
• 14. Decimal Range for Bit Widths 38+ 19+ 9+ 6 4+ 3 2+ 1+ 0+ Digits Approx. 2.6 x 10 38 128 Approx. 1.6 x 10 19 64 4,294,967,296 (4G)‏ 32 1,048,576 (1M)‏ 20 65,536 (64K)‏ 16 1,024 (1K)‏ 10 256 8 16 (0 to 15)‏ 4 2 (0 and 1)‏ 1 Range Bits
• Base:
• The number of different symbols required to represent any given number
• The larger the base, the more numerals are required
• Base 10 : 0,1, 2,3,4,5,6,7,8,9
• Base 2 : 0,1
• Base 8 : 0,1,2, 3,4,5,6,7
• Base 16 : 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
• 16. Number of Symbols vs. Number of Digits
• For a given number, the larger the base
• the more symbols required
• but the fewer digits needed
• Example #1:
• 65 16 101 10 145 8 110 0101 2
• Example #2:
• 11C 16 284 10 434 8 1 0001 1100 2
• 17. Counting in Base 2 Decimal Number Equivalent Binary Number 10 1 x 2 1 1 x 2 3 1010 9 1 x 2 0 1 x 2 3 1001 8 1 x 2 3 1000 7 1 x 2 0 1 x 2 1 1 x 2 2 111 6 1 x 2 1 1 x 2 2 110 5 1 x 2 0 1 x 2 2 101 4 1 x 2 2 100 3 1 x 2 0 1 x 2 1 11 2 0 x 2 0 1 x 2 1 10 1 1 x 2 0 1 0 0 x 2 0 0 1’s (2 0 )‏ 2’s (2 1 )‏ 4’s (2 2 )‏ 8’s (2 3 )‏
• 18. Addition Largest Single Digit Problem Base 1 +0 6 +9 6 +1 6 +3 1 Binary F Hexadecimal 7 Octal 9 Decimal
• 19. Addition Answer Carry Problem Base Carry the 2 Carry the 16 Carry the 8 Carry the 10 10 1 +1 Binary 10 6 +A Hexadecimal 10 6 +2 Octal 10 6 +4 Decimal
• 20. Binary Arithmetic 1 1 0 0 0 0 0 1 0 1 1 0 1 + 1 0 1 1 0 1 1 1 1 1 1 1
• 21. Converting from Base 10
• Powers Table
256 64 4 2 1 16 4,096 65,536 16 1 8 512 4,096 32,768 8 1 2 8 16 32 64 128 256 2 0 1 3 4 5 6 7 8 Power Base
• 22. From Base 10 to Base 2 10 0 1 0 64 6 42/32= 1 Integer Remainder 1 0 1 0 1 2 4 8 16 32 2 1 2 3 4 5 Power Base 42 10 = 101010 2 10/16 = 0 10 10/8 = 1 2 2/4 = 0 2 2/2 = 1 0 0/1 = 0 0
• 23. From Base 10 to Base 2 Most significant bit 1 2 )‏ ( 0 2 2 )‏ 42 Base 10 101010 Base 2 ( 1 5 2 )‏ ( 0 10 2 )‏ ( 1 21 2 )‏ ( 0 Least significant bit 42 2 )‏ Remainder Quotient
• 24. From Base 10 to Base 16 5,735 10 = 1667 16 103 – 96 = 7 1,639 –1,536 = 103 5,735 - 4,096 = 1,639 Remainder 7 103 /16 = 6 1,639 / 256 = 6 5,735 /4,096 = 1 Integer 7 6 6 1 1 16 256 4,096 65,536 16 0 1 2 3 4 Power Base
• 25. From Base 10 to Base 16 5,735 Base 10 1667 Base 16 0 16 )‏ ( 1 Most significant bit 1 16 )‏ ( 6 22 16 )‏ ( 6 358 16 )‏ ( 7 Least significant bit 5,735 16 )‏ Quotient Remainder
• 26. From Base 10 to Base 16 8,039 Base 10 1F67 Base 16 0 16 )‏ ( 1 Most significant bit 1 16 )‏ ( 15 31 16 )‏ ( 6 502 16 )‏ ( 7 Least significant bit 8,039 16 )‏ Quotient Remainder
• 27. From Base 8 to Base 10 3,584 x 7 512 8 3 = 3,763 10 3 48 128 Sum for Base 10 x 3 x 6 x 2 1 8 64 8 0 8 1 8 2 Power 7263 8
• 28. From Base 8 to Base 10 = 3,763 10 7263 8 + 3 = + 6 = + 2 = 3,763 3760 464 58 x 8 470 x 8 56 7 x 8
• 29. From Base 16 to Base 2
• The nibble approach
• Hex easier to read and write than binary
• Modern computer operating systems and networks present variety of troubleshooting data in hex format
0111 0110 1111 0001 Base 2 7 6 F 1 Base 16
• 30. Fractions
• Number point or radix point
• Decimal point in base 10
• Binary point in base 2
• No exact relationship between fractional numbers in different number bases
• Exact conversion may be impossible
• 31. Decimal Fractions
• Move the number point one place to the right
• Effect: multiplies the number by the base number
• Example: 139.0 10 1390 10
• Move the number point one place to the left
• Effect: divides the number by the base number
• Example: 139.0 10 13.9 10
• 32. Fractions: Base 10 and Base 2 .101011 2 = 0.671875 10 .2589 10 .008 8 x 1/1000 1/1000 10 -3 .2 2 x 1/10 1/10 10 -1 Sum Evaluate Value Place .0009 .05 9 x1/1000 5 x 1/100 1/10000 1/100 10 -4 10 -2 0 x 1/16 1/16 2 -4 0.03125 1 x 1/32 1/32 2 -5 0.015625 0.125 .5 Sum 1 x 1/64 1x 1/8 0 x 1/4 1 x 1/2 Evaluate 1/64 1/8 1/4 1/2 Value 2 -6 2 -3 2 -2 2 -1 Place
• 33. Mixed Number Conversion
• Integer and fraction parts must be converted separately
• Radix point: fixed reference for the conversion
• Digit to the left is a unit digit in every base
• B 0 is always 1 regardless of the base