Introduction to Computer Systems Notes PDF

Title Introduction to Computer Systems Notes
Author Danial Jivraj
Course Introduction to Computer Systems
Institution Aston University
Pages 43
File Size 4.1 MB
File Type PDF
Total Downloads 49
Total Views 167

Summary

This notes were made based off all the lectures for this module. They were written to ensure they cover everything the lecturer noted as important in the revision lecture. The level of detail is great in this notes to perform exceptionally well in the exam....


Description

Lecture 1: Basics of Computer Systems Basic Model of Computing:

What Is a Computer? A computer is an electronic device, operating under the control of instructions stored in its own memory, that can accept data, process data, and produce results • General Purpose computer • Special purpose computer

Four Components in a Computer System: • Hardware • Software • Data • Communication

Von Neumann’s Stored Program Concept Virtually all modern designs of computer are based on his key concept: Stored Program Concept. Which holds the following characteristics: - Data/instructions are stored in a single read/write memory; - The contents of this memory are addressable by location, - Execution of instructions occurs in a sequential fashion from one instruction to the next (unless that sequence is explicitly modified with loops and jumps).

Computer Categories: (4) Personal Computer: - A personal computer can perform all of its input, processing, output, and storage activities by itself - Is inserted into general purpose and for individual use - Two popular types are the PC and the Mac: Laptop, Desktop computer Embedded Computer: - An embedded computer is a special-purpose computer that functions as a component in a larger product - Examples: Smart phones, cameras, digital TVs, Video recorders, DVD players, game consoles Servers, Mainframes and Supercomputers: - A server controls access to the hardware, software, and other resources on a network - A mainframe is a large, expensive, powerful computer that can handle hundreds or thousands of connected users simultaneously - A supercomputer is the fastest, most powerful computer • Capable of processing trillion instructions in a single second

Mobile Computers/Mobile Devices:

Mobile Computer: Personal computer you can carry from place to place • Examples: notebook computers, laptop, netbooks, and Tablet PCs Mobile devices: Computing device small enough to hold in your hand • Examples: smart phones and PDAs, tablet, ebook readers, handheld computers, portable media players, calculators and digital cameras

Computer development history: - 1642: Blaise Pascal, aged 19, invented a calculating machine for addition and subtraction - Next major advance was Charles Babbage’s difference engine • Only did addition and subtraction • Laid the foundations for the first programmable mechanical computer

Babbage’s Analytical Engine: - Had four parts: - The store (memory) - The Mill (CPU) - Input section (punch card reader) - Output section (punched cards) - Read instructions from punch cards and carried them out – it was the first fully programmable computer, yet was completely mechanical

First-Generation: - 1937: Mark I (Aiken, Harvard University, IBM). •First electro- -mechanical computer using relays. - 1942: Colossus ( Milton Keynes )

•Using vacuum tubes; dedicated to code breaking - 1943-46: ENIAC (Mauchly, Eckert, University of Pennsylvania). •First general-purpose digital computer. •18000 vacuum tubes, 1500 relays, 6000 programming switches, 30 tons! - 1951: IAS machine (Institute for Advanced Study) •First stored-program computer

The second generation: transistors - Made vacuum machine obsolete by the late 1950’s

The third generation: Integrated circuit (IC) - The original transistor-based computers used thousands of discrete components - IC: put many transistors onto a single microchip - This led to cheaper computers and started the “minicomputer” in the 1970’s

Later generations: - IC-based computers were still huge machines - The advent of Very Large Scale Integration (VLSI) technology allowed tens of thousands, and eventually tens of millions of transistors to be fabricated on a single chip - Ultra Large Scale Integration (ULSI) chips can contain more than one million components - Various aspects of “Artificial Intelligence” can be included in the computer: natural language, learn from experience; see objects, etc.

Generations Table:

Moore’s Law: - Famous prediction by Gordon Moore, cofounder of Intel Corp, made in early 70s: • Microprocessor chip complexity measured in the number of transistors will double approximately every two years • The growth of processing power in terms of MIPS seems to have a tendency to grow exponentially roughly with the rate predicted by Moore - Even with all of the technological advances in computing over the years, the basic principles have not changed greatly

