Computer Number Systems
Computer Number Systems
Systems
Computer Number
Systems
Dr Stiphen Chowdhury
School of Computing & Information Science,
Cambridge
Learning Objectives
In this lesson, you will
• look informally at number systems in
general.
• explore the relationship between decimal
number system and number systems of
other bases.
• learn how the binary number system is used
within the computer.
Counting and Arithmetic
• Decimal or base 10 number system
• Origin: counting on the fingers
• “Digit” from the Latin word digitus meaning “finger”
• Binary or base 2
• Bit (short for binary digit): 2 digits, 0 and 1
Value 100 10 1
Evaluate 5 x 100 2 x 10 7 x1
Sum 500 20 7
Range of Possible Numbers
• R = BK
• R = range
• B = base
• K = number of digits
• Base 2: 0,1
• Base 8: 0,1,2,3,4,5,6,7
• Base 10: 0,1,2,3,4,5,6,7,8,9
• Base 16: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
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:
•6516 10110 1458 110 01012
•Example #2:
•11C16 28410 4348 1 0001 11002
Numeric Conversion Between
Number Bases
Positional Notation: Octal
6248 = 40410
Place 82 81 80
Value 64 8 1
6,70416 = 26,37210
4,096’s place 256’s place 16’s place 1’s place
Sum for
24,576 1,792 0 4
Base 10
Positional Notation: Binary
Place 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
Sum for
128 64 0 16 0 4 2 0
Base 10
Conversion From Base 10 to Base
2
Base 10 42 Remaind
er
2 ) 42 ( 0
Quotient
2 ) 21 ( 1
2 ) 10 ( 0
2) 5 (1
2) 2 (0
2) 1
Base 2 101010
Conversion From Base 10 to Base
8
Base 10 446
8 ) 446 ( 6
8) 55 ( 7
8) 6
Base 8 676
Conversion From Base 10 to Base
16
Base 10 8,039
16 ) 8,039 ( 7
16 ) 502 ( 6
16 ) 31 ( 15
16 ) 1 (1
16 ) 0
Base 16 1F67
Conversion From Hexadecimal to
Binary and vice versa
• Why hexadecimal?
• Hex easier to read and write than binary
• Modern computer operating systems and
networks present variety of troubleshooting data
in hex format
Base 16 1 F 6 7
Base 16 13 7 9
D 7 9
Convert your name into a binary
representation
Jane Doe
01001010 01100001 01101110
01100101 00100000 01000100
01101111 01100101
ASCII Table
Next week: Logic gates