2.01k likes | 2.22k Views
CMPS 101 Computer Literacy. Dr. Cong-Cong Xing Dept of Math and Computer Science. Part I Introduction to Computers and MS Windows. Introduction to Computer Software and Hardware. What is a computer?. This is it! Or…?. What is a computer?. An electronic device that can manipulate data.
E N D
CMPS 101 Computer Literacy Dr. Cong-Cong Xing Dept of Math and Computer Science
Part I Introduction to Computers and MS Windows
What is a computer? • This is it! • Or…?
What is a computer? • An electronic device that can manipulate data. • (ok) • A programmable electronic device that can store, retrieve, and process data. • (good) • An electronic device which, under programmers’ direction and control, performs input/output, processing, and storage. • (better)
What is a (computer) program? • A list of instructions telling computers what to do. (ok) • An implementation of an algorithm (what?)in a programming language. (good) • Examples? • MS Word • MS Excel • Firefox • <your own>
What is an algorithm? • A precise, step-by-step procedure designed to solve certain kind of problems. • examples • Sort the following sets of numbers {2, 3, 1, 45, 23, 67, 23, 21, 6} {2, 3, 56, 444, 33, 666, 777,66,5, 390, 34, 34, 56, 66, 55, 78, 34, 232, 342, 446, ……}
Hardware Components of a Computer CPU Output devices Input devices Storage devices John von Neumann architecture (important diagram)
All computers(PCs, mainframes, supercomputers, ….) are built according to this diagram/principle • Developed by John von Neumann
The old computer: ENIAC (the first electronic computer, 1940s)
The new computer: HP 2133 Mini-Note 1 GHz - 8.9 " - 512 MB Ram - 4 GB HDD
Cont’d • Input devices • Input data into computers • E.g. keyboard, mouse • <your own example>
Output devices • Output data out of computers • E.g. monitor, printer • <your own example>
CPU (Central Processing Unit, also called processor) • The defining-component of a computer • Two main CPU manufacturers: Intel and AMD • http://www.amd.com/us-en/ • http://www.intel.com/
Storage devices (two types) 2nd type 1st type
Cont’d • Storage Devices • RAM (Random Access Memory) • This is the primary type, main type, 1st type memory • Hard disk, floppy disk • optical disk (CDs, DVDs) • jump drive, flash memory • (Note: in most cases in the literature, the word “memory” means RAM) They are the 2nd type memory
RAM (memory) Desktop laptop
Hard disk (HD) (most people call it hard drive) • http://www.youtube.com/watch?v=9eMWG3fwiEU
Difference between the 1st type storage device (i.e. memory) and the 2nd type storage devices • Memory stores info temporarily • All 2nd storage devices store info permanently • Question: how come….
KB, MB, GB, Hz,…. • 1 bit = 1 or 0 • 1 byte = 8 bits • 1 K (kilo) = 1000 (roughly) • 1 M (mega) = 1000K (roughly) • 1 G (giga) = 1000M (roughly) • So, 2 GB = 2 x 1000 x 1000 x 1000 bytes 200 MB = 200 x 1000 x 1000 bytes • 1 Hz = number of operations per second
Can you understand the spec? Gateway M-7351u Laptop Computer - Intel Pentium Dual-Core T4200 2.0GHz, 4GB DDR2 RAM, 320GB HDD, DVDRW, 15.4" WXGA, Vista Home Premium 64-bit
Computer Science Areas (partial list) • Operating systems • Windows XP, Mac OS, Unix, Linux • Database management systems • Oracle • Algorithms • sorting • Software engineering • How to program “better” • Programming languages • Java, C++ • Theory • Math foundations • Architecture • Hardware • Artificial intelligence • Chess, robot
Database Management System Find all incidents for overlay
Algorithm • Sort the following sets of numbers into ascending order {2, 3, 1, 45, 23, 67, 23, 21, 6} {2, 3, 56, 444, 33, 666, 777,66,5, 390, 34, 34, 56, 66, 55, 78, 34, 232, 342, 446, ……}
Programming Languages • public class Lab2 • { • public static void main(String args[]) • { • // declaration of variables • double a; // first number, input • double b; // second number, input • double c; // the sum of 1st and 2nd number, output • String astr; // string for a • String bstr; // string for b • // read in the 1st number • astr = JOptionPane.showInputDialog("Enter the 1st number"); • a = Double.parseDouble(astr); • // echo • System.out.println("You have entered "+a); • // read in the 2nd number • bstr = JOptionPane.showInputDialog("Enter the 2nd number");
Computing Theory • Domain theory • Category theory • Computability theory • Lambda calculus • Pi-calculus • Object-calculus • ……. • Turing Machine *(Alan Turing) (Computer Science Turing Award)
Artificial Intelligence • robot
Elements of a Computing Process • Hardware • Software • Data • Users • Procedures Hw & sw data data procedure users
Review • What is a computer? • What is a computer program? • What is a programming language?? • Give an example of programming languages • What are the 4 components of a computer system? • What does “Pentium 4 3.0 Ghz” mean? • Are hard drive and memory the same thing? Why? • Give an example of computer science research areas • Give two examples of operating systems
Processing and Memory • Processing • Data representation • Sequence of 0’s and 1’s • ASCII (American Standard Code for Info Interchange) (e.g. A -> 65) • http://www.neurophys.wisc.edu/www/comp/docs/ascii.html • http://www.cplusplus.com/doc/papers/ascii.html
Cont’d • CPU • Control unit (CU): sets the order of tasks • ALU (arithmetic-logic unit): carry out computation CU & ALU write fetch RAM
Cont’d • Compatibility: • different CPUs have different instruction sets • Data bus: • Connects CPU and RAM and peripherals • Bus width measured by bits • Address bus: • Connects CPU and RAM • Width of address bus determines the max # of RAM locations. (why?) • CISC vs. RISC • CISC (complex instruction set computer), expensive, complex, high speed.
Cont’d • RISC (reduced instruction set computer), inexpensive, simple, satisfactory speed • Typical CPU chips • Pentium, • AMD • Power PC series • Alpha series • Memory • RAM (Random-access Memory): • the main memory of computers • Cache Memory: • faster, more expensive • ROM (Read-Only Memory): • Stores system info, not writable
Cont’d • Motherboard • The baseboard housing every hardware component (except I/O) for computation.
How Computers Store Data • Storage Media • All storage materials described here are non-volatile (RAM is volatile). • Magnetic tape • Hold large amount of data • Inexpensive • Slow access • Sequential access • Backup
Cont’d • Magnetic disk: random access, read/write head. • Floppy disk, 1.44 mb (obsolete) • Hard disk • Faster • Holds large amount of data • Pack of disks • Sealed and encased
Optical disc: holds huge amount of data • CD-ROM • CD-R (Recordable) • CD-RW (Rewritable) • DVD (Digital Video Disk) • DVD-ROM • DVD-R • DVD+R • DVD-RW • DVD+RW
Storing Data in Files • File: a collection of data stored as an individual entity. • Types of files: • Program file – executable, e.g., MS Word. In Windows, an executable file typically has .exe extension. • Data file – data used by programs, e.g., text files, graphics • Naming files name extension
Program file Data files
Naming files • Ex: • ReadMe.txt • Lab1.docx • Lab2.xlsx • Me.jpg • Car.gif • Player.exe • What if I rename “Me.jpg” to Me.txt”? extension name
Directory (also known as Folder) • A group of files (and/or subdirectories) organized in a tree-shape sp05 eng101 cs101 hw1 hw1 hw3 hw2