Lecture 2/3/4: Data

Standards:

Lecture 5,6,7: Hardware CPU: CPU, a.k.a., processor, consists of ALU, CU and registers etc. - ALU (arithmetic & logic unit): Performs calculations and comparisons - CU (control unit): controls the operations of CPU - Registers: internal memory of CPU

What must a CPU do? • Fetch Instruction: The CPU reads an instruction from memory • Interpret instructions: The instruction is decoded to determine what action is required • Fetch data: The execution of an instruction may require reading data from memory or an I/O module • Process data: The execution of an instruction may require performing some arithmetic or logical operation on data • Write data: The result of an execution may require writing data to memory or an I/O module

Arithmetic & Logic Unit (ALU): - John Von Neumann proposed the ALU in 1940s - ALU is a digital circuit that performs Arithmetic (add, aub, etc.) and Logical (AND, OR, NOT) operations • Logical gates, adder, multiplier, techniques/algorithms e.g. a half adder

Control Unit (CU): - Defined as one distinct part in Von Neumann Architecture in the 1940s - Part of the hardware that is in-charge: “brain within the brain” - Contains circuitry that uses electrical signals to direct the entire computer:

• Aid to load data/instructions into CPU from other storage • Instruct to execute stored program instructions • Communicates with other parts of the hardware

Registers: - Small storage locations within the CPU (much faster) - A collection of registers is also known as register file - Size in bits or bytes (not MB like memory), typically several dozen in current CPUs - Use of Registers • Scratchpad for currently executing program • Holds data needed quickly or frequently • Stores information about status of CPU and currently executing program • Address of next program instruction • Signals from external devices • Hold intermediate results or data values, e.g., loop counters

Special-Purpose Registers: - Program Count Register (PC) • Instruction pointer - Instruction Register (IR) • Stores instruction fetched from memory - Status Registers • Status of CPU and currently executing program • Flags (1-bit Boolean variable) to track sth like arithmetic carry and overflow, power failure, internal computer error - Memory Address Register (MAR)

- Memory Data Register (MDR) • Memory Buffer Register (MBR) General-purpose Registers: e.g. accumulator (AC)

Instruction and Instruction Set: - The language understood by the computer’s hardware, referred to as its machine language - Instruction: • The words of the computer’s language • Instructions are encoded in binary • An elementary operation in a programming language - Instruction Set: • The complete collection of instructions that are understood by a CPU • The set of operations that the computer can perform • RISC (Reduced Instruction Set Computer) e.g. ARM, MIPS • CISC (Complex Instruction Set Computer) e.g. X86

Instruction Cycle:

System Bus: Bus: - Bus: shared communication channel • Parallel set of wires for data and synchronization of data transfer - A communication pathway connecting two or more devices - The physical connection that makes it possible to transfer data from one location in the computer system to another - Group of electrical conductors for carrying signals from one location to another • Wires or conductors printed on a circuit board • Line: each conductor in the bus

Bus Lines: - Often grouped • A number of channels in one bus • e.g. 32 bit data bus is 32 separate single bit channels - 3 kinds of signals • Data, Address, Control signals

Data Bus: - Carries data • Remember that there is no difference between “data” and “instruction” at this level - Bus width • Number of lines: determines the number of bits that can be transferred at a time - Width is a key determinant of performance • 8, 16, 32, 64 bit

• E.g. if data bus is 16 bits wide & each instruction is 32 bits long – processor must access the memory twice during each instruction cycle!

Address bus: - Identify the source or destination of data • e.g. CPU needs to read an instruction (data) from a given location in memory - A number of wires indicate the address of data to be accessed - Bus width determines maximum memory capacity of system (the number of memory locations the CPU can address) • e.g. 8080 has 16 bit address bus giving 64k address space (216=65,536)

Control Bus: - Control and timing information • Controls access to the data and address lines • Timing Signals indicate the validity of data and address information - Typical control lines include: • Memory read/write signal • I/O Port read/write signal • Transfer Acknowledgement • Bus request/grant • Interrupt request/acknowledgement • Clock signals

Single Bus Problems: - Single Bus can be problematic • Lots of devices on one bus leads to Propagation delays

