Department of Computer Science 1 Faculty of Civil Engineering, Brno University of Technology INFORMATION TECHNOLOGY I code of course: BU01 Content of course • Introduction - 4 lectures •how computers work •how PCs work •peripheral devices •computer networks •algorithm, program, data • Operational systems - 2 lectures •classification and global properties •standard OS: file system, processes, policies •using Unix, Windows 2 Content of course - cont. • Text processing - typography •Principles of computer typography - 1 lecture •WYSIWYG text processing and DTP (MS Office) - 6 practices •Markup languages (HTML) – 5 practices • Computer graphics and image processing • Databases and spreadsheets •Principles of data modeling and database systems - 1 lecture •Calculations in spreadsheet environment - 5 practices 3 Basic Information 4 • http://www.fce.vutbr.cz • student server http://study.fce.vutbr.cz ) • computer classrooms – in winter change one's shoes! • Lectures: classroom B432, typically Tuesday 16:00 • Practices: B427, typically Monday 16:00 • Tests and credit: •Simple calculation in MS Excel •Knowledge testing of information technology Department of Computer Science Faculty of Civil Engineering, Brno University of Technology How do the computers work Goal: unification of knowledge of technologies used in computer science Approach: great simplification Content: • CPU and operational memory - main parts of computer • instruction processing in computer • main computer architectures • CPU and memory communication • peripheral devices and their controllers • permanent and external memory • program and machine code 5 6 Main parts of computer Basic information structure 7. 6. 5. 4. 3. 2. 1. 0. 0 1 0 1 1 0 0 1 5 9 Byte (59Hex = 89Dec) Address Content 00000000 01001011 00000001 10000010 00000010 01001111 00000011 10101011 00000100 00001000 Bi-directional communication CPU RAM 7 Instruction cycle Address Content Phases of cycle 00000000 01001011 • Instruction fetching • Instruction decoding • Instruction performing 00000001 10000010 00000010 01001111 00000011 10101011 00000100 00001000 CPU Instruction table of CPU Content 00000000 00000001 00000010 What to do No operation Jump over next address ... RAM Input-Output devices • Each device has its own controller that transforms the other type of information into binary one • Controller accesses to the partial part of RAM • Device types: • Write only to the memory - input device (e.g. keyboard) • Read only from the memory - output device (e.g. monitor) • Read/write - input-output device (e.g. disk memory) RAM • Direct communication between CPU and controller - I/O ports CPU Peripheral device controller 8 Architecture according to Von Neumann • Computer consists of processing unit, memory and I/O devices • Computer structure is not depended on the solved problem • Memory is divided into the same cells. Access to the cells is enabled through their addresses • Cells of memory contain both instructions and data distinguishable only by context • Program is composed of sequence of instructions executed step by step excluding jumps • Addresses, instructions and data are represented in binary form 9 10 Central processing unit Arithmetic-logic unit Controlling unit Registers Instructions Data RAM CPU Instructions • transfer - moving data between registers of CPU and cells of RAM • arithmetic - adding, subtracting, multiplying, … typically operate with data in registers • logic - log. conjunction, disjunction, rotation, shift, … typically operate with data in registers • jumps - condit. commands, calling subroutines, … • input-output - moving data between registers of CPU and I/O ports of controllers of peripheral devices • others - controlling, … CISC (Complex Instruction Set Computer) RISC (Reduced Instruction Set Computer) 11 Memory • Device for storing the information (binary encoded data and instructions) • Capacity of memory (amount of storable information) is measured in bytes • Memory is divided into the same cells - minimal addressable units • Two types of memory: • operational (internal) - main part of computer realized by integrated circuits. Depends on the source of el. energy. • peripheral (external) - stores data permanently, information is not accessible directly by CPU. Cheaper, slow (disks, CD-ROM, floppy, ZIP, …) 12 13 Caches Operational memory Magn. disk Magn. tape, (optical disk) Access time increases Registers Capaity incerases Cost of bit increases Memory hierarchy Units for capacity of memory Prefixes used for multiply coefficients slightly differ from the ones in SI standard: 1 KB = 210 B = 1 024 B, 1 MB = 220 B = 1 048 576 B = 1 024 KB, 1 GB = 230 B = 1 073 741 824 B, 1 TB = 240 B = 1 099 511 627 780 B. 64 KB = 65 536 B, 512 KB = 0,5 MB, … 14 CPU - RAM communication Internal bus CPU RAM 15 I/O control. data address control Internal (system) bus 16 • Set of conductors with el. signals • Three parts of bus with signals of the same meaning •Data part - transfer of data between CPU and RAM, 16, 32, 64 bits wide corresponding to the type of processor •Address part - transfer of addresses from CPU to RAM, 16-64 bits wide determines limit capacity of memory •Controlling part - controls the flow of information through the bus • Asynchronous commun. (handshaking on contr. part): •CPU: I have the address for you on the address part of bus •RAM: I have the data (content of address) for you on the data part of bus • Synchronous communication (preferred): • Independent bus clock determines the phases above 17 Generation of computers Possible classification according to the used components Gener. Year Basic component Speed (Instr./s) 0. 1940 Relay <10 1. 1950 Electron tube <1.000 2. 1958 Transistors <10.000 3. 1964 Integ. circuits <100.000 3½. 1972 LSI <1.000.000 4. 1981 VLSI <109 Bugs in computer software Grace Murray Hopper, working in a temporary World War I building at Harvard University on the Mark II computer, found the first computer bug beaten to death in the jaws of a relay. She glued it into the logbook of the computer and thereafter when the machine stops (frequently) they tell Howard Aiken that they are "debugging" the computer. The very first bug still exists in the National Museum of American History of the Smithsonian Institution. The word bug and the concept of debugging had been used previously, perhaps by Edison, but this was probably the first verification that the concept applied to computers. 18 Bugs in computer software „First actual case of bug being found.“ September 9th, 1945 19 20 Beginning of computers Electr. computer ENIAC (1945) • • • • 17 648 elect. tubes mass 30 t supply 140 kW cooled by two aircraft motors • programmable through jumpers on the spec. desk panel • till 1946 top secret • Electronic Numerator, Integrator, Analyzer and Computer 21 Program and subprogram programmer Native language compiler Programming language Instructions for CPU (machine code) Procedural languages (Algol, Fortran, Pascal, C, C++, …) Nonprocedural languages (Prolog, Lisp, query languages, …) Interpreted languages (Basic, Java, Pearl, …) Realization of subprogram in machine code - stack Advantages of using subprogram •memory saving •well arranged programming •mechanisms of interrupt Disadvantages •slightly slower Literature • http://www.maxmon.com/history.htm • http://www.cs.virginia.edu/brochure/museum.html 22