CS 230 – Introduction to Computers and Computer Systems Lecture 1 – Number Representation CS 230 - Spring 2020 1-1
Number Representation Radix representation radix also know as base Writing natural numbers using a finite alphabet Given an n-digit number in base r d n − 1 d n − 2 d n − 3 ... d 3 d 2 d 1 d 0 Integer value is CS 230 - Spring 2020 1-2
Radix Representation Humans: base-10, decimal why? Computers: base-2, binary why? electrical simplicity analog/digital conversion (high vs. low voltage) low-level decimal conversion? storage expansion / waste CS 230 - Spring 2020 1-3
Examples Decimal: 135 10 5x10 0 + 3x10 1 + 1x10 2 = 135 10 Binary: 10011 2 1x2 0 + 1x2 1 + 0x2 2 + 0x2 3 + 1x2 4 = 19 10 Hexadecimal: A32 16 2x16 0 + 3x16 1 + 10x16 2 = 2610 10 Septenary: 1440 7 0x7 0 + 4x7 1 + 4x7 2 + 1x7 3 = 567 10 Use letters starting with A to express digits > 9 CS 230 - Spring 2020 1-4
Conversion from Decimal Repeatedly divide by target base Remainders generate digits from right to left CS 230 - Spring 2020 1-5
CS 230 - Spring 2020 1-6
CS 230 - Spring 2020 1-7
CS 230 - Spring 2020 1-8
CS 230 - Spring 2020 1-9
CS 230 - Spring 2020 1-10
CS 230 - Spring 2020 1-11
CS 230 - Spring 2020 1-12
CS 230 - Spring 2020 1-13
CS 230 - Spring 2020 1-14
CS 230 - Spring 2020 1-15
CS 230 - Spring 2020 1-16
CS 230 - Spring 2020 1-17
CS 230 - Spring 2020 1-18
CS 230 - Spring 2020 1-19
CS 230 - Spring 2020 1-20
CS 230 - Spring 2020 1-21
CS 230 - Spring 2020 1-22
CS 230 - Spring 2020 1-23
CS 230 - Spring 2020 1-24
CS 230 - Spring 2020 1-25
CS 230 - Spring 2020 1-26
CS 230 - Spring 2020 1-27
CS 230 - Spring 2020 1-28
CS 230 - Spring 2020 1-29
CS 230 - Spring 2020 1-30
CS 230 - Spring 2020 1-31
CS 230 - Spring 2020 1-32
CS 230 - Spring 2020 1-33
CS 230 - Spring 2020 1-34
CS 230 - Spring 2020 1-35
CS 230 - Spring 2020 1-36
CS 230 - Spring 2020 1-37
CS 230 - Spring 2020 1-38
CS 230 - Spring 2020 1-39
CS 230 - Spring 2020 1-40
CS 230 - Spring 2020 1-41
CS 230 - Spring 2020 1-42
CS 230 - Spring 2020 1-43
CS 230 - Spring 2020 1-44
CS 230 - Spring 2020 1-45
CS 230 - Spring 2020 1-46
CS 230 - Spring 2020 1-47
CS 230 - Spring 2020 1-48
CS 230 - Spring 2020 1-49
CS 230 - Spring 2020 1-50
CS 230 - Spring 2020 1-51
CS 230 - Spring 2020 1-52
CS 230 - Spring 2020 1-53
CS 230 - Spring 2020 1-54
CS 230 - Spring 2020 1-55
CS 230 - Spring 2020 1-56
CS 230 - Spring 2020 1-57
CS 230 - Spring 2020 1-58
CS 230 - Spring 2020 1-59
CS 230 - Spring 2020 1-60
CS 230 - Spring 2020 1-61
CS 230 - Spring 2020 1-62
CS 230 - Spring 2020 1-63
CS 230 - Spring 2020 1-64
CS 230 - Spring 2020 1-65
CS 230 - Spring 2020 1-66
CS 230 - Spring 2020 1-67
CS 230 - Spring 2020 1-68
CS 230 - Spring 2020 1-69
CS 230 - Spring 2020 1-70
CS 230 - Spring 2020 1-71
CS 230 - Spring 2020 1-72
Recommend
More recommend