• Long data paths mean that co-ordination of bus use can adversely affect performance • If aggregate data transfer approaches bus capacity • Different devices may work at different speeds - Most systems use multiple buses to overcome these problems

Bus Types: - Processor-Memory buses • Short, high speed • Design is matched to memory organization - I/O buses • Longer, allowing multiple connections • Specified by standards for interoperability • e.g. USB, PCI, Fireware, SATA • Connect to processor-memory bus through a bridge

Memory: - Memory consists of a number of locations each of which can store a piece of information - Each location has a number, called its address by which programs can refer to it - All memory locations in a memory contain the same number of bits - Bytes are grouped into Words • The natural unit of organisation of memory • The size of word is typically equal to the number of bits used to represent an integer and to the instruction length • typically 32 bits or 64 bits for modern general purpose computers

Cache: - Small amount of fast memory - Sits between normal main memory and CPU - May be located on CPU chip or module - Cache is a copy of a subset of main memory - Cache operations: • CPU requests contents of memory location • Check cache for this data • If present, get from cache (fast) • If not present, read required block from main memory to cache • Then deliver from cache to CPU

Cache’s principles - Cache work on the principles of temporal and spatial locality • Temporal locality: if you use it now, chances are we will want to use it again soon • Spatial locality: if we use a piece of memory, chances are we will use the neighbouring pieces soon

Cache Terminology: - Blocks: the minimum unit of information that can be either present or not present in the cache, also called lines - Block size: 8 to 64 bytes - Tags: a field that contains the address information required to identify which block of main memory is in each cache slot - Cache controller: hardware that checks tags

Cache operation: - Cache hit: cache block is valid and contains proper address so read desired word

- Cache miss: nothing in cache is the appropriate block, so fetch from memory - Hit Ratio: ratio of hits out of total requests - Cache miss, block replacement: Wrong data is in cache at appropriate block, so discard it and fetch desired data from memory (cache always copy)

Memory Hierarchy: - Registers • In CPU ( less than 1KBytes) • Registers accessed on nanosecond timescale - Internal or Main memory • May include one or more levels of cache (n KBytes to MBytes) • More capacity than registers (~GBytes) • Access time ~ 50-100ns - External memory • Backing store • Tape and hard Disk (huge capacity, virtually limitless) • very slow: runs milliseconds

Memory Hierarchy Pyramid:

I/O Controller Functions: - Recognizes messages from device(s) addressed to it and accepts commands from the CPU - Data buffering: • Provides a buffer where the data from memory can be held until it can be transferred to the device • Copies data from its buffer to the device/from the CPU to its buffer - Provides the necessary registers and controls to perform a direct memory transfer - Physically controls the device - Communicates with CPU (e.g. status reporting)

Instruction Set Architecture for I/O: - What must the processor do for I/O? • Input: reads a sequence of bytes • Output: writes a sequence of bytes - Some processors have special input and output instructions • Separate instructions to access I/O device (e.g., x86) - Alternative model (e.g., used by MIPS): • Uses load for input, store for output (in small pieces) • Called Memory Mapped Input/Output • A portion of the address space dedicated to communication paths to Input or Output devices (no memory there)

How to make I/O work? Three Techniques: • Programmed I/O (also called “polling”) • CPU controlled I/O • Interrupt Driven I/O • I/O hardware signals CPU • Direct Memory Access Controllers (DMA) • Method for transferring data between main memory and a device that bypasses the CPU

Programmed I/O or Polling: - Processor executes an instruction by issuing a command to the appropriate I/O controller - Each device is given a unique identifier or address

- I/O controller performs the requested action and sets the appropriate bits in I/O status registers - It is the responsibility of the processor periodically to check the status of I/O controller until it finds the operation is completed - One word transfer per I/O instruction

Interrupt Driven I/O: - Solution: Interrupt program when I/O ready, return when done with data transfer • No repeated CPU checking of device • I/O controller interrupts when ready - Read Operation: • CPU issues read command • I/O controller gets data from peripheral whilst CPU does other work • I/O controller interrupts CPU • CPU requests data • I/O controller transfers data

