Programming Unit 2. Software and Hardware PDF
Document Details
Uploaded by RealisticNiobium
Universidad Carlos III de Madrid
Tags
Related
- Computer Organization and Design RISC-V Edition PDF
- (The Morgan Kaufmann Series in Computer Architecture and Design) David A. Patterson, John L. Hennessy - Computer Organization and Design RISC-V Edition_ The Hardware Software Interface-Morgan Kaufmann-102-258-pages-2.pdf
- Computer Organization and Architecture Lecture Notes PDF
- CS 233 Lecture Notes - Fall 2024 PDF
- Chapter 1: Introduction to Computers and Programming PDF
- Introduction to Computers and Programming PDF
Summary
This document provides lecture notes on computer architecture, software, and hardware. It details topics such as programming languages, translation programs, operating systems, computer architecture, execution of instructions, and peripherals. The document is suitable for undergraduate-level study.
Full Transcript
Programming Unit 2. Software and Hardware UNIT 2 COMPUTER ARCHITECTURE: SOFTWARE AND HARDWARE Programming Grade in Industrial Technology Engineering 2024-25 Unit 2. S...
Programming Unit 2. Software and Hardware UNIT 2 COMPUTER ARCHITECTURE: SOFTWARE AND HARDWARE Programming Grade in Industrial Technology Engineering 2024-25 Unit 2. Software and Hardware Contents 1. Software 1. Programming languages 2. translation programs: compilers and interpreters 3. Operating systems 2. Hardware 1. Computer architecture 2. Executing instructions at the processor 3. Peripherals: Data storage, output, input, industrial interfaces, communications 4. Computer networks and the Internet 2 Unit 2. Software and Hardware 1. Logic support: Software Computer Computer: Machine composed of electronical elements, able to accept data from an input device, process them automatically with a previously stored program, and to provide the resulting information through an output device Process INPUT OUTPUT Physical elements: Logical elements: Hardware Software 3 Programming Unit 2. Software and Hardware 1. SOFTWARE Unit 2. Software and Hardware 1. Logic support: Software Software Software: Logical elements that control the work of the physical components to accomplish a task Basic software Programs for the elemental functioning of the computer and the peripherals (BIOS) Operating System : programs that do the basic tasks of the system: control, resource management, input and output, management etc. Resident programs: basic software permanently loaded in the memory (OS, some communication programs, antivirus) Application software Programs for specific purposes, solving a specific problem or family of problems: office (word processors, spread sheets…), games, etc. 5 Unit 2. Software and Hardware 3. Algorithm and program Algorithm and program (from unit 1) Problem Algorithm Program A program encompasses: Programming Language Program data Information processed by the program Ex: date_of_birth Expressions Operations on data performed with operators ex: age = 2018- date_of_birth Instructions Actions of the program, typically actions on data print (age) A program implements an algorithm in a given programming language, with instructions that follow specific rules and notation (symbols) 6 Unit 2. Software and Hardware 1. Software. Programming Languages Classification of Programming languages Three types Machine code Assembler High level languages According to the similarity the natural language High-level programming languages (close to natural language) C, C++, Java, Python, Matlab, … Low-level programming languages (close to the machine) Machine code Assembly 7 Unit 2. Software and Hardware 1. Software. Programming Languages Machine Code (Binary code) The computer can only run machine code = instructions coded in binary format, sequences of bits Data and instructions are encoded by using strips of 0 and 1 that encode operations and memory locations Small instruction set ↑ The fastest: talking to the computer on its own language ↓ Unnatural for humans: Very difficult to create programs with: error prone, debugging is difficult ↓ Targeted specifically to one microprocessor: it cannot be used in different processor brands, because the instructions refer to specific hardware components 8 Unit 2. Software and Hardware Software. Programming Languages Machine code example E.g.: Instruction to add the contents of registers 1 and 2 and place the result in register 6 (MIPS architecture) 0000000000100010 00110000 00100000 Meaning type Op 1 Op 2 Res Shift Function 000000 00001 00010 00110 00000 100000 9 Unit 2. Software and Hardware 1. Software. Programming Languages Assembly language Binary values are replaced by labels (mnemonics) An assembler program is used to translate the code into machine code ↑ Easier to remember and understand ↓ Low level instructions: Still complicated, it offers low-level primitives that make it difficult to solve complex problems Processor-dependent Assembler 10 Unit 2. Software and Hardware 1. Software. Programming Languages High-level languages Intended to bring programming languages closer to human language Instructions are translated into machine code by a program called a language translator Programs written in high-level languages do not depend on the internal architecture of a specific processor, The program can be run on different machine or operating systems The translator program will be different depending on the target machine There are more than 300 high-level programming languages (with more than 2400 with dialects): Fortran, Pascal, Cobol, Basic, C, C++, Java, Ada, Python, Matlab etc. 11 Unit 2. Software and Hardware Sample C program #include #define PI 3.1416 int main(void) { float radius, perimeter; printf ( "insert radius: "); scanf ("%f", & radius); // read radius value perimeter= 2*PI* radius; // display result printf(" perimeter is: %f\n", perimeter); return 0; } 12 Unit 2. Software and Hardware High level language (C) Assembly code 13 Unit 2. Software and Hardware 1.2. Language translation programs Language translation programs Translation programs convert instructions in assembly language or high-level language into binary code Input: instructions in text format (source code) in any programming language, known as source code Output: executable program in binary code Besides translating, it can detects syntactic errors in the program (bad-formed instructions) and inform the programmer These are called compilation-time errors Types of translation programs Assembler Compiler Interpreter 14 Unit 2. Software and Hardware Language translation programs Assembler Transforms the program in assembly language to executable machine (binary) code Compiler Transforms a program in a high-level language (source code) to programs in a low-level language (object code) Interpreter Transforms the program in a high level language (source code) instruction-by-instruction to executable instructions and executes them 15 Unit 2. Software and Hardware 1.2. Compilers and interpreters Compiler Transforms the program in a high-level language (source code) to programs in a low-level language (object code) Object code is not directly executable; it must be linked (with a linker program) with other object code (e.g., external libraries) to generate the executable file The compiler detects syntax errors; if any, it warns the programmer and the object code is not generated The compiled program can now be run on any compatible computer (with the same operating system), even if the compiler is not installed at that computer 16 Unit 2. Software and Hardware 1.2. Compilers and interpreters Interpreter Interprets the program instruction by instruction Gets one instruction and translates it into machine code You need to have the interpreter installed on your computer to run the program No independent object code is built The translation process is repeated till all instructions have been run or an error is found 17 Unit 2. Software and Hardware 1.2. Compilers and interpreters Compiler vs Interpreter Compiler wins over Interpreter The code is compiled once and used several times (more efficient) Syntax errors are detected in compilation time (when the program is being developed) Compilers are faster A block of instructions inside a loop that is repeated 1000 times will be translated 1000 times with an interpreter The target computer (where the program is run) does not need to have the interpreter installed Interpreter wins over Compiler The same code can be run in different environments (for example different operating systems )as long as an interpreter is available Code modification and variable watching is straightforward In a compiled language you need to run the program under the control of a debugger (a special software) to achieve this 18 Unit 2. Software and Hardware 1.2. Compilers and interpreters Programming languages, interpreters and compilers. Human High level language language Source code Interpret (instructions one by one) Compile Assembly code Object code Low level language Assembler Linker Machine (binary) code Binary code PROCESSOR 19 Unit 2. Software and Hardware In more detail.... Header Files Source code.h.c Compiler Library Files Object code (already compiled).o Linker Executable code.exe 20 Unit 2. Software and Hardware 1.3. Operating Systems Operating System The operating system is the piece of software that manages the physical elements of the computer to coordinate the execution of a program Layer between the physical components of the computer and the programs in a programming language Functions Efficient coordination and management of the resources (monitor, printer, keyboard, memory, etc.) user-machine interaction Process user requests Commands (user requests) Program calls Examples: Windows 8, Mac OS X, Linux, Android, iOS 21 Programming Unit 2. Software and Hardware 2. HARDWARE Unit 2. Software and Hardware 2.1. Computer architecture Hardware Hardware: Set of mechanical and electronic compoments that that make up a computer system Main components of a computer Central Processing Unit (CPU) Module in charge of controlling the work of the computer Input/ Output peripherals: modules in charge of transferring information between computer and user Buses system that transmits information among computer components Auxiliary memmory Massive storage of data (hard disk) 23 Unit 2. Software and Hardware 2.1. Computer architecture Computer architecture Basic hardware structure of a computer Defined by Von Neumann (1945) Secondary memory Central Processing Unit (CPU) Processor Arithmetic- Control Unit Output Input devices Logic Unit devices Communication Main memory buses 24 Unit 2. Software and Hardware 2.1. Computer architecture Processor The processor is the core component of the computer It includes Control Unit Interprets the instructions and control their execution Arithmetic-Logic Unit (ALU) Performs basic arithmetical and logic operations Arithmetical: Addition, substraction, … Logical: AND, OR, … 25 Unit 2. Software and Hardware 2.1. Computer architecture Processor – Control Unit Control Unit Manages the functioning of the computer Executes the instructions stored in the main memory Basic functions Analyzes the state of the other units Fetch program instructions from the main memory According to the instructions, generate electric control signals for other units to perform the operations required Composed of Registers Decoder Clock 26 26 Unit 2. Software and Hardware 2.1. Computer architecture Processor – Control Unit Registers Small memory units to store data and instructions temporarily Program counter Register (or Instruction Pointer): Contains the memory address of the next instruction Instruction register: Contains the instruction being executed Decoder Takes the machine language instruction and operates the electronic cirduits to perform it System clock Generates clock pulses at a fixed frequency, each clock pulse starts the execution of an instruction The number of pulses per second determines the speed of the computer. Clock speed is measured in hertzs 200 Mhz = 200 millions of elemental instructions per second 27 27 Unit 2. Software and Hardware 2.1. Computer architecture Processor – Arithmetic-Logic Unit Arithmetic-Logic Unit (ALU) Performs arithmetic (addition, substraction, etc.) and logic (and, or, etc.) operations Data used by the ALU must be stored in the main memory, and trnsfered to the registers The ALU fetches data to be operated from ALU registers First operator, Second operator, Result 28 Unit 2. Software and Hardware Central processing unit components PROCESSOR MAIN MEMORY CONTROL Instruction counter register UNIT Data 1 Instruction register Instruction Data address Data 2 Data 3 clock Decoder Operand 1 Operand 2 Instruction 1 Register Register Instruction 2 ARITHMETIC- Instruction 3 LOGIC UNIT Result register 29 Unit 2. Software and Hardware 2.1. Computer architecture Main memory Stores information that is currently used by the system. Current data and instructions Data in the main memory can be moved to the processor very fast as compared to data on the secondary memory i.e. the hard disk Typically two types A Read Only Memory (ROM) with permanent information Recorded when computer is manufactured with relevant programs and data from the operating system that we need to have permanently in the main memory A read and write memory (RAM) that is volatile (contents are lost when the computer is turned off) 30 Unit 2. Software and Hardware 2.1. Computer architecture Main memory arranged as a set of cells with consecutive address numbers Each cell stores several bits 0 Cells are also named “memory address 1 2 00010010 words” content A word is identified by its position number (the address), which indicates the order in the list.. 255 31 Unit 2. Software and Hardware 2.1. Computer architecture Buses Communication buses are electrical circuits that connect the components of the computer Three types of buses Control bus, to transmit instructions to the components of the system Address bus, to transmit addresses e.g. Address of a memory cell to write, or address of a peripheral to send data Data bus, to transmit data between the components of the system Bus width: number of wires of the bus = number of bits that can be simultaneously transmitted 32 Unit 2. Software and Hardware 2.1. Computer architecture Secondary or auxiliary memory Massive information storage More capacity Less velocity Permanent: doesn’t go away when computer is switched off 33 Unit 2. Software and Hardware 2.1. Computer architecture Personal Computer components Does my PC have this same components? All computers are based on the Von Neuman arquitecture Main memory – RAM memory Auxiliary memory – hard disk drive, external drives Processor – Processor In collocquial language you can hear the term CPU referring to the box that contains the computer elements The CPU is only the processor and the main memory Buses - buses 34 Unit 2. Software and Hardware RAM memory Main memory RAM= Random access memory Stores programs, data used by them and the opreating system The more RAM memory the computer has, the more programs can be in run simultaneously and the larger programs can be stored in memory Extensible (using DIMM and SIMM modules) Source: Wikipedia [link] 35 Unit 2. Software and Hardware 2.1. Computer architecture Central Processing Unit (CPU) Processor Arithmetic- Control Unit Logic Unit Main memory Secondary memory 36 Unit 2. Software and Hardware 2.1. Computer architecture 2.1. Computer architecture Hard disk Main memory (RAM) Power supply (Transformer from 220V to 5 or 12V) Processor fan Expansion slots and adapter cards Motherboard http://www.videojug.com/film/what-components-are-inside-my-computer 37 Unit 2. Software and Hardware 2.2. Execution of instructions at the processor How does the CPU execute an instruction? Remember: every high level instruction is translated into many lower level instructions, that perform very simple steps Watch this video to get an idea of how two numbers are added https://www.youtube.com/watch?v=FRCXF1Sak7s 38 Unit 2. Software and Hardware 2.2. Execution of instructions at the processor Program execution steps (1) 1. The control unit fetches the instruction to be executed from the main memory (the address where this instruction is stored is retrieved from the program counter register) 2. The instruction is stored in the instruction register, that has two perts One containign the operation code (i.e., what operation it is) and the memory address of the data involved in the operation ( Find the different elements in the Central Processing Unit components’ slide 39 Unit 2. Software and Hardware 2.2. Execution of instructions at the processor Program execution steps (2) 3. The control unit sets connections through the system buses It fetches from the main memory the data to process, if needed For example if the operation is a sum, it will fetches the numbers to add from the address specified and stores them in the registers of the ALU Sends and order to the components (e.g., the ALU) to perform the operation by sending control signals and data 4. If the instruction returns a result, it is stored in the main memory 5. The program counter is increased and the next instruction is processed Then, the cycle starts over again 40 Unit 2. Software and Hardware 2.3 Peripherals Peripherals Peripherals are devices used by the computer to communicate with people and other computers, to acquire, store, or transmit data. Types: Storage: hard disk, magnetic tape, optical disk, CD-ROM, DVD Input: keyboard, scanner, optical reader Output: monitor, printer Peripherals communicate with the processor through channels A channel is an electronic device with two parts: Memory or buffer: data to be processed Control unit: executes instructions 41 Unit 2. Software and Hardware 2.3. Peripherals. Storage Storage peripherals Used to store information Magnetic units Data are stored by means of changes in the polarization of a magnetic surface Floppy disks, hard disks, magnetic tape Optical units They based in the optical properties of the materials (light reflection) CD-ROM, DVD Solid state units (flash drives) Data is stored in integrated circuits Storage units can be also classifed as: Undetachable: Hard disk Detachable: Floppy disk, CD-ROM, DVD, Flash memory 42 Unit 2. Software and Hardware 2.3. Peripherals. Storage Magnetic units Info Magnetic tape Thin magnetisable coating (iron oxide or chromium dioxide) on a narrow strip of plastic Information is encoded as polarized points on tracks parallels to the axis of the tape Sequential storage Obsolete (until recently it was used for very massive storage with non-frequent access, e.g. backups) Magnetic disks Disk with magnetisable material coating Hard disk Floppy disk 43 Unit 2. Software and Hardware 2.3. Peripherals. Storage 2.3.1. Storage peripherals – Hard disk Info Hard disk Group of 1-4 platters sealed inside a protecting case Platters are metallic or are covered with magnetizable material (two sides) An electrical engine make the platters spin at constant speed Reading / writing heads Ferrite core on a mechanical arm One head per magnetized side Arms move inwards and outwards to reach a track on the platter ‘1’ is stored when the polarization has one direction, ‘0’ in the other case More info (video) 44 Unit 2. Software and Hardware 2.3. Peripherals. Storage Hard disk Info Source: The PC Hardware Tutorial [link] 45 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units Info Several layers Transparent plastic disc (polycarbonate) Data layer –data to be read with a laser beam Metalic layer –reflects the beam back to the reader sensor Materials of the data and the metalic layers are different for different kind Source: Wikimedia Commons [link] of discs 46 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units Info Information encoding Data is stored as micro grooves (pits) One single spiral groove, starting from the center of the disc Holes (pits) and flat zones (lands) have different reflection properties The sensor measures the energy of the laser beam reflected on the disc surface to distinguish pit and lands (two states) ‘0’ and ‘1’ are not directly represented with lands and pits A pit represents a state change (from 0 to 1 and 1 to 0) A land represents a zone with no change of state (may be 0 or 1) The number of pits is reduced ➔ Writing is faster 47 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units Info Capacity The capacity of DVDs is larger than CD-ROMs because grooves are smaller Needs a shorter wavelength Laser to be red Blu Ray has an even shorter wavelength (blue color) Multi-layer discs A second physical layer is created inside the disc The outer layer is semi-transparent The laser beam accesses the second layer through the first layer Larger capacity 48 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units Info Source: Wikipedia [link] 49 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units: types (I) Info Read-only (CD-ROM and DVD-ROM) Data is physically carved on the poly-carbonate Metallic layer is aluminum Audio CDs have the same physical structure, but different data format Writable (CD-R, DVD-R) Data layer is an organic material that can be altered with the laser Metallic layer is gold, silver, or silver alloy After carving the organic material, it cannot be changed again Used for backups 50 Unit 2. Software and Hardware 2.3. Peripherals. Storage Optical units: types (II) Info Rewritable (CD-RW, DVD-RW, DVD+RW, DVD+RAM) Data layer is a metallic-alloy coating Crystallization state changes with heat The data layer can be melted with the heat of the laser beam. The grooves are flattened, so the laser beam can be applied to record new data +RW and –RW are two different encoding formats promoted by different associations of companies 51 Unit 2. Software and Hardware 2.3. Peripherals. Storage Solid state units Info Also called flash memory Detachable storage devices that use solid state devices (integrated circuits) instead of optical or magnetic technology No mechanical part –everything is electronic Pros: Faster; longer life Cons: Less capacity for a unit of the same size of a hard disk; cost per megabyte is higher 52 Unit 2. Software and Hardware 2.3. Peripherals. Storage Solid state units Info USB Flash drives (pen drives) Solid state memory that is plugged in the USB port A pencil-sized device can store more than 256GB Memory cards USB drive Source: Wikipedia [link] Used for portable devices Different types: SD: Secure Digital (normal, mini, micro) CF: Compact Flash XD: XD-Picture Card MMC: Multimedia Card MP3 Players use solid state units Comparison of different SD card sizes Source: Wikipedia [link] 53 Unit 2. Software and Hardware 2.3. Peripherals. Output Output peripherals Monitor Printer Monitor: Types Cathode Ray Tube (CRT) Liquid Crystal Display (LCD) Pixel Physical point in an image, smallest element of a picture 54 Unit 2. Software and Hardware 2.3. Peripherals. Output Catodic ray tube CRT Info The image is generated when an electron beam comes in contact with a fluorescent screen Three electron guns (RGB) and phosphor points with three colors (RGB) Human eye mixes the points to create colors http://videos.howstuffworks.com/howstuffwork s/144-how-tv-works-video.htm 55 Unit 2. Software and Hardware 2.3. Peripherals. Output Cathode Ray Tube (CRT) Info Refresh rate 60 Hz, 75 Hz (refresh per second) Graphical controller (video card) The output to the monitor is managed by the video card The video card has memory The number of colors and the resolution depends on the card The more colors, the better the look of the images The number of colors is correlated to the size of the memory of the graphics card 256 colors ⇿ 8 bits per pixel 16 millions of colors ⇿ 24 bits per pixel 56 Unit 2. Software and Hardware 2.3. Peripherals. Output Liquid Crystal Display (LCD) Info Structure http://youtu.be/jiejNAUwcQ8 A layer of molecules –liquid crystal, it can change the direction of light aligned between two transparent electrodes –conductors and two polarizing filters –without the liquid crystal, the light stops after the first filter The liquid crystal do not emit light. Since there is not enough contrast between the images and the background, the screen requires a back light TFT (Thin Film Transistor) is a kind of LCD that allows higher refresh frequencies 57 Unit 2. Software and Hardware 2.3. Peripherals. Output Liquid Crystal Display (LCD) Info Color LCDs Pixels are divided into three sub-pixels, each one used for a basic color (RGB), by using three filters Source: Wikimedia Commons [link] 58 Unit 2. Software and Hardware 2.3. Peripherals. Output Printers Info Printer Impact printer Impact on an inked strip to transfer ink to the paper and create a character (similar to a typewriter) Daisy wheel Dot-matrix Wheel with carved character Several pins create the character 59 Unit 2. Software and Hardware 2.3. Peripherals. Output Printers Info Non-impact printer Writing is done with thermal, electrostatic or chemical techniques They use liquid ink or toner Inkjet Thermal Laser More silent and faster 60 Unit 2. Software and Hardware 2.3. Peripherals. Output Printers Info Inkjet printers Propel droplets of ink onto the paper to form the characters Similar to dot-matrix, but changing the pins for tiny tubes that propel the ink Mobile head that moves horizontally on the paper The ink deposit is located on the head » The piezoelectric crystal creates a vibration on the ink container by applying a voltage difference » The droplet is driven by electrostatic devices Fuente: Wikimedia Commons [link] Imagen animada 61 Unit 2. Software and Hardware 2.3. Peripherals. Output Printers Info Thermal printers Selectively heating of regions of special heat-sensitive paper Slow, require special paper Similar to dot-pin, but they heat the paper instead of making impacts Used in receipts (credit cards, etc.) Slow, require special paper 62 Unit 2. Software and Hardware 2.3. Peripherals. Output Laser printer Info Similar to a copy machine; they use toner (dry ink) and a rotating drum The drum is charged with electrostatic energy The page is drawn in the drum with a laser beam The laser removes the charge of the points that will not be printed Toner particles are then electrostatically picked up by the drum's charged areas The drum prints the image onto paper by direct contact and heat, which fixes the ink to the paper Fast, high quality Full pages are printed (a memory in the printer required) 63 Unit 2. Software and Hardware 2.3. Peripherals. Output Laser printer Info 5. The heating bar bonds the toner to the page 1. Drum is electrostatically Heating lamp charged Drum 2. The laser beam draws the page by removing the charge on the drum 4. The page rolls over the drum 3. Toner dust is Toner picked up in the discharged points 64 Unit 2. Software and Hardware 2.3. Peripherals. Output Laser printer Info Toner cartridge Fuente: Wikimedia Commons [link] Fuente: Wikipedia [link] 65 Unit 2. Software and Hardware 2.3. Peripherals. Input Input peripherals Keyboard Info Mouse Joystick Scanner Barcode reader Magnetic reader 66 Unit 2. Software and Hardware 2.3. Peripherals. Input Keyboard Info Switches connected to a microprocessor that monitors their state Mechanical keyboard Small springs under the keys to return to the initial position The key, when pressed, make a contact with the metal of the circuit of the keyboard and closes the circuit –it opens when the key is released by the spring Membrane keyboard Rubber layer instead of springs When the key is pressed, the rubber presses a conductive layer with a metal end, which makes a contact with the circuit of the keyboard 67 Unit 2. Software and Hardware 2.3. Peripherals. Input Mouse Info Mechanical mouse Moving the mouse turns the inner ball, and consequently, the horizontal and the vertical rollers The movement (x and y axis) is transmitted Trackball The ball is directly moved; the mouse is static Optical mouse Uses a LED (light-emitting diode) that emits an infra-red beam The beam is reflected on the surface and detected back by a photosensor The movement (x and y axis) is interpreted from the reflection of the light 68 Unit 2. Software and Hardware 2.3. Peripherals. Input Mouse Info Source: Wikipedia [link] 69 Unit 2. Software and Hardware 2.3. Peripherals. Input Scanner Info Used to digitalize paper documents Photosensor with several photoelectric cells The documents is lit The light is reflected back and detected by the cells (colours or greyscale) The resolution of the scanner Source: Wikipedia [link] is the number of points (individual cells) that are contained in a square inch 70 Unit 2. Software and Hardware 2.3. Peripherals. Industrial interfaces Industrial interfaces Info Input (sensors) Devices that provide an electrical signal measuring some property of the observed object. The signal is digitalized and used as the input to the computer Thermo-resistors Pressure sensors Humidity sensors Volume of flow sensors Output (actuators) Relays (electromagnetic switch) Electro valves (valves activated with electric signals) Engines 71 Unit 2. Software and Hardware 2.3. Perhipherals. Communication Connecting the computer Info For many tasks, the computer has to be connected to an external device Peripherals or other computers to form a network Communication is done through the ports Two types: Parallel port, Serial port Parallel port Bits are transmitted through different wires If the transmission unit is a byte, the parallel cable will have 8 wires, plus additional lines to send control information (e.g., the channel is free or not) Obsolete 72 Unit 2. Software and Hardware 2.3. Peripherals. Communication Connecting the computer Info Serial port Bits are transmitted on a single wire (one at once) Before starting the communication, some information is exchanged between the sender and the receiver (hand-shaking): such as transfer speed (bits/second), number of bits per word, parity checking (redundant code) Example: Communication between computers or with a modem USB (Universal Serial Bus) Update on the classical serial port Higher transfer speed Unified connection technology: different types of devices can be plugged (keyboard, mouse, printer, camera, phone, etc.) 73 Unit 2. Software and Hardware 2.3. Perhipherals. Communication Ports Info Serial port Fuente: Wikimedia Commons [link] Paralel port Fuente: Wikimedia Commons [link] USB port Fuente: Wikimedia Commons [link] 74 Unit 2. Software and Hardware 2.5. Computer networks and the Internet 2.5. Computer networks and the Internet Computer network Group of autonomous computers interconnected by communication channels to share information Channel: wired or wireless Specific hardware (modem or network card) and software (communication program) is required Two types of networks LAN: Local Area Network WAN: Wide Area Network Fuente: Wikimedia Commons [link] 75 Unit 2. Software and Hardware 2.5. Computer networks and the Internet 2.5. Computer networks and the Internet Internet http://youtu.be/7_LPdttKXPc Net of networks: network composed by interconnecting computer networks around the world Each computer is identified with an address (IP address) Information is transmitted according to a set of rules (protocols): the TCP/IP protocols Features: Decentralized >> no central index Non hierarchical >> all the computers are equal Heterogeneous >> different types of computers (PCs, large systems) O.S. Independent >> computers can be connected regardless of the operating system 76 Unit 2. Software and Hardware 2.5. Computer networks and the Internet 2.5. Computer networks and the Internet Info History of the Internet http://www.youtube.com/watch?v=9hIQjrMHTv4 Cold War Computer networks based on phone and radio connections Vulnerable network Depends on the conditions of the channel If a link is interrupted, the net is down 1969 DARPA (Advanced Research Projects Agency), an agency of the US Department of Defence, connected four remote computers (ARPAnet) Packet switching Messages are sliced in the sender and rebuilt in the receiver Not all the packets of the message take the same path from the sender to the receiver If a node is down, the packet will reach its destination taking a different path 77 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Internet. Packet switching 3. Packets are transmitted from computer to computer towards the destination. The path may 2. Each packet is be different for two attached a header with packets. Packets may be information: sender, unsorted at the destination receiver, and number ROUTER computer of packet 2 1 1 2 2 5 6 4 1 3 ROUTER 5 1 4 ROUTER 1 2 3 4 5 6 ROUTER 5 6 1 2 3 4 5 6 4 4 3 6 3 4. The receiver sorts 1. Information is sliced the information to ROUTER into small pieces rebuild the original (packets) message send receive 78 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Internet. Communication protocols Info Communication Protocol Set of rules or conventions agreed by two computer systems to interchange information without errors TCP/IP Protocol Core protocol of the Internet used to interchange information IP (Internet Protocol) Rules to find the path to the destination It does not specify packet latency and order in the transmission TCP (Transmission Control Protocol) Guarantees that the packets at the source reach the destination without errors to rebuilt the original message 79 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Internet Addresses Info IP Address Each node of the net (computer) has an address Addresses are unique: each connected machine has a different address Numeric internal representation: four numbers separated by a dot: 163.117.10.23 Domain Name DNS: Domain name system Readable name assigned to a IP: mail.uc3m.es 163.117.10.23 mail.uc3m.es 80 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Applications on the Internet Info Internet is the network. Several applications work over the network: each application uses a different protocol on top of the tcp/ip protocol Examples World Wide Web E-Mail File transfer (ftp) Remote access (ssh) Instant messaging VoIP (voice over IP) 81 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Applications on the Internet E-Mail Message-exchange with other users of the network Text and attached files http://www.youtube.com/watch?v=YBzLPmx3xTU 82 Unit 2. Software and Hardware 2.5. Computer networks and the Internet Applications on the Internet: World Wide Web http://www.youtube.com/watch?v=qv0XCaUkfNk Documents (files) distributed in servers allocated around the world with links among them Multimedia documents: text, images, sound, video, etc. HTML: Hypertext Markup Language Standard language to describe web pages The presentation is independent of the operating system Links allow navigation between web pages by clicking on them HTPP: Hypertext Transfer Protocol Protocol based on TCP/IP to send and retrieve information to the WWW HTTP address or URL (Uniform Resource Locator): readable identifier of a resource of a computer E.g.: http://www.uc3m.es/uc3m/matriculanuevos-cuando.html 83 Programming Unit 2. Software and Hardware UNIT 2 COMPUTER ARCHITECTURE: SOFTWARE AND HARDWARE