Computers and Programming Lesson 2: Computer Hardware, Memory and I/O PDF

Document Details

PoliteSweetPea

Uploaded by PoliteSweetPea

Assiut University

Dr. Ing. Omar Abdel-Gaber M. Aly

Tags

computer hardware computer programming memory computer science

Summary

This document provides a lesson on computer hardware, memory, and input/output (I/O) for a computer programming course. It covers various components such as the CPU, memory hierarchy, cache, RAM, ROM, secondary storage, and buses, explaining their functions and interactions. The document also outlines input/output devices and their roles in computer communication.

Full Transcript

Computers and Programming Lesson 2:Computer Hardware, Memory and I/O By Dr. Ing. Omar Abdel-Gaber M. Aly [email protected] Assistant Professor Electrical Engineering Department College of Engineering Assiut University Computer Hardware Memory...

Computers and Programming Lesson 2:Computer Hardware, Memory and I/O By Dr. Ing. Omar Abdel-Gaber M. Aly [email protected] Assistant Professor Electrical Engineering Department College of Engineering Assiut University Computer Hardware Memory I/O Objectives  Learn the hardware components of a computer.  Understand the relation between the CPU, memory, and input/output devices.  Differentiate between different types of storage devices and understand the special characteristics of each.  Recognize different kinds of input/output devices. A computer performs basically five major operations : 1. Accepts data and instructions by any means of input 2. Stores data and instructions 3. Processes data as required by the user (instructions) 4. Produces results in the form of output 5. Controls all operations inside a computer Computer Hardware PC Assembly Video The computer system hardware interaction Computer Hardware Typical components of a computer system Central Processing Unit CPU, Processor, Microprocessor o Brain of the computer, o Most complex part of a computer e.g., Six-Core Core i7/ 8-Core Xeon E5 processor, 2,270,000,000 individual components. o The microprocessor is plugged into the motherboard of the computer o CPU executes the stored program concept, i.e. instructions and data are stored in memory before execution. CPU Components o Arithmetic and Logic Unit - ALU performs arithmetic operations and logical operations. o Control Unit organizes the processing of data and instructions. It acts as a supervisor and, controls and coordinates the activity of the other units of computer. CU also holds the CPU’s Instruction Set, which is a list of all operations that the CPU can perform. o Registers are type of memory (high speed) located inside the CPU that can temporarily hold data (processing and control) such as IR (Instruction register) and PC (Program counter). Central Processing Unit o Programs are broken into sequences of (thousands or even millions) very simple instructions ( primitive operations ), such as "add two numbers" or "copy a value from one location to another." Instruction cycle (fetch – decode – execute) o CPU gets the program instruction from the memory o CPU interprets the instruction o CPU executes the instruction (for example: performs the arithmetic operations required for the processing of data) Memory Hierarchy Modern computers utilize a combination of memory types, each with its own performance and cost characteristics. Modern CPU’s are much faster than the speed of memory. The memory organized in a way that its slower speed does not reduce the performance of the overall system. The main idea is to use a limited capacity of fast but expensive memory types and a larger capacity of slow but cheap memory types. Memory Hierarchy Memory Unit o Part of a computer that stores programs and data. o The memory unit consists of cache memory and primary memory o Main Memory (primary memory): is the main storage for the computer, holding the data and programs that the CPU is actively using o Random Access Memory (RAM) and Read Only Memory (ROM) together form the main memory o Secondary memory is non-volatile and is used for permanent storage of data and programs Memory capacity (size)  Bits are the building blocks of digital memory. Of course, a single bit (0 or 1) is not very useful for storing information. Memory capacity is usually specified in bytes (1 byte = 8 bits)  A group of bytes can be further combined to form a word. A word can be a group of 2, 4 or 8 bytes.  Memory size can be identified using: a kilobyte (KB = 210 bytes), a megabyte (MB = 210 KB ), a gigabyte (GB = 210 MB ), and a terabyte (TB = 210 GB )  byte represents a character. A megabyte is capable of storing more than one million characters of text (e.g., a book) Cache memory o High-speed circuitry to provide extremely fast access to data. o Small amount (usually Megabytes) to store data, temporarily, recently used by the CPU. o Placed between RAM and CPU. o Contents are lost when power is turned off (volatile). o Internal cache is built into the CPU. o External cache resides on the motherboard. RAM (Read/Write Random Access Memory) o where the operating system is loaded, o your applications are copied to when you start an application, o contents of RAM are lost when power is turned off (volatile) o packaged on separate chips, o larger amount than cache o significantly less expensive to build than cache A program is copied into main memory and then executed The fetch Decode Execute cycle 16 ROM (Read Only Memory) o non-volatile memory, but contains read-only software o comes programmed by the manufacturer o BIOS chip ( Basic Input Output System) o is the basic program used as an interface between the operating system and the motherboard o power-on self-test (POST) for all hardware components of the system to make sure everything is working properly at system startup o bootstrap loader that loads your operating system from the disk into the RAM Interaction of CPU with memory Secondary Memory o Main memory is expensive & volatile o Secondary memory is cheap and provides permanent (retain data without power) storage o It takes longer time to access (slower) Magnetic Hard disk (HDD) Metal platter coated with a magnetic medium that stores bits as magnetized and non-magnetized spots. o Disk rotates under a sensor, which detects the magnetized spots o Its capacity usually measured in GB and TB Magnetic Hard disk The rings on the platters are called tracks and each is divided into a set of sectors Tracks that are on the same radius from the axis on all platters constitute a cylinder. Files are stored in a HDD in fragments called clusters each usually consists of a contiguous set of sectors. Solid-state drive (SSD) A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory, and functioning as secondary storage in the hierarchy of computer storage. SSDs are typically more resistant to physical shock, run silently, and have quicker access time. SSDs store data in semiconductor cells. 22 Optical disk technologies o written and read by leaser beams not affected by magnetic fields o slower than HDD o read/write speed nX o include: o CD or CD-ROM (Compact Disk–Read Only Memory) 700 MB. CD-ROM drives can read data at 150Kbps (X) o CD-RW (Compact Disk – Rewritable) o DVD "Digital Versatile Disk”, transfer the data from the disk to the computer far faster than CD ( 4.7 GB – 17 GB) o A single-layer Bluray can store 25 GB (dual-layer?) Flash memory  Flash memory is non-volatile computer storage chip that can be electrically erased with (USB) interface. o removable and rewritable, o much smaller, less weight (light) o TB size is available o durable because they don’t contain internal moving parts. o high-speed, and low-energy consumption o used in devices such as digital camera, mobile phone, printer, laptop computer Buses o A bus is a set of wires used for interconnection, where each wire can carry one bit o the System Bus (Internal bus) connects components inside the motherboard like, CPU and system memory o The Expansion Bus (External Bus) connects the different external devices, peripherals, expansion slots, I/O ports and drive connections to the rest of computer System Bus Three buses exist for the transfer of information: Address bus: The width of address bus determines the maximum number of memory locations the computer can address (N bits can represent 2N different values). Data bus: transfers data between the CPU and memory. The bus width of a data bus affects the speed of computer. Control bus Performance of a Computer Registers RAM System Clock – Clock speed is measured in Hertz, where one Hertz is one clock tick per second – Computer systems have a "clock" — to keep all these times synchronized Bus CPU bandwidth is generally measured as how many bits is manipulated in each clock cycle. Cache Memory Hardware Internal Motherboard o The motherboard is a large printed circuit board where the processor, memory and other electronic components are attached. Hardware  Chipset o The chipset is a series of chips attached directly to the motherboard. o The chipset controls the system and its capabilities. All components communicate with the processor through the chipset. Hardware CMOS Chip: saves some system information, such as time, date and essential system settings, and is kept powered by a button battery located on the motherboard. Hardware Expansion Slot ( bus slot or expansion port) o Video card o Fax / Modem card o Network card o Memory slot o SCSI for HD and CD drives Hardware Back Panel and Ports A port is an interface on a computer to which you can connect a device. o Serial Port o Parallel Port o Universal Serial Bus (USB) Input and Output Devices  The way to communicate with the computer  Peripheral Devices: The I/O devices that are attached, externally, to the computer machine  Input devices (any type of device that provides data and instructions to a computer from the outside world)  Output devices (any type of device that delivers data or information from a computer to the outside world)  Devices that enable the computer to communicate with other computers are both input/output devices Input devices: Scanner Scanner is an optical input device that accepts paper document as an input. It uses light as an input source to convert an image into an electronic form that can be stored on the computer. The two common types of scanners are: – Hand-held Scanners – Flat-bed Scanners Output devices: Printer  The print quality (sharpness and clarity of print) of the printer is determined by the resolution of the printer.  Resolution is measured in dots per inch (dpi)  Printers are classified into two categories—impact printer and non-impact printer  Impact printers: Dot Matrix, Daisy Wheel, Drum  Non-impact printer: do not hit or impact a ribbon to print. They use electro-static chemicals and ink-jet technologies. Laser Inkjet (liquid ink-jet) Output Devices: Monitor (screen) A monitor is of two kinds - monochrome display monitor and color display monitor. The number of colors displayed by a color monitor varies with the kind of color adapter attached to it (for example: SVGA supports around 16,000,000 colors) types: – CRT – LCD (lighter, smaller, low power consumption) Resolution: Number of dots (pixels) on the screen. The smaller the pixels, the clearer and sharper the picture appears on the monitor. Expressed as 1280 X 1024 (width X height). Input / Output Devices: Touch screen It accepts input when the user places a fingertip on the computer screen. Generally used in applications like Automated Teller Machine (ATM), public information computers like hospitals, airline reservation, etc. Touch screen working types: (resistive, capacitive, surface wave).

Use Quizgecko on...
Browser
Browser