number representation, data types and elementary programming shirley moore cs 1401 february 5-7,...
TRANSCRIPT
Number Representation, Data Typesand Elementary Programming
Shirley MooreCS 1401
February 5-7, 2013
AgendaFeb 5• Final syllabus• Answers to questions about the course• Followup on multicore• Followup on logic gates/circuits• Finite data representation• Discover/invent how to represent negative integers• Assignments for next classFeb 7• Announcements (BlackBoard, Feb 12 Seminar, today’s lab, Exam 1)• Binary Homework• Overflow• Data types• Dr. Java interactive window• Assignments for next class• Quiz 2
Questions about the course from Qualtrics Survey
• Will this course help prepare me for future classes in Computer Science?
• Are we going to survey every detail of Java or are we going to have general knowledge of it?
• How in depth will the course get? By the end of the course, how proficient will I be at computer programming?
• Will we be exploring other programming languages or just Java?• Will there be a review for the test and what is the testing
format?• Can I get a work-study job in these courses helping Tas or the
professors?
Understanding Multicore
• http://blog.dhananjaynene.com/2008/11/multicore-for-project-managers-and-junior-developers/
Logic Gates and Circuits
• Six basic logic gates• Trace circuit operation
Data Representation
• What can you represent using n bits?• How can we represent negative integers?• How does the processor know how to
interpret a given bit pattern?
Assignments for Thursday
• Redo questions 7 and 8 on quiz 1 (if you didn’t already get full credit)
• Binary and circuits homework (come prepared to do problems on board)
• Read Chapter 2, sections 2.1-2.8.– Be sure you can answer check-up questions– Write down any questions you have
• Quiz 2 on Thursday– May include lecture/lab/reading material
Overflow
• Overflow examples• How can you detect when overflow occurs?– When doing addition by hand?– By adding a single gate to your adder/subtractor?
• Ariane 5 explosion– http://www.youtube.com/watch?v=kYUrqdUyEpI
Data Type
• The data type for a variable indicates – size of the data – how to interpret the bit pattern
• Basic data types in Java– byte (8-bit integer) – short (16-bit integer)– int (32-bit integer)– long (64-bit integer)– float (32-bit real)– double (64-bit real)– char (16-bit character)
Dr. Java
• Example of an Integrated Development Environment (IDE)– Enables editing, compiling, running, and
debugging a program from a Graphical User Interface (GUI)
• Dr. Java has an Interactive Window that acts as a Java interpreter.– Can develop and test program statements and
then copy and paste to editor window
Assignments for Tuesday Feb 12
• Reflective writing on Ariane 5 reading assignment• Read Section 2.9 – 2.15– Answer Checkpoint questions– Write down any questions you have– Try programming exercises 2.2, 2.4 on p. 75
• Read Lab 3 (posted by Friday) and try to write down an algorithm to solve the problem.
• Start preparing for Exam 1 which will be Feb 14