0% found this document useful (0 votes)
9 views24 pages

Computer Number Systems

This document provides an overview of number systems, focusing on the decimal, binary, octal, and hexadecimal systems, and their relationships. It discusses the importance of binary in computer design, arithmetic operations, and the representation of numbers in different bases. Additionally, it covers methods for converting between these number systems and includes examples of positional notation and conversions.

Uploaded by

53267
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views24 pages

Computer Number Systems

This document provides an overview of number systems, focusing on the decimal, binary, octal, and hexadecimal systems, and their relationships. It discusses the importance of binary in computer design, arithmetic operations, and the representation of numbers in different bases. Additionally, it covers methods for converting between these number systems and includes examples of positional notation and conversions.

Uploaded by

53267
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

MOD002580 | Computer

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”

• 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 (short for 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: 1010 = A16; 1110 = B16
The ENIAC
Why Binary?
•Early computer design was
decimal
•ENIAC
•John von Neumann
On Off
proposed binary data
True False
processing (1945)
Yes No
•Simplified computer 1 0
design
•Used for both instructions
and data
•Natural relationship
between on/off switches
and calculations using
Keeping Track of the Bits

•Bits commonly stored and


manipulated in groups
•8 bits = 1 byte
•4 bytes = 1 word (in many systems)
Numbers: Physical
Representation

How many oranges in the below


image?
a) 5
b) 101
c) 12
d) All of the above
Positional Notation: Base 10

52710 = 5 x 102 + 2 x 101 + 7 x 100


100’s place 10’s place 1’s place

Place 102 101 100

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

•Example #1: Base 10, 2 digits


• R = 102 = 100 different numbers (0…99)

•Example #2: Base 2, 16 digits


• R = 216 = 65,536 or 64K
• 16-bit number can represent 65,536 different
number values
Decimal Range of Bit Width

Bits Digits Range


2 (0 and 1)
1 0+
16 (0 to 15)
4 1+
256
8 2+
1,024 (1K)
10 3
65,536 (64K)
16 4+
1,048,576 (1M)
20 6
4,294,967,296
32 9+ (4G)
Different Number Bases
•Base:
• The number of different symbols required to
represent any given number
•The larger the base, the more symbols
are required

• 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

64’s place 8’s place 1’s place

Place 82 81 80

Value 64 8 1

Evaluate 6 x 64 2x8 4x1


Sum for
384 16 4
Base 10
Positional Notation: Hexadecimal

6,70416 = 26,37210
4,096’s place 256’s place 16’s place 1’s place

Place 163 162 161 160

Value 4,096 256 16 1

Evaluate 6 x 4,096 7 x 256 0 x 16 4x1

Sum for
24,576 1,792 0 4
Base 10
Positional Notation: Binary

1101 01102 = 21410

Place 27 26 25 24 23 22 21 20

Value 128 64 32 16 8 4 2 1

Evaluate 1 x 128 1 x 64 0 x 32 1 x16 0x8 1x4 1x2 0x1

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

•The nibble approach

Base 16 1 F 6 7

Base 2 0001 1111 0110 0111


This works both ways
•If we want to convert binary to
hexadecimal, we group the bits in fours
(24 is 16)
1101011110012 = D7916

Base 2 1101 0111 1001

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

You might also like