1 / 16

Computer programming {week 01}

Hudson Valley Community College CISS-110 – Programming & Logic I David Goldschmidt, Ph.D. Computer programming {week 01}. Computer subsystems. Hardware consists of five key subsystems:.

maalik
Download Presentation

Computer programming {week 01}

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hudson Valley Community College CISS-110 – Programming & Logic I David Goldschmidt, Ph.D. Computer programming{week 01}

  2. 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

  3. 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

  4. Example ADD instruction (i) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  5. Example ADD instruction (ii) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  6. Example ADD instruction (iii) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  7. Example ADD instruction (iv) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  8. Example ADD instruction (v) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  9. Example ADD instruction (vi) from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  10. Even faster! from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  11. 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?

  12. 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

  13. 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?

  14. ASCII • Representprintableand specialcharacters • What aboutUnicode? from Fluency with Information Technology, 4th edition by Lawrence Snyder, Addison-Wesley, 2010, ISBN 0-13-609182-2

  15. Java compilation and execution public static void main( String[] args ) { float x; System.out. println( " ... 7A 56 78 9F FE F2 65 58 99 76 6D 4E translation program (compiler) intermediate code (byte code) Java source code A6 65 54 98 8F AB AE 33 38 8F DA 44 virtual machine (JVM) program execution intermediate code of precompiled libraries (java.util.Scanner byte code)

  16. What next? • Read and study Chapter 1 • Get Textpad up and running • Do Project #1: • Given a 3-digit number: • Generate output that shows each digit: int num = 582; The number is 582 The hundreds column is 5 The tens column is 8 The ones column is 2

More Related