Numeral Systems: CMPS 255 - Computer Architecture
Numeral Systems: CMPS 255 - Computer Architecture
Numeral Systems
CMPS 255 – Computer Architecture
Announcements
• Exam 2 rescheduled due to accommodate students
with time conflicts
• New date: Tue, Nov 12 @ 6:00-8:00pm
• Please inform us this week if you have any time conflicts
with the new date
• It consists of:
• A set of symbols each representing a value
• A set of rules for combining symbols to represent other
values
Roman Numeral System
Symbols
I one
MMCXLIV
V five
X ten
L fifty
C hundred
M+M+C–X+L–I+V
(two thousand one hundred forty four)
D five hundred
M one thousand
Arabic Numeral System
Symbols
0 zero
2735
1 one
2 two
3 three
4 four
2×103 + 7×102 + 3×101 + 5×100
5 five Ten is an important number here!
6 six • We have ten symbols whose values corresponding
7 seven to the first ten natural numbers
8 eight • Symbols are combined to represent other values
9 nine by multiplying the value of each symbol by ten to
the power of its position and adding them
Another name for this system is the decimal system
Positional Numeral Systems
• In general, a positional numeral system with a
base B is a numeral system where:
• B symbols are used whose values correspond to the first
B natural numbers
• Symbols are combined to represent other values by
multiplying the value of each symbol by B to the power
of its position and adding them
snsn-1…s1s0
Answer: 10111102
Other Numeral Systems
• Since binary can be verbose, computer scientists
sometimes use other systems in writing for brevity
• Octal: positional system with base 8
• Hexadecimal: positional system with base 16
• Examples:
• Convert 101101011100011002 to octal
010 110 101 110 001 100
2 6 5 6 1 4 Answer: 2656148
• Examples:
• Convert 101101011100011002 to hexadecimal
0001 0110 1011 1000 1100
1 6 B 8 C Answer: 16B8C8
19
+ 62
----
Addition
Decimal
carry 1
19
+ 62
----
81
Addition
Decimal Binary
carry 1
19 10011
+ 62 111110
---- -------
81
Addition
Decimal Binary
carry 1 11111
19 0010011
+ 62 0111110
---- -------
81 1010001
Subtraction
Decimal
5 1
- 2 2
-------
Subtraction
Decimal
borrow 4
5 11
- 2 2
-------
2 9
Subtraction
Decimal Binary
borrow 4
5 11 1 1 0 0 1 1
- 2 2 1 0 1 1 0
------- ----------------
2 9
Subtraction
Decimal Binary
borrow 4 0 101
5 11 1 1 0 10 1 1
- 2 2 1 0 1 1 0
------- ----------------
2 9 1 1 1 0 1
Multiplication
Decimal
23
× 13
----
Multiplication
Decimal
23
× 13
----
69
23
----
299
Multiplication
Decimal Binary
23 10111
× 13 1101
---- ------
69
23
----
299
Multiplication
Decimal Binary
23 10111
× 13 1101
---- ------
69 10111
23 00000
---- 10111
299 10111
---------
100101011