120 likes | 600 Views
91.100 Media Computing This course is NOT About how to use MS Word, Photoshop, etc. About using computer applications and their instructions This course You DO computer programming in this course DO computer programming with immediate feedback DO computer programming with Pictures
E N D
91.100 Media Computing • This course is NOT • About how to use MS Word, Photoshop, etc. • About using computer applications and their instructions • This course • You DO computer programming in this course • DO computer programming with immediate feedback • DO computer programming with • Pictures • Sounds • (movie frames)
What Kind of Programming ? • DO computer programming with Java programming language with the aid of Greenfoot tools • Textbook:Michael Kolling, “Intro to Programming with Greenfoot,” Prentice Hall, 2010 • DO computer programming with Javascript for web pages • Start with basics of web pages • Add enhancements run by Javascript
Computer Programming • Problem solving • Get an overall idea of how to approach the problem • Write down each step of the way • Use the syntax in the given programming language • Like a cooking recipe, a manual, an instruction,… • Two categories • Language syntax • Define a conceptual view of data to manipulate • => Data Structure public void act() { if (atWorldEdge()) { turn(17); } if (Greenfoot.getRandomNumber(100) <10) { turn(5);} move(); if (canSee(Worm.class) ) { eat(Worm.class);} }
What is a Computer ? • The main circuit board inside your PC • Every components at some point communicates through the motherboard, either by directly plugging into it or by communicating through one of the motherboards ports
Hardware Organization CPU Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Mouse Keyboard Display Disk program stored on disk
Components in a Computer: Hardware • Hardware • CPU (Central Processing Unit) • Executes instructions • (what are instructions ?) • Speed of execution in GHz • Memory • Random access memory (RAM) • Long-term memory (Hard drive, • memory card,..)
Components in a Computer: Software • Software • Operating System (OS) • A large program that manages hardware resources • The OS is needed to run other programs called application programs (e.g. Microsoft Word) • Examples: Microsoft Windows XP, Vista; Apple Macintosh OS X; Linux • YOUR programs
Info in a computer • The smallest unit of data is the bit • A bit is either a 1 or a 0 • All data (and files) are a pattern of bits • 1 byte = 8 bits • Each byte can represent a letter, number or symbol. • The set of upper and lowercase letters, numbers, and other symbols is called the ASCII character set. • File • A file is a collection of data • Each file has a name • The online experience of what we see and hear is comprised of files • The software that we use needs files to run • The larger the file, the more time is needed to download the file to your computer
A number in a byte • Binary Number System
Number Systems • Different Bases • Base 10 (Decimal): 0, 1, 2,… , 9 • Base 2 (Binary): 0, 1 • Base 8 (Octal): 0, 1,…, 7 • Base 16 (Hexadecimal): 0, 1, 2,…., 9, A, B, C, D, E, F • How to convert from one base to another ? • Decimal to base x • Divide the number repeated by x, collect remainders • 200 -> base 8 • 200 (10) -> 310 (8) • Base x to decimal • Multiply positional weights by digits and add 8 200 25 -- 0 3 --- 1
A character in a byte • ASCII • binary Oct Dec Hex • Unicode
Units of Memory • Kilobytes (K): 1K = 1024 bytes • Megabytes (MB): 1MB = 1024 kilobytes • Gigabytes (GB): 1GB = 1024 megabytes • Terabytes (TB) : 1 TB = 1024 GB • There are two types of files: • ASCII text files contain ASCII characters • Binary files contain characters that cannot be typed on the keyboard, generated by software