150 likes | 219 Views
The College of Saint Rose CSC 202 – Introduction to Programming David Goldschmidt, Ph.D. Hardware and numbers {week 01}. Computer subsystems. Hardware consists of five key subsystems:.
E N D
The College of Saint Rose CSC 202 – Introduction to Programming David Goldschmidt, Ph.D. Hardware and numbers{week 01}
Computer subsystems • Hardware consists of five key subsystems: from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Fetch/Execute cycle • Each instruction goes through this cycle: from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (i) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (ii) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (iii) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (iv) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (v) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Example ADD instruction (vi) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Even faster! from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2
Counting • We use ten symbols to count • Digits: 0 1 2 3 4 5 6 7 8 9 • Computers use two symbols to count • Digits: 0 1 (why?) • What is the exact mechanism for counting? • How do we count from 1 to 20?
Convert binary to decimal • The powers of 2 give us the decimal weights • Convert 10011001 from binary to decimal: • 10011001 in decimal is 128 + 16 + 8 + 1 = 153 • What about negative numbers?
Two’s complement representation • Use two’s complement representation for negative numbers • Convert 10011001 from binary to decimal: • 10011001 in decimal is -128 + 16 + 8 + 1 = -103
Hexadecimal • Hexadecimal is base 16 • It uses 16 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F • Why use hex? • Binary numbers are too long • What’s 2BAD in decimal?
ASCII • Representprintableand specialcharacters • What aboutUnicode? from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2