An Introduction to Computers August 12, 2008 Mrs. C. Furman
4 Tasks of a Computer Input Data – keyboard, mouse, scanner, microphone, digital camera, CD-RW/DVD drive, and disk drive. Store Data – integrated circuits. Process Data – CPU, where decisions are made. Output Data – monitors, printers, CD- RW’s, disk drives and memory keys store data and speakers.
CPU Arithmetic Logic Unit, which can perform arithmetic and logic operations Executes instructions fast. Speed is determined by the computer’s clock rate. Clock Rate - measured in megahertz (MHz, million cycles per second) and gigahertz (GHz, billion cycles per second)
Memory ROM: Read Only Memory – most basic operations RAM: Random Access Memory – primary storage or main memory – data and instructions are temporarily stored RAM can be written to secondary storage. Secondary Storage – floppy disk, hard disk, memory key, or CD- RW.
Programs Application Software –Word, powerpoint, games… Operating System Software – OS – run automatically when the computer is turned on and is used to control processing and peripherals, run application software and control input and output. –Windows, Mac OS X Tiger, Unix, and Linux
Programming Languages A set of words, codes and symbols that allow a programmer to give instructions to the computer. Low – level and High – level programs…
Low – Level Languages Machine language – first generation language. –Consists of 0’s and 1’s Assembly language –Same instructions and structures as machine language –Uses meaningful names or abbreviations instead of numbers. –Second generation language.
High-Level Languages Third generation languages Developed in late 1950s English-like instructions Easier to use than machine language Fortran, Pascal, C, C++, Java Compilers – program that convert high-level language into machine language. Interpreter – also translates the program but does it line by line, executing as they go.
How is Data Stored? Data – computer representation of something in the real world. Circuits – 2 states ON /OFF Imagine 2 light bulbs / 2 switches, what are the possible combinations? OFF / OFF OFF / ON ON / OFF ON / ON
What about 3 lights? How many combinations? What about 8 lights?
Apply to the computer… Use a special number system: Binary number system. Decimal Number System: base 10, digits 0 – 9. (Our number system) Binary Number System: base 2, digits 0 and 1. 0 represents off (false), 1 represents on (true). A single binary digit is called a bit.
Converting Binary to Decimal Decimal Numbers: 7403 = 7 x x100+ 0x x 1 3x10 0 = 3 0x10 1 = 0 4x10 2 = 400 7x10 3 =
Same process as previous slide, but base 2 8 bits in 1 byte: x2 0 = 0 1x2 1 = 2 1x2 2 = 4 0x2 3 = 0 1x2 4 = 16 1x2 5 = 32 0x2 6 = 0 1x2 7 = 128 Binary to Decimal Total: 182
8 bits = 1 byte What’s the number of combinations in 1 byte? What numbers can be represented with 1 byte?
Examples a b c d
Converting Decimal to Binary Binary Is base 2 We multiply to go from binary to decimal. We divide to go from decimal to binary. Right most digit tells even or odd. 1 – even 0 – odd.
Convert Decimal to Binary a. Convert 210 to binary. b.151
Hexadecimal Hexadecimal: Used to represent 4 binary digits = 15 and 0000 = 0, so it is base 16. Digits 0 – 9 plus A – F A:10, B:11, C:12, D:13, E:14, F:15
Hexadecimal to decimal 1f 15x16 0 = 15 1x16 1 = 16 31
Change from Hexadecimal to Binary and Decimal 0 A 19 1E
Octal Octal is base 8 – digits Convert to decimal x8 0 = 7 4x8 1 = 32 0x8 2 = 0 1x8 3 = 512 = 551
What is the decimal equivalent? C 16