Introduction to Programming Instructor: Yong-nian Tang Brookhaven National Laboratory Working on accelerator control 631-344-7022 (BNL Phone #) email@example.com firstname.lastname@example.org
Text Book: Introduction to Java Programming by Daniel Liang How expensive is it? Introductionto Programming 2
Do we need to buy the text book? It is recommended because we’ll do many excises in the book. Having the book will make your life much easier. However, you can survive (barely?) without the book. Introduction to Programming 3
Supply: USB drives to save files and transfer data. Very cheap when they are on sale. About $0.50 to $1 per GB, or even less. Every one should have one or two. Introduction to Programming 4
Course Web Pages: www2.sunysuffolk.edu/tangy/cst112 Outline Announcements Slides Projects Data files for projects and exercises Answers to some exercises Attendance and project status Introduction to Computing 5
Objective Introduction to computer concepts, Windows XP, network security and protection. Basic concepts and usage of Office 2010, Word, Excel, Access, and PowerPoint. In addition to the contents of the text book, some advanced topics will be introduced. Introduction to Computing 6
Attendance Policy Attending classes is very important Firm but flexible policy If you can not attend a class, call 344-7022 or email email@example.com Attendance Grades: 10% goes to the final grade. Introduction to Programming 7
Fail or Withdrawal One should go to registrar to formally withdraw from the class if quitting attending the class after some date. For example, one quits the class after the midterm exam. If you forget to formally withdraw, I usually assign W as your final grade if the College permits. However, if you need to get an F in order to get financial aid, please send me an email. If the College does not allow professors to assign W, I will assign F for lack of choices. Introduction to Programming 8
Grading Policy Specified in the outline In general, if one attends the classes, finishes lab work, exams and projects, one gets a relatively good grade. Do not worry about grades, to learn something is more important. Introduction to Programming 9
Topics The language we use is Java However, we use a language called “processing” in the first several classes. Processing is based on java but on a higher level. We’ll use processing to draw colored balls (or other objects) and move them on the screen. Introduction to Programming 10
Topics In the remaining classes we use Java!!! Our goal is to be able to write medium size programs at the end of the class. I enjoy to answer questions from you and discuss them with you. Please be actively involved in the class activities. Introduction to Programming 11
Defining Computers • A computer is an electronic device • accepts input • processes and stores data • produces output
Types of Computers • Personal computers • Desktop • Notebook (Laptop) • Tablet PC • Hand-helds:PDAs, MP3 players, Cell phones • Mainframes • Supercomputers • Other computers (at home, in car…)
Types of Computers • Personalcomputersare used for general computing tasks. • Hand-heldcomputersfit in the palm of your hand and run on batteries. • Mainframes are used by companies to provide centralized storage, processing, and management for large amounts of data. • Supercomputers are the largest and fastest of computers, and can process an enormous volume of data.
Types of Computers • Desktop: (HP, Dell, IBM…) • Usually more powerful and cheaper than laptops • Needs separate monitor, not easy to move around • Could be replaced by laptops and tablets in the near future?
Types of Computers • Notebook, Netbook & iPad • Small & lightweight. • Portable • Netbook: browsing • Internet • Tablets (7” and 10”)
Types of Computers • Supercomputers are the largest and fastest computers. BNL Bluegene • Mainframe s are very powerful computers, but not as powerful as supercomputers. • Clusters: consists of hundreds and more processors.
Computer Systems A computer system is made up of: • Hardware — the physical components. Can be touched. If kicking it, your toe will get hurt. • Software — the programs or lists of instructions. Can not be touched. • Software could be more expensive than hardware. Why do most people KEEP using Windows system?
Can we reduce the weight of a computer by deleting its software (files). No!!! Software has no weight.
Hardware: major components • Motherboard • CPU (Central Processing Unit) • Memory • Storage devices • I/O (Input/Output) devices • Network devices • Power supply, case, video card, sound card…
Hardware: Motherboard • Also called mainboard • Located inside the computer case • Holds and connects all essential components
Hardware: CPU • CPU - micro processor • A silicon chip designed to manipulate data • The brain of a computer. • 64-bit CPUs and 32-bit CPUs
Hardware: CPU (cont.) • Intel, AMD, Apple, IBM… make CPUs. • Its speed is determined by: • Clock speed (Hz) • Word size (32-bit and 64-bit) • Processor type • Usually, motherboard and CPU are the most expensive components in a computer. High-end video cards are not cheap either.
Question 1. What are the two most expensive components in a computer?
Hardware: Units of Memory and Storage • Computer understands 0 and 1 only: on/off state, N/S pole, 0/5 volts… • 1 (“on”) and 0 (“off”) are referred to as bits. • Eight bits is a byte. Two bytes represent a unique character (Unicode) • Decimal numbers and binary numbers.
Hardware: Units of Memory and Storage • Everything in the computer memory and storage devices is a number! A computer understands only numbers. • Number number • Character number (ASCII code) • Grey level number ( usually 0 – 255) • Color three numbers (R/G/B)
Question 2. A byte can store 256 different numbers, why do we need two bytes to store an English character?
Hardware: units of Memory and Storage • Kilobyte (KB) = one thousand (1024) bytes • Megabyte (MB) = one million (1024 KB) bytes • Gigabyte (GB) = one billion bytes • Terabyte (TB) = one trillion bytes
Hardware: Memory • Computer memory is a set of storage locations. • Five types of memory: • Random access memory (RAM) • Cache memory • Virtual memory • Read-only memory (ROM) • Complementary metal oxide semiconductor memory (CMOS)
Hardware: Memory • RAM --- Random Access Memory • Sits on motherboard and closes to CPU • Also called volatile memory, primary memory, and main memory. • Most important memory type. • 256 MB to many GBs. • Fast CPU + big memory + (fast graphical card) a fast computer.
Hardware: Memory • Cache memory • Special high-speed memory chip on the motherboard or CPU • Stores frequently and recently accessed data and commands. • Usually 1 to ??? MB. • The bigger, the better, also more expensive.
Hardware: Memory • Virtual memory is extra memory that simulates RAM if more is needed. Limited by the memory space (word size). • Read-only memory (ROM) is the permanent storage location for a set of instructions the computer uses. • CMOS memory is semi-permanent information about where essential software is stored.
Hardware: Storage Media • Magnetic storage devices • Hard disks—several magnetic oxide covered metal platters usually sealed in a case inside the computer • Tape—inexpensive, slow, archival storage for large companies who need to back up large quantities of data. • Floppy disks: (almost) obsolete
Hardware: Storage Media • Optical storage devices • CD-R - store 700 MB of data • CD-RW: not reliable • DVD—can store between 4.7 and 15.9 GB of data; Blue-ray discs and HD-DVD can store between 15 and 50 GB of data
Hardware: Storage Media • Flash memory cards • Small, portable cards: rewritable • Used in digital cameras, handheld computers, video game controllers, and other devices • Most commonly-used: SD (HDSD) cards – Secure Digital.
Hardware: Storage Media • USB drive, USB flash drive • from 32 MB to 16 GB and more • Plug directly into the USB port (hot operation) • Rewritable • Best portable storage • Small and inexpensive: $1.50/GB
Question 3. When we talk about memory and storage, how do you compare computers and people?
Hardware: Input/Output • Input: • Data you type • Data by reading files • Data through Internet. • Data from sensors…… • Other sources • Output: The result of computer processing.
Hardware: Input/Output • Peripheral devices • Accomplish the input, output, and storage functions. • Not on the motherboard slow • I/O always is the slowest part of any program execution
Hardware: I/O Devices Input devices: • Keyboard • Mouse • Others
Hardware: I/O Devices • Output devices: • Monitors • CRT monitors (almost obsolete) • LCD and LED • Printers • Others
Hardware: I/O Devices Monitor’s quality • Screen Size (diagonal in inches) • Resolution (in pixels) • Setting the screen resolution.
Hardware: I/O Devices • Types of printers • Laser • Inkjet • B/W printing: • buy laser printers • Color laser printer: very expensive cartridges. Inkjetprinter
Hardware: Printer • Turn OFF the printer when not printing to prevent the heat from drying the cartridges. • Use the power button to turn off the printer in order to make cartridges stay in the proper housing. Do not pull the power cord.
Hardware: Video Card • Integrated (on-board) and dedicated video cards • Gaming: needs high-end video cards. • High-end computers have dedicated video-cards • Usually, a video card has its own memory; on-board video shares main memory. Microsoft Office 2007-Illustrated Introductory, Premium Video Edition 46
Hardware: Network Devices • Network cables (Ethernet cables) • Modems and routers • Wireless cards and adapters • Building a home wireless network: Not as hard as one thinks. Just follow the instructions.
The Back of a Computer Power connection Computer ports and connections Mouse port Keyboard port Audio connection Monitor port FireWire port USB ports Network port Speaker and microphone connections Phone line connection