Computer Systems Components 1. Hardware: Tangible Physical devices 2. Software: Intangible pieces of instructions, called programs written in various languages. Three Levels of languages: Machine languages: Only languages computers understand which are made up of binary strings/patterns like: 010111001100011. Very hard for humans. Assembly languages: Machine languages in alphanumeric form like: MOVE R1, R2 ADD R1, ABC Needs a translator called Assembler. A little bit closer to humans and easier than Machine languages. High-Level languages: Java, C++, Pascal, Ada, FORTRAN, COBOL Very close and familiar to humans. Very far from computers. Need translators called Compilers or Interpreters If (A=B) Print ("Beautiful Day") Else Print ("Gloomy Day") a. System software b. Application software System Software. Mostly to manage computer resources for the human users to use computers easily and efficiently. Operating Systems. Languages Translators: Compilers, Interpreters, Assemblers Loaders: Loading (storing) programs into Computer memory for immediate execution. CPU Scheduler: CPU: Central Processing Unit Brain of the computer. Executing all instructions and Processing data. A scheduler for multi-users and/or multi-tasks. Memory Manager Efficient utilization of Main Memory among Users, Programs, and Processes. Secondary Storage Manager Secondary Storage: Hard Disk (Drive-C) Floppy diskettes (Drive-A) CD-ROM(Read-Only) or Recordable CD (Drive-E) File Manager File: A Collection of related pieces of information to be stored in a secondary storage device. Each file is identified by a unique file name that has two parts separated by a "dot" name and extension (or type) The Type typically indicates the kind of information contained in that file. My.DAT (Data file) Your.TXT (Text file) Her.EXE (Executable file, called Application, ready for computer execution) Their.DOC (WORD produced Document) His.HTML or Her.htm (WWW Page) Windows Vista (Successor of XP) GUI (Graphic User Interface) based O.S. for PC. It enables users to use Menu to select and issue a command for the computer to execute for us simply by clicking the Mouse left button. Mouse has two buttons: Left and Right Left button 1. Click (Single-click) for a "Selection" to select an item such as a command or a computer component. 2. Double Click: Clicking it twice in a row quickly. for either opening the selected item (like a file) or executing (like an application) Right button Usually single-clicked for the Shortcut Menu of the selected item. The shortcut menu contains some commonly used commands depending upon the selected item including: Open Copy Cut Explore Create Shortcut New Rename Delete Properties. Application Software A piece of program dedicated to solving a particular kind of tasks, not related to direct management of computer resources, very small to very large/complex, like solving a linear equation, calculating payroll, or analyzing the entire US census. Many of these are commercially available like those we will learn in this course. WORD2007: Word processor that makes a ready-to-read document or paper like this note. EXCEL2007: SpreadSheet application for business operation ACCESS2007: Data Base management for efficient organization, maintenance and retrieval of large amount of information like a university semester student registration data. POWERPOINT2007: Slide presentation Microsoft Internet Explorer: WWW Webpage browser such as Internet Explorer and Netscapethat displays HTML documents. Hardware. consists of EU (Execution Unit) generally referred to as CPU(Central Processing Unit) Main Memory Secondary Storage devices (such as floppy diskette and CD and Hard-disk) I/O (input/output) devices (Peripheral devices) Interfaces between the CPU and human users. Input devices: For giving the CPU some information mouse keyboard scanner (for image or text inputs) output devices: For getting information from the CPU monitor (CRT, Cathode Ray Tube) not permanent printer permanent 1. EU (Execution Unit), commonly known as CPU (Central Processing Unit) Executes instructions as the brain of computer. It has three parts: 1.1 CU (Control Unit) Controls all parts of the computer by generating and emitting Synchronizing Pulses. Typically, the speed of these pulses, measured in cycles/second, is used as the Speed of Computers: 1.8GHz (My office Desktop) 1.2 ALU (Arithmetic and Logic Unit) Performs most computational operations. Typical Micro-Operations (The very basic operations computers are designed to perform as an electronic device) 1. Adding two integers (Whole numbers with no decimal point) 00110111 (decimal 55, 1+2+4+16+32) + 00111011 (decimal 59) ------------------ 01110010 (decimal 114) Subtraction is done just like Addition 2. Complementing Turning 01010111 to 10101000 3. Shifting to left (or to right) by a number of positions. Has the effect of multiplying by 2, 4, 8, 16, 32, 64 and so forth. (or the effect of dividing) 00001110 will become 01110000 when shifted left by three positions, being multiplied by 8. So, the decimal 14 became 112. 4. Comparing two integers This is a logical operation. The EU will perform one of a few predefined operations based upon the outcome of the comparison. 5. Fetching from and Storing into Main Memory. An instruction in the Main memory needs to be fetched in order for the EU to execute it. Also, a data item stored in the Main memory needs to be fetched before it can be used as an operand. 6. Data Movement. Moving an integer from MM to a Register or from a register to the MM or from a register to a register. 1.3 Registers: Faster access than MM Performing special functions such as (1) controlling instructions being executed (2) handling memory addressing and (3) providing arithmetic capability or containing certain information such as the starting address of a program segment or the current computational results. General-Purpose Registers AX: Accumulator Register Primary accumulator for most arithmetic and I/O (input/output) operations BX: Base Register Used as an index to extend memory addressing and in arithmetic as well. CX: Count Register Used in loop iterations or in shifting bits left or right. DX: Data Register required by some I/O operations and also in * (Multiplication) and / (division) Segment Registers CS: Code Segment Contains the starting address of a program's code segment. DS: Data Segment Contains the starting address of a program's data segment. SS: Stack Segment Contains the starting address of a program's stack segment. The offset of a particular stack element is contained in the SP (Stack Pointer) register. ES: Extra Segment Associated with DI (Destination Index) register, used for memory indexed addressing for some string operations. Pointer Registers IP: Instruction Pointer Contains the offset of next instruction to be executed. SP: Stack pointer Contains the offset of a stack element to be referenced. BP: Base Pointer Contains the offset address of a parameter being passed via the stack Index (For indexed memory addressing for string operations) SI: Source Index (together with DS register) DI: Destination Index (together with ES register) 2. Main Memory This is where the computer stores application programs and data currently being executed. For proper accessing, elements of the MM have addresses. 2.1 Units of MM a. bit The smallest unit that is large enough to contain one of two values: zero or one on or off true or false b. Byte eight consecutive bits are grouped into one "BYTE" which is large enough to contain one of 256 (which is 2 raised to the power of 8) Typically, a byte can represent a character (or an alphabetical letter) c. Word For some computers, it is two consecutive bytes. But for some others, it is four consecutive bytes. In either case, a word typically represents an integer or a floating-point number (with a decimal point) like 123.45 or 365.0 A "Two-byte" word can represent an integer roughly between -32768 (2 raised to the power of 15) and 32767. A "Four-byte" word can, on the other hand, represent an integer roughly between -2,000,000,000 and 2,000,000,000 2.2 Types of MM a. RAM (Random access memory): Most MM Volatile (Information stored will be lost each time computer's power switch is turned off) Hence, before turning off the computer, certain important pieces of information must be saved to a secondary storage device like the hard disk , Rewritable CD, USB or 3.5" diskette which is not volatile. Each byte has its own address by which the computer properly accesses it. Accessing a byte takes the same amount of access time regardless of the address, and hence the name. Typical size: 2 GB (including expanded memory) b. ROM (Read-Only Memory) This is a certain portion of the MM that has a fixed , READ-ONLY, information not to be altered or rewritten. Typically, the core of O.S. programs are stored in the ROM so that it can be readily loaded into the MM for immediate execution each time the computer is turned on. Typical size: 256K bytes c. Cache: Special portion of RAM for faster access. (Faster RAM) About 5 times faster than other RAM. This is where the computer stores blocks of RAM space by moving them from RAM in anticipation of frequent access. Typical size: 512K Bytes 3. Secondary Storage devices Permanent (non-volatile) storage of information usually as files. Slow access. 3.1 Types 3.5" (floppy) diskette: Usually Drice-A or B Hard disk: Usually drice-C or -D, fixed location, not movable. Typical capacity: 150 GB (desktop) CD-ROM: Usually drive-E Recently, rewritable drivers let us write onto CD. typical capacity: 700 mega bytes USB (Universal Serial Bus): Removable Typical Capacity: 2 or 4 GB. 3.2 File structure Files are organized as a hierarchy of "Folders" or "Directories" For example, a 3.5" disk may have 3 folders named F1, F2 ana F3 directly underneath itself. The folder F1 may have four folders names F11, F12, F13 and F14, and the folder F2 with its own folders F21, F22, F23, F25 and F25, and so on. Now, the folfer F11 may have its own folders and some files inside itself. Windows XP provides The Windows Explorer for fast access to individual files and folders. 3.3 Formatting of 3.5" diskette 1. Before a floppy disk can be used, it must be formatted. Usually, disks are already formatted when purchased. 2. Purposes a. Magnetically marking the boundaries of tracks and sectors b. Creating the disk directory to contain information about folders and files yet to be created. Three parts: Boot Sector Root Directory File Allocation Table. 3. Structures Two sides 80 tracks per side 18 sectors per track 512 bytes per sector So, a disk has 2*80*18*512 bytes of space, 1,474,560 bytes. But, 33 sectors (16,896 bytes) are used for the disk directory. 4. Steps a. Make sure the "Write-Protect" tab is closed. b. Insert a diskette with the external label showing at top. c. Double click "My Computer" icon. d. In the Window that shows up, right-click the Drive-A icon. e. The shortcut menu of Drive-A will show up. Click the "FORMAT..." command f. The Formatting dialog box will display. In this D.B., you enter your internal label like "HKOH1371A" or "HKOH1371B" in the text field labeled "Volume Label." g. Then, inside the "Format options" box, you choose "Quick Format" by clicking. The Quick formatting is allowed only if the diskette has already been formatted once. h. Then click "Start" button at the bottom of this dialog box to start the formatting. A warning message will appear that says "Formatting will erase all data ..." When you see this message, it shows that every thing is normal. So, you just click the "OK" button to let the computer to go ahead to complete the formatting process. i. When the formatting is complete, you will see a message "FORMAT COMPLETE" You can click "OK" button again when you see this. The computer will let you repeat above four steps, f,g,h, and i, in formatting other diskettes.