Interrupt Terminology: - Interrupt lines (hardware) • One or more special control lines to the CPU - Interrupt request (IRQ) - Interrupt handlers • Program that services the interrupt • Also known as an interrupt routine or device driver (generally part of the OS) - Context (Context Switch) • Saved registers of a program before control is transferred to the interrupt handler

• Allows program to resume exactly where it left off when control returns to interrupted program

Servicing the Interrupt: 1. Lower priority interrupts are held until higher priority interrupts are complete 2. Suspend program in progress 3. Save context, including last instruction executed and data values in registers, in the stack area in memory 4. Branch to interrupt handler program 5. Restore the context of program it was working on and resume execution

Direct Memory Access: - Without DMA • Every word travels over system bus twice: first to CPU, then again to its destination - With DMA • Transfers data directly from memory to its destination

- Interrupt driven I/O and programmed I/O require active CPU intervention • Transfer rate is limited • CPU is tied up - DMA(Direct Memory Access) is the answer! • Transferring large blocks of data • Direct transfer to and from memory • CPU not actively involved in transfer itself - DMA controller takes over from CPU for I/O

DMA Operation: - DMA controller: a specialized controller that transfers data between an I/O device and memory independent of CPU • An additional module on the system bus - CPU tells DMA controller: • Read/Write • Device address • Starting address of memory block for data • Amount of data to be transferred - CPU carries on with other work - DMA controller deals with transfer - DMA controller sends interrupt when finished

Lecture 8,9: Software - Operating System What is an Operating System? - A program that acts as an intermediary between a user of a computer and the computer hardware - “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program - Operating system goals: • Execute user programs and make solving user problems easier • Make the computer system convenient to use • Use the computer hardware in an efficient manner

The Role of OS: - Bridging the hardware/application Gap - Resource Coordinator: • Manages all resources • Settles conflicting requests for resources • Prevent improper use of resources - Facilitator (“useful” abstractions): • Provides facilities/services that everyone needs • Standard Libraries • Make application programming easier, faster

Operating System Components: - The Memory Resident component • Always loaded in memory • Commonly called the kernel • Contains essential services required by other parts of the operating system and applications • Typically responsible for managing memory, processes and tasks, and secondary storage - The Memory Non-resident component • Infrequently used programs • Software tools • Terminal Commands - Bootstrap program

Types of Operating Systems:

Process (CPU) Management: - Process is a basic unit of work in the OS • A program being executed - Multiprogramming/Multitasking: executing many processes concurrently - How to achieve multitasking? • Keep the process information: Context • Choose the process to run in a fair and efficient way: Scheduling algorithm • Allocate CPU to a process: Dispatching

Achieving Multitasking: - I/O Break • While one program is waiting for I/O to take place, another program is using the CPU to execute instructions - Time-slicing • The CPU may be switched rapidly back and forth between different programs

- Scheduler / Dispatcher • Activated by I/O operation or real time clock interrupt • Select next process to run • Allocate CPU to the selected process

Process: - Process: A program together with all the resources that are associated with it as it is executed • PID (process ID): a unique identifier for each processProcess context • All relevant register data including the program counter • Allows interruption and restart invisibly - Processes can be described as: • I/O-bound process – spends more time doing I/O than computations, many short CPU bursts • CPU-bound process – spends more time doing computations; few very long CPU bursts

Process States: - As a process executes, it changes state: • new: The process is being created • running: Instructions are being executed • waiting: The process is waiting for some event to occur • ready: The process is waiting to be assigned to a processor • terminated: The process has finished execution - Example: • Dispatching - Move from ready state to running state • Wake-up - Move from blocked state to ready state

• Time-out - Move from running state to ready state • Process completion - Move from running state to terminated state

Process Queues: Processes migrate among the various queues: - Job queue – set of all processes in the system - Ready queue – set of all processes residing in main memory, ready and waiting to execute - Device queues – set of processes waiting for an I/O device

Scheduling Algorithms: - Three process selection policy: - First-Come, First-Served (FCFS) scheduling - Priority scheduling - Round-Robin (RR) Scheduling

First-Come, First-Served (FCFS) Scheduling:

Priority Scheduling: • Job with the highest priority is s...


Similar Free PDFs