Computer and Programming Principles Chapter 2 PDF (2020/2021)

Document Details

AlluringShark

Uploaded by AlluringShark

Palestine Polytechnic University

2021

Palestine Polytechnic University

Eng. Yousef Salah

Tags

computer hardware computer architecture digital electronics computer science

Summary

This document is Chapter 2 of the 2020/2021 Computer and Programming Principles course at Palestine Polytechnic University. It provides a comprehensive overview of computer hardware, including components, functions, and types of storage. Topics discussed include the central processing unit (CPU), main memory, secondary memory, input/output devices, and the motherboard.

Full Transcript

‫جامعة بوليتكنك فلسطين‬ Prepared by: Eng. Yousef Salah Eng. Mohammad Jabari This material developed under the objectives of FESTEM project funded by the EU. https://festem.ps/ PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLE...

‫جامعة بوليتكنك فلسطين‬ Prepared by: Eng. Yousef Salah Eng. Mohammad Jabari This material developed under the objectives of FESTEM project funded by the EU. https://festem.ps/ PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH CHAPTER TWO COMPUTER HARDWARE PREFACE: This chapter aims at providing a general overview on the main physical parts of a computer system. It also introduces students to the various types and properties of computer processors, memories, storage, and input/output devices. INTENDED LEARNING OUTCOMES: After completing this chapter students will be able to: 1) Introduce students to the basic hardware parts of the computing machine. 2) Illustrate the main components the computer processor made of and their functionalities. 3) Differentiate between main types of computer memory and storage media. 4) Study the metrics used in identifying memory capacity. 5) Present miscellaneous input and output devices. FURTHER READING: 1) Discovering Computers ©2018: Digital Technology, Data, and Devices. 2) Computing Essentials 2017-McGraw-Hill (2017) Daniel O’Leary, Linda I. O’Leary, Timothy J O’Leary. Page 1 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH INTRODUCTION TO COMPUTER HARDWARE  As discussed in Chapter One, computer hardware is the physical and tangible parts of the computer, which include all electronic, electrical and mechanical items inside the computer machine.  The Central Processing Unit (CPU) is the “brain” of a computer system, containing digital logic circuitry able to interpret and execute instructions.  Main Memory is where currently executing programs reside, which the CPU can directly and very quickly access. Main memory is volatile; that is, the contents are lost when the power is turned off.  Secondary Memory is nonvolatile, and therefore provides long-term storage of programs and data. This kind of storage, for example, can be magnetic (hard drive), optical (CD or DVD), or nonvolatile flash memory (such as in a USB drive).  Input/Output Devices (or Peripherals) include anything that allows for input (such as the mouse and keyboard) or output (such as a monitor or printer).  Buses transfer data between components within a computer system, such as between the CPU and main memory.  The figure below shows the main hardware components of a computer system: Page 2 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  Every computer has four basic hardware components: o Input Components o Output Components o Processing Components o Storage Components  Processing Components: Within the processing components, data is processed and information is generated that will be displayed on the output components. Processing Units - The main component is the CPU (Central Processing Unit) or Processor. - The processor contains the following main subparts: o Arithmetic and Logic Unit (ALU) ALU CU Performs Arithmetic and logical operations, like Addition, Subtraction, Comparing, And, OR, etc … Registers o Control Unit (CU) Controls all operations on CPU, and communicates with both the ALU and memory. o Registers Registers are used by the CPU to store data and intermediary results temporarily during processing. Page 3 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH - The CPU and other important computer components fit onto the Motherboard, as shown in the figure on the side. - A Motherboard is an electronic circuit board which holds and interconnects the hardware together, mainly the CPU and Memory. It also provides connectors for other peripherals. - The Motherboard in a desktop computer is housed in a case (or chassis, or system unit) which collects main hardware components in one place. - The computer case collects in addition to motherboard: o Hard Drives o Optical Drives o Coolers and Fans  Dissipate the overheat generated by the electronic components, while keeping them operating at acceptable temperature level. Page 4 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH o Power Supply:  Feeds computer hardware with electricity. It also converts Alternative Current (AC) (around 120 Volts) from standard wall outlet to Direct Current (DC) (ranging from 5 to 12 Volts) which is the suitable level of current that computer hardware operates properly. Activity: Had you ever heard about “Wireless Charging” for smartphones? - The motherboard contains the System Clock, which is a small quartz crystal circuit to control and synchronize the timing of all computer operations. - Though, computer processing speed is identified by the frequency of this crystal (in Hertz). - The higher the CPU clock means that more instructions can be processed per second. Page 5 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Activity: - What’s meant by a 2.4 GHz computer processor speed? How the clock speed influences a computer’s performance? - What Moore’s Law states? What is a multi-core processor. Why computers clock speed stopped at around 3GHz? - Expansion Slots: o Expansion slots are locations (or sockets) on the motherboard into which expansion cards (also called adapter cards) can be inserted to connect those cards to the motherboard. o Adapter cards give computers additional capabilities, and expand the computer's functionality, like a video card, network card, or sound card. o An adapter card, is a circuit board that enhances the functions of a component of a computer system unit and/or provides connections to peripheral devices. Activity: Navigate the Internet to look for more information about the “M.2 Mini cards” and “M.2 Slots”. Page 6 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH - Computer Ports: The motherboard also contains the Ports that are used to connect the computer to external devices (peripherals). - PS/2 port - Used to connect a mouse and a keyboard. - USB Port (universal serial bus) - Designed to be universally compatible with a wide variety of devices. - Parallel port - Used to connect an external device, such as a printer. - Serial port - Remote control of equipment, such as routers, switches and mouse. - HDMI port - Used to connect the video monitor or multimedia projector. - Game Port - Used to connect joysticks. - Audio input and output - Used to connect speakers and microphones. - Video Port - Used to connect a video monitor or multimedia projector. Activity: What is Type-C USB port? How it differs from its predecessor USB port? Page 7 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  Storage Components: We need storage devices for information to be recorded. A computer has devices that store information so that it is not deleted when the computer is turned off. MEMORY VS. STORAGE  Memory refers to locations, usually inside the system unit (typically random access memory or RAM) that a computer uses to store data on a temporary basis. Typically, Memory refers to chip-based storage. Memory usually consists of one or more chips on the motherboard or some other circuit board in the computer.  Storage refers to the more permanent storage a computer uses usually in the form of the computer’s internal hard drive or removable storage media (such as DVDs and flash memory storage systems), but it can also be in the form of chip-based internal storage—especially in mobile devices. Page 8 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH MEMORY CAPACITY - A Byte is the basic storage unit in memory. - When running an application, data and instructions are loaded from storage devices into memory. - Instructions and data exist as bytes in memory.  A computer is a digital device where the internal physical and electronic construction (mainly the transistor which is used as an ON/OFF switch) leads to handle data and instructions as patterns of ZEROs and ONEs. The figure below shows a sample digital signal inside a computer.  Integrated circuits (“chips”) (IC), are the building blocks of computer hardware, are comprised of millions or even billions of transistors.  The 0’s and 1’s are typically called bits (Binary Digit).  A Byte is a group of bits operated on as a single unit in a computer system, usually consisting of eight bits. Page 9 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  The following table shows the measurements of memory sizes (capacity): 1 bit 0 or 1 1 Byte 8 bits = 23 bits 1 KiloByte (KB) 1024 Bytes = 210 Bytes = 210 * 23 bits = 213 bits 1 MegaByte (MB) 1024 KB = 210 KB = 210 * 210 Bytes = 210 * 210 * 23 bits = 223 bits 1 GigaByte (GB) 1024 MB = 210 MB = 210 * 210 MB = 210 * 210 * 210 Bytes = 233 bits 1 TeraByte (TB) 1024 GB = 210 GB 1 PetaByte (PB) 1024 TB = 210 TB Activity: A memory chip has a 32 KB storage capacity, answer the followings: a) How many bits can be stored in this memory? b) What is the capacity of this memory in GB? Page 10 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH VOLATILE VS. NON-VOLATILE MEMORY  Volatile Memory: Loses its contents when the power is turned off.  Non-Volatile Memory: Keeps its contents when the power is turned off. TYPES OF MEMORY Registers (Volatile memory inside the processor) RAM (Random Access Memory): o RAM is part of the main memory. o It is Volatile. o Used to store the essential parts of the operating system while the computer is running, as well as the programs and data that the computer is currently using. Activity: - What is the RAM size of your computer? - Can you increase the RAM size in your mobile device? - How RAM size affects the computer performance? - Why when we open a program for the first time it takes longer time to start than the second time? ROM (Read-Only Memory): o Non-Volatile memory chips attached to the motherboard. o Contents of ROM cannot be changed or updated. o Mainly, ROM was used to store data and programs responsible for starting up the computer. Page 11 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Activity: What are the main differences between RAM and ROM in terms of capacity, volatility, and uses? Flash Memory: o Non-Volatile memory chips. o Replaced the ROM chips when storing system information required during the booting (starting up). o Unlike ROM, the contents of Flash Memory may be updated and changed. o Flash memory chips are also built into many types of devices (such as tablets, handheld gaming devices, and smartphones), as well as built into storage media and devices (such as flash memory cards and USB flash drives). Activity: What is meant by the term POST (power on self-test), and what is meant by this term? Cache Memory: o Volatile memory chips. o Cache memory is used to speed up processing by storing the data and instructions that may be needed next by the CPU in handy locations. o Very fast memory o Very expensive o Small capacity (few MBytes) o Usually comes as part of the CPU Page 12 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Activity: If the Cache memory is faster than the RAM, why do not we replace the RAM with Cache? TYPES OF STORAGE - Storage may also be known as Secondary Storage, or Auxiliary Storage. - A Storage Device is usually used to store data and programs permanently (Non- Volatile). - Data stored on a storage device using any of the following techniques: o Magnetically o Optically o Flash memory - We’ll study The following storage technologies: o Hard Disk Drive o Solid State Disk o Optical Disk o Magnetic Tape o Cloud Storage Hard Disk Drive (HDD)  Uses magnetic field to store data.  Electro-mechanical device.  Data is organized as tracks and sectors.  Huge capacity, ranging from GigaBytes to few TeraBytes.  Not expensive.  Relatively Slow. Page 13 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Solid State Disk (SSD)  Uses flash memory technology to store data.  New Technology which replaced HDD in some new computers.  Big capacity (100 GB – 16 TB).  Fast; faster than Hard Disk.  Expensive. Optical Disk  Slow  Not expensive  Capacity range from 700 MB – 100 GB  Use Laser Beam to write/read data from disk, this includes CD, DVD, and Blu-ray disks Types of Optical Drives: – CD (Compact Disk) Size (700 GB) Cheap All computers with CD drive can read it – DVD (Digital Versatile Video) Size (1.8 GB – 8 GB) Originally used to store movies Only optical drives with DVD label can read it – Blu-ray Capacity (25GB – 100GB) Developed by Sony Requires special Blue-ray drive to read Used to store 3D Movies and Big Video games Page 14 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Activity: What is meant by: - Optical Drive - Optical Disk Magnetic Tape – Very slow (Sequential Access) – Cheap – Good capacity (10 GBytes – 100 GBytes) – Usually used for back-up storage Activity: Why do you think Magnetic Tapes are suitable for back-up storage? Cloud Storage – Examples: Dropbox, Google Drive, iCloud, and Microsoft Sky drive – Instead of storing data locally, store it off-site on the Internet – Advantages include: Cost, Accessibility, sharing, security – Disadvantages include: privacy, requires Internet connection Page 15 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Discussion: How the use of Cloud Storage would make your data more accessible? Using the Cloud for storage raises some privacy concerns, explain? MEMORY HIERARCHY Why do we need all these types of memory/storage devices? Because we need to balance between these 3 factors: – Cost – Speed – Capacity Page 16 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH COMPUTER PERFORMANCE Depends on many factors: – CPU Speed (clock rate) – Number of CPU Cores – Cache and memory – Secondary Storage speed; HDD or SSD - What is the meaning of Word Size? A computer word is the amount of data (typically measured in bits or bytes) that a CPU can manipulate at one time. In the past, CPUs used 32-bit words (referred to as 32-bit processors); today, most CPUs are 64-bit processors (that is, they can simultaneously process 64 bits, or 8 bytes, at one time). Usually, a larger word size allows for faster processing and the use of more RAM, provided the software being used is written to take advantage of 64-bit processing. Page 17 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  Input Components: o Used to enter data and commands into a computer like Keyboard, Scanner, Microphone, Mouse, Webcam, Touch Screen, … - Keyboard: A device that has a series of buttons with letters, numbers and symbols, used to enter data. - Webcam: Video camera that captures either still pictures or motion video, and can transmit its video on the Internet in real-time. These days, it’s commonly used for videoconferencing. - Mouse: A pointing device that controls the cursor around the monitor. - Page 18 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH - Microphone: Captures audio and human voice. - Magnetic strip reader - Barcode reader - Joystick: Mainly for Gaming - Scanner: Scans images, photos and text. Page 19 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  Output Components: o Responsible for providing the user with data from computer output (images, graphics, sounds, audio, videos, text and others … ) like Screen, Printer, Speaker, Projector, … - Monitor: Displays system information visually. - Printer: Prints text, graphics and images on a paper. - Speaker: Propagates the sound and improves sound reproduction. MONITORS - A Monitor (or Screen, or Display device) is an output device that produces visual information to the user. The displayed information called soft copy information. - Display Technologies: o CRT (Cathode-Ray Tube) o LCD (Liquid Crystal Display) o LED (Light-Emitting Diode) Page 20 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH - The basic element of an image being displayed is called Pixel (short for Picture Element). Display Features: Resolution - Resolution is the number of horizontal and vertical pixels in a display (rows × columns). For example, a monitor or screen that has a 1600×900 resolution displays up to 1600 pixels per horizontal row and 900 pixels per vertical row, for a total of 1,440,000 pixels to create a screen image. - The higher a monitor’s resolution (the more pixels), the clearer the image produced. - PPI stands for Pixels Per Inch and is a metric typically used to describe the pixel density (sharpness) for all sorts of displays, including cameras, computers, mobile devices, etc… Page 21 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Dot (Pixel) Pitch - Dot pitch is the distance in millimeters between pixels on a display. Text created with a smaller dot pitch is easier to read. - The lower the number, the sharper the image. Size - The display size is measured by the diagonal length of a monitor’s viewing area. - Common sizes are 15, 17, 19, 21, and 24 inches. Aspect Ratio - The aspect ratio defines a display’s width relative to its height. - 2:1 aspect ratio, for example, means the display is twice as wide as it is tall. The aspect ratio for a widescreen monitor is 16:9 or 16:10. - 4:3 means that the ratio of the width of the display screen to the height is 4 to 3. Other display devices: 1) Projectors 2) Interactive Whiteboard 3) HDTV (high-definition Television) Page 22 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH PRINTERS - A printer is an output device that translate information on paper. - Printer output is called hard copy information. Printer Features: Resolution - Resolution: measured by dpi (dot per inch). - The higher the dpi, the better the quality of images produced. - Most printers designed for personal use average 1,200 by 4,800 dpi. Speed - Speed: measured by the number of pages printed per minute (ppm). Color - Black/White. - Colored. Printer Types:  Impact Printers: Forms characters and graphics on a piece of paper by striking a mechanism against an inked ribbon that physically contacts the paper.  Nonimpact Printers: Page 23 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH  Impact Printers: o Daisy wheel o Dot Matrix  Nonimpact Printers: A nonimpact printer forms characters and graphics on a piece of paper without actually contacting the paper. o Inkjet Printers - Spraying tiny drops of liquid ink onto a piece of paper. - Works with ink cartridges to print text, spreadsheets, photos and graphics. Page 24 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH o Laser Printers - High-speed, high-quality nonimpact printer. - Creates images using a laser beam and powdered ink, called toner. o Thermal Printers - Used by ATMs, Cashiers, point-of-sale (POS) to print receipts. - Small and Light-weight. - Use special heat-sensitive paper. o Plotters - Plotters are sophisticated printers used to produce high-quality large- scale drawings, such as banners, blueprints, maps, and circuit diagrams. Page 25 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH o All-in-One Printers - Also called a multifunction printer. - Integrates printing, copying and scanning functions into one machine. - It may also support fax service. - Some use color ink-jet printer technology, while others use laser technology. Activity: You are kindly requested to refer to the Internet to know more about a trendy printer called: 3D Printer. Page 26 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH CHAPTER QUESTIONS: Q1) State whether each of the following statements is TRUE or FALSE. TRUE / Statement FALSE The keyboard, mouse, microphone, scanner, digital camera, and PC camera are six commonly used output devices. During processing, the processor places instructions to be executed and data needed by these instructions into memory. Storage differs from memory in that it holds items only temporarily while the processor interprets and executes them. A storage medium is the physical material on which a computer keeps data, instructions, and information. When a computer executes the instructions in a program, usually it first loads the instructions from memory into storage. When a computer is started, the operating system loads onto the computer’s hard disk from memory. On a personal computer, the electronic components and most storage devices reside outside the system unit. A hertz is one cycle per second. A CPU with higher clock speed can process fewer instructions per second than a CPU with a lower clock speed. The higher the clock speed, the faster the processor, and the more expensive the computer. Nonvolatile memory loses its contents when power is removed from the computer. Page 27 of 28 PALESTINE POLYTECHNIC UNIVERSITY COMPUTER AND PROGRAMMING PRINCIPLES 2020/2021 ENG. YOUSEF A. SALAH Q2) Choose the best answer: 1 Computer hardware includes all of the following a. input and output devices except __________. b. storage and communications devices c. a system unit d. application programs 2 Some computer components, such as the a. keyboard and mouse b. monitor and microphone __________, are internal and reside inside the c. processor and memory system unit. d. printer and scanner 3 The CPU contains __________. a. input devices and output devices b. the control unit and the arithmetic/logic unit c. main memory and storage devices d. all of the above 4 Arithmetic operations __________. a. involve matching one data item to another to determine if the first item is greater than, equal to, or less than the other item b. include addition, subtraction, multiplication, and division c. sort data items according to standard, predefined criteria in ascending order or descending order d. use conditions with operators such as AND, OR, and NOT 5 The data stored on ROM chips __________ when a. can be modified and is lost power to the computer is turned off. b. can be modified and is not lost c. cannot be modified and is lost d. cannot be modified and is not lost Q3) An image is presented on a screen containing 360 pixels width, and 180 pixels height, answer the followings: A) What is the total pixels being displayed on the screen? B) If each pixel is represented as 8 bits,  What is the image size in KB?  What is the image size in MB? Page 28 of 28

Use Quizgecko on...
Browser
Browser