2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Numbering System • What is a numbering system ? – A method to count; know quantity • Many ways to represent numbers – For humans we use decimal numbering system • 0, 1, 2, ….9, pattern keeps repeating, till infinity • Why 10 digits? Not sure….. Take a guess – Computers use binary numbering system Computers only understand zeros and ones • Computers are made of electronic circuit which has current flowing through it. Voltage makes the current flow • Only two levels of voltage (there are always exceptions) Zero volt = ZERO = ground = OFF +5 volt (or 3.5V) = ONE = ON
Introduction to Numbering System. What is a numbering system ? A method to count; know quantity Many ways to represent numbers For humans we use decimal numbering system 0, 1, 2, ….9, pattern keeps repeating, till infinity Why 10 digits? Not sure….. Take a guess - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 1
Introduction to Numbering System
• What is a numbering system ?– A method to count; know quantity
• Many ways to represent numbers– For humans we use decimal numbering system
• 0, 1, 2, ….9, pattern keeps repeating, till infinity• Why 10 digits? Not sure….. Take a guess
– Computers use binary numbering systemComputers only understand zeros and ones• Computers are made of electronic circuit which has
current flowing through it. Voltage makes the current flow• Only two levels of voltage (there are always exceptions)
Zero volt = ZERO = ground = OFF+5 volt (or 3.5V) = ONE = ON
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 2
Why?
• Why do we have numbering systems?– So we can count
• Why so many numbering systems?– Computers can only understand zeros and ones
– Decimal numbering systems started long before the dawn of computes and is easy for humans to use
– Not easy to use zeros and ones for daily use, takes to may bits to represent a small amount
• Example • 65536 in decimal takes five digits• 65536 in binary takes 16 bits
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 3
Introduction to Numbering System
• Decimal
• Hexadecimal
• Octal
• Binary
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 4
DecimalMost commonly used numbering system
Base 10, there are ten unique units (digits)
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Pattern starts at 0 and ends with base – 1 then keeps repeating, tens, hundreds, thousands,…
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 12
Conversion – bin to hex, octal
Binary Number = Octal = Hexadecimal100011010001 4321 8D1
• To convert a binary number to Octal, split binary number into pairs of three (need three binary digits to represent an octal)100 011 010 001 4 3 2 1 (bin 001 = octal 1, bin 100 = octal 4)
• To convert a binary number to hex, split binary number into pairs of four (need four binary digits to represent a hex num) 1000 1101 0001 8 D 1 (binary 1000 = hex 8 binary 1101 = decimal 13 = hex D)
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 13
Conversion – hex, octal to bin
• Hexadecimal to Binary8D1
8 D 1
1000 1101 0001 = 100011010001
• Octal to Binary 4321
4 3 2 1
100 011 010 001 = 100011010001
2001 NHTI CP 107 M. Saleem Yusuf. 2000 Prentice Hall, Inc. All rights reserved. 14