Introduction to Computer Systems: Hardware, Software, and Networking, Study notes of Computer science

A comprehensive introduction to computer systems, covering essential hardware components, software concepts, and networking principles. It explains the functions of the cpu, memory, and storage devices, explores different types of software, and delves into network topologies, protocols, and security measures. Suitable for beginners seeking a foundational understanding of computer systems.

Typology: Study notes

2024/2025

Uploaded on 02/27/2025

sana-42
sana-42 🇬🇧

2 documents

1 / 30

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1.1.1 Architecture of the CPU
The purpose of the CPU - The Fetch – execute cycle.
What is a computer?
A computer is defined as an electronic device that takes an input, processes data and
delivers output.
To process data a computer follows a set of instructions known as a computer
program.
If we take the lid off a typical desktop computer, we can identify two critical components:
The memory that stores the program
The Central Processing Unit or Processor which carries out the instructions.
A computer carries out its function by fetching instructions, decoding them and then
executing them in a continuous and repetitive cycle billions of times a second.
Fetch Stage:
The address of the instruction that needs to be processed next is copied from the
Program Counter (PC) to the Memory Address Register (MAR).
The PC is incremented to point to the next instruction that will be needed when the
cycle starts again.
The instruction stored at the location held by the MAR is copied to the MDR.
Decode Stage:
The Control Unit decodes the instructions and sends control signals to the component
within or outside the CPU that needs to act.
Execute Stage:
The operation indicated by the instruction is performed by the appropriate component
e.g.
- ALU performs calculations given by CU
- The value stored by PC or MAR might be changed
On a modern CPU this fetch - execute cycle occurs billions of times per second.
Clock Speed:
3Ghz processor = 3 billion cycles per second.
Von Neumann Architecture- Registers
Tiny, super-fast pieces of onboard memory inside the CPU.
Each has a very specific purpose.
Program Counter (PC): holds the address of the next instruction to be executed in
memory.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e

Partial preview of the text

Download Introduction to Computer Systems: Hardware, Software, and Networking and more Study notes Computer science in PDF only on Docsity!

1.1.1 Architecture of the CPU

The purpose of the CPU - The Fetch – execute cycle. What is a computer?  A computer is defined as an electronic device that takes an input, processes data and delivers output.  To process data a computer follows a set of instructions known as a computer program. If we take the lid off a typical desktop computer, we can identify two critical components:  The memory that stores the program  The Central Processing Unit or Processor which carries out the instructions. A computer carries out its function by fetching instructions, decoding them and then executing them in a continuous and repetitive cycle billions of times a second. Fetch Stage:  The address of the instruction that needs to be processed next is copied from the Program Counter (PC) to the Memory Address Register (MAR).  The PC is incremented to point to the next instruction that will be needed when the cycle starts again.  The instruction stored at the location held by the MAR is copied to the MDR. Decode Stage:  The Control Unit decodes the instructions and sends control signals to the component within or outside the CPU that needs to act. Execute Stage:  The operation indicated by the instruction is performed by the appropriate component e.g.

  • ALU performs calculations given by CU
  • The value stored by PC or MAR might be changed On a modern CPU this fetch - execute cycle occurs billions of times per second. Clock Speed:  3Ghz processor = 3 billion cycles per second. Von Neumann Architecture- Registers Tiny, super-fast pieces of onboard memory inside the CPU. Each has a very specific purpose.  Program Counter (PC): holds the address of the next instruction to be executed in memory.

 Memory Address Register (MAR): holds the address of the current instruction that is to be fetched from memory.  Memory Data Register (MDR): holds the data fetched from, or to be written to memory.  Accumulator: holds the results of calculations Common CPU components and their functions- ALU (Arithmetic Logic Unit)  Responsible for carrying out:

  • Arithmetic calculations (+, -)
  • Comparisons such as whether numbers are equals
  • BOOLEAN operations (e.g. AND, OR, NOT) CU (Control Unit)  Manages the fetching, decoding and execution of program instructions.  It controls the flow of data inside the CPU (to registers, ALU, Cache) and outside the CPU (to main memory and input/output devices) Cache  Very fast memory in the CPU. It’s slower than the registers but faster than RAM.  Stores regularly used data so that the CPU can access it quickly the next time it’ needed.  Cache have very low capacity and are expensive compared to RAM and secondary storage.  L1 is quickest but has the lowest capacity. L2 is slower than L1 but can hold more. L is slower than L2 but can hold more. 1.1.2 CPU performance CPU performance – How common characteristics of CPU’s affect their performance. Clock speed: Measured in Hertz (Hz)  Number if instructions a single process core can carry out per second (Hz).  3.2 GHz clock speed = 3.2 billion instructions can be fetched per second!  The higher the clock speed, the greater the number of instructions that can be carried out per second. Cache size:  Placing frequently used data in the cache results in everything using that function being executed much faster.  A larger CPU cache gives the CPU faster access to ore date it needs to process.  It is much quicker getting items from the cache than from the main memory (RAM).

The difference between RAM and ROM RAM - temporary deletes if you turn it off.  RAM (random Access Memory) is used as the main memory in a computer.  RAM is volatile memory meaning that it is temporary memory. So, it requires power to retain its data.  Very slow access times compared to primary storage.  The main memory is where all data files, and programmes are stored while they are being used.  When a computer boots up the operating system is copied from secondary storage to RAM.  RAM is slower than the CPU cache but way faster than secondary storage. ROM - permanent even of you turn it off.  ROM is non-volatile memory meaning that it is permanent memory so even though it may have no power it keeps its contents.  It contains all the instructions a computer needs to properly boot up. These introductions are called the BIOS (Basic Input Output Systems).  As soon as the computer is powered on, the CPU reads instructions from ROM. This tells the CPU to perform self-checks and set up the computer e.g. test the memory is working okay, see what hardware is present and copy the operating system into RAM.  ROM is considered read only.  Very fast access times compared to secondary storage. The need for virtual memory  Computers have a limited amount of RAM. As applications are opened, RAM fills with data.  When RAM is full, the computer needs somewhere else to put application data. It moves data that has not been used recently to a location on secondary storage known as virtual memory.  Virtual memory may be needed if there are too many applications opened at once, or if a particularly memory intensive application is being used.  If the CPU needs to read data stored in virtual memory it must move the data back to RAM. This is slow as data transfer rates are much slower on secondary storage than RAM.  Using virtual memory can make computer slower to respond when switching between applications or when using a memory intensive application. 1.2.2 Secondary storage The need for secondary storage  Secondary storage is the memory in which the computer can store the data or instructions which are not in currently in use.

 The main types are Hard Disk Drive (HDD), Solid State Drive (SSD), Compact Disc (CD) and Flash (USB drive).  Secondary storage is needed because ROM is read only, and RAM is volatile.  Secondary storage is needed for:

  • storage of programmes and data when the power is turned off.
  • semi-permeant storage of data that can change.
  • back of data files.
  • archive of data files. Common types of storage Optical  Optical discs are things like CD’s, DVD’s and Blue Ray discs.  Optical discs come in three forms:
  • read only
  • write once
  • rewritable  Advantages:
  • cheap
  • thin and light weight,
  • portable
  • they won’t be damaged by water or shocks.  Disadvantages:
  • low capacity compared to other types of storage.
  • slow access times
  • prone to scratches Magnetic  Magnetic storage is used for archives.  Advantages:
  • cheap
  • large capacity
  • quick to access data  Disadvantages:
  • slow access times
  • fragile – has moving parts, which eventually fail.
  • hard disks perform better if they are defragmented. Solid state  Solid state drives are storage devices with no moving parts. SSD’s are used for the same purpose as HDD’s – for internal/external storage.  Advantages:
  • significantly faster read/write times than HDS’s.
  • durable

 As computers only understand 1s and 0s, all data must be converted into binary to be processed.  Binary can be used to represent all numbers in our standard number system. Data capacity and calculations of data capacity requirements  Text files size = bits per character times (x) number of characters.  Sound file size = sample rate times (x) duration times (x) bit depth.  Image file size = colour depth times (x) image hight (x) image width. 1.2.4 Data storage Numbers How to convert positive denary whole numbers to binary numbers and vice versa  Counting in binary is a bit like counting in denary.  In our standard number system, we have 10 different digits (0,1,2,3,4,5,6,7,8,9). This is called denary, decimal or based 10.  Binary only uses two different digits (0 and 1) we call this base 2.  Counting in binary is similar to counting in denary, but the place values from right to left increase by powers to two (e.g. 8, 4, 2, 1), instead of powers of 10 (e.g. 1000, 100, 10, 1).  The following table shows the binary equivalents of the denary numbers 0 to 15: 0 = 0 4 = 100 8 = 1000 12 = 1100 1 = 1 5 = 101 9 = 1001 13 = 1101 2 = 10 6 = 110 10 = 1010 14 = 1110 3 = 11 7 = 111 11 = 1011 15 = 1111  Binary numbers are easier to convert using tables.  Example – covert the 8-bit denary number 0011, 0101 to a denary number. 128 64 32 16 8 4 2 1 (x2) 0 0 1 1 0 1 0 1 32 + 16 + 4 + 1 = 53 so 0011, 0101 is 53 in denary. Convert denary to binary by subtracting.  Example – convert the denary number 79 into 8-bit binary number. 128 64 32 16 8 4 2 1 (x2) 0 1 0 0 1 1 1 1 So, 79 converted into an 8-bit binary number is 01001111. How to add two binary integers together (up to and including 8 bits) and explain overflow errors which may occur.  So, you can add binary numbers using column addition.  As binary only uses 1’s and 0’s we can comfortably do:

0 + 0 = 0, 1 + 0 = 1 and 0 + 1 = 1.  Using binary, we cannot write 1 + 1 = 2 instead we have to write 1 + 1 = 10.  Example:

  1. add the following 8-bit binary number together. 10001101 and 01001000. 1 0 0 0 1 1 0 1
  • 0 1 0 0 1 0 0 0

1 1 0 1 0 1 01 

 2. add the two 8-bit binary numbers below. 0 0 1 1 0 0 1 1

  • 0 1 1 1 1 0 0 1

1 0 1 0 1 1 0 0 

Overflow errors occur when a number has too many bits.  Sometimes during binary arithmetic, you will get a result that requires more bits that the CPU is expecting-this is called overflow.  For example, in binary the 8-bit calculation 1111 1111 + 0000 0001 gives the 9-bit answer 1 0000 0000. Computers will see the 1 as an overflow error and just put output 0000 0000, which is nonsense.  Computers usually deal with these extra bits by storing them elsewhere.  Overflow flags are used to show that an overflow error has occurred.  Example:

  1. Add the 8-bit binary numbers below, giving your answer as an 8-bit binary number. 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 0 1 b) Identify any problems that could be caused by giving your answer as an 8-bit number There is an overflow error which can lead to a loss of data and a loss of accuracy in your answer. It could also cause software to crash if it doesn’t have a way of dealing with the extra bit. How to convert positive denary whole numbers into 2-digit hexadecimal numbers and vice versa  Hexadecimals (or base-16) uses sixteen different digits.  A single hex character can represent any denary number from 0-15. To represent 0-15 in binary would require 4 bits (a nibble), so each hex character equates to a nibble in binary.

 Convert Binary to Hex by splitting it into nibbles.  Each hex character is equal to a nibble in binary, so it is possible to convert from binary to hex by splitting the binary code into 4-bit-chunks.  Binary to hex conversions can be much easier than converting from binary to denary, you only have to deal with the nibbles one at a time.  Example: Convert the binary number 1011 1001 to a hexadecimal 8 4 2 1 8 4 2 1 1 0 1 1 1 0 0 1 8+2+1=11 = B 8+1= The binary number 1011 1001 is B9 in hexadecimal.  Example: Convert the binary number 11 1110 to hexadecimal. Top tip: Add zeros to the front of the binary number, so that you can split it into nibbles. 0011 1110 8 4 2 1 8 4 2 1 0 0 1 1 1 1 1 0 2+1=3 8+4+2=14 = E The binary number 11 1110 is 3E in hexadecimal  For Hex to Binary, use each Characters Denary value  Example: Convert the hexadecimal number 8C to binary. 8 4 2 1 1 0 0 0 8 = 8 in denary 8= 1000 in binary 8 4 2 1 1 1 0 0 C = 12 in denary 12 = 1100 in binary The hexadecimal number 8C is 1000 1100 in binary Binary Shifts:  Binary shifts can be used to multiply or divide by 2.  A binary shift (also knowns as a logical shift) moves every bit in a binary number left or right a certain number of places.  Gaps at the beginning or end of the number are filled with 0s.

 The direction of the binary shift indicates whether it multiplies or divides the binary number: Left shifts multiply a binary number. For every place shifted left, the number is doubled. Right shifts divide a binary number. For every place shifted right, the number is halved.  If a number is shifted 3 places right, it would be halved 3 times right and if a number were shifted 4 times left, it would be doubled 4 times.  Left shifts can cause overflows and right shifts cause bits to drop off at the end. Bits dropping off or overflowing can lead to a loss of accuracy/data.  Example: Perform a 3 place left shift on the 8-bit binary number 0010 1001 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 These bits have overflowed. The number has been doubled 3 times, so it has been multiplied by 2 to the power of 3 Which = 8  Example Perform a 2-place right shift on the binary number 0011 1100 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 A 2-place right shift gives the binary number 0000 1111.As this is a 2 place shift, the original number will have been halved twice. Characters The use of binary codes to represent characters: The term ‘character set’ The relationship between the number of bits per character in a character set and the number of characters which can be represented. ASCII

  • lossless files can be decompressed – turned back to the original.
  • lossless compression can be used on text and software files. with lossy compression maybe 5 MB.  Example: Phil has just heard a new band on the radio. He wants to download 50 of their songs from the internet and store them on his smartphone to take on holiday. State which type of compression would be most appropriate in this situation and explain why.
  • Lossy compression would be the most appropriate.
  • Lossy file - are smaller so they take up less band width – meaning Phil could download the songs more quickly.
  • there smaller file size would also allow him to store them all on his smartphone without taking up too much storage space. 1.3.1 Networks and Topologies Types of networks: Advantages of Networking:  Users can share files.  Users can share peripherals: printers and connections to other networks, e.g. The Internet.  Users can access their files from any computer on the network.  Servers can control security, software updates and backup of data.  Communication with other people, e.g. email and social networking. A LAN is a Local Area Network  A LAN covers a small geographical area located on a single site.  All the hardware for a LAN is owned by the organisation that uses it.  LANs are either wired (e.g. with Ethernet cables) or wireless (e.g. using WI-FI)  You’ll often find LANs in businesses, schools and universities.  Lots of homes have a LAN to connect various devices, such as PCs, tablets, smart TVs and printers. Why use a LAN?  Sharing files is easier – network users can access the same files, work collaboratively on them (at the same time) and copy files between machines.  You can share the same hardware (like printers) on a LAN.  The Internet Connection can be shared between every device connected to the LAN.  You can install and update software on all computers at once, rather than one-by-one.  You can communicate with LAN users cheaply and easily, e.g. with instant messaging.

 User accounts can be stored centrally, so users can log in from any devices on the network. A WAN is a Wide Area Network  A WAN covers a large geographical area connecting LANs together.  A WAN connects LANs that are in different geographical locations. For example, a business with offices in three different countries would need a WAN for all their devices to connect.  Unlike a LAN, organisations hire infrastructure (e.g communication lines) from telecommunications companies, who own and manage the WAN. This is because a WAN is much more expensive to set up than a LAN.  WANs may be connected using fibre or copper telephone lines, satellite links or radio links.  The Internet is of course the biggest WAN. Disadvantages of Networking:  Increased security risks to data.  Malware and viruses spread very easily between computers.  If a server fails, the computers connected to it may not work.  The computer many run more slowly if there is a lot of data travelling on the network. Factors that affect the performance of networks: Bandwidth  The amount of data that can be sent and received successfully in a given time. The greater the bandwidth, the better the network can perform.  This is not a measure of how fast data travels, but how much data can be sent on the transmission media.  Measured in bits per second, often called a bit rate. The number of users  Too many users or devices on the same network can cause the network to slow down if there is insufficient bandwidth for the data.  You can limit the bandwidth available to individual users to address this. Transmission media  Wired connections are generally faster and more reliable than wireless.  Fibre optic cables can give much better performance that copper cables. The error rate  Less reliable connections increase the number of errors that occur when data is transferred.  This means the data has to be resent until it arrives correctly.

access levels)  Servers are very reliable and are always on.  The server may become overloaded if too many clients are accessing it at once. Peer-to-Peer networks don’t use servers.  In Peer-to-Peer networks all devices are equal, connecting directly to each other without a server.  You store files on individual devices and share them with others.  You may use a P2P network at home to share files between devices, or connect devices to a printer.  Each peer is responsible for its own security.  Each peer is responsible for its own backup.  Peers usually have their own printers.  You can send print jobs to another peer to process, but that peer would need to be switched on to be able to communicate with the connected printer. Pros Cons  Easy to maintain – you don’t need any expertise or expensive hardware.  No dependence on server – if one device fails the whole network isn’t lost  Specialist staff are not required.  Cheaper to set up.  No expensive hardware required.  No centralised management – devices need their updates and security installed individually. Backups are also more complicated.  Copying files between devices creates duplicate files – it's easy to lose track of what’s stored where and which files are up to date.  Peer machines are less reliable, and data may be lost if one fails.  Machines are prone to slow down when other devices access them. The hardware needed to connect stand-alone computers into a Local Area Network: Wireless access points:  Allows wireless enabled devices to connect to a network without cables.  More convenient.  They have less bandwidth than a wired connection.  Security is more of a concern with wireless connections.  Connection is sometimes not as strong or reliable as wired connections. Routers:  Sends data between networks.  It creates a WAN from a number of LANs.  You cannot connect to a WAN without using a router.  A router uses an IP address (Internet Protocol) to route traffic.

Switches:  Sends data between computers on a LAN.  They segment the network by forwarding traffic to the correct location.  Switches learn which devices are connected and understand how to forward traffic in an intelligent way. NIC (Network Interface Controller / Card)  Every computer connecting to a network will need one of these.  These days they are not physically separate cards, they are integrated.  They use a protocol (a set of rules) to determine how the connections should work.  They allow a device to connect to either a wired or wireless network. Transmission Media: Copper Cables (UTP)  Wired connections assure maximum bandwidth, security and reliability.  With twisted pair cables the wires are twisted around each other to reduce interference.  Normally a set of wires for transmission and receiving.  The grade of copper and insulating material affects the quality of the overall cable and therefore the bandwidth. Fibre Optic Cables  Uses light to transmit data.  Cover much longer distances and greater bandwidth copper.  The backbone of the Internet uses fibre optic cables. The Internet as a worldwide collection of computer networks:  The Internet is a Worldwide collection of networks.  Most well-known Wide Area Network (WAN)  A collection of interconnected networks spanning the world  The World Wide Web (WWW) is a collection of websites that are hosted on web servers and access through the http protocol. DNS (Domain Name Server)  A Domain Name Server (DNS) is used to translate website domain names into IP addresses – this means you don’t need to remember IP addresses to access websites – you can use domain names instead. These services use a network of Domain Name Services which store IP addresses and matching domain names.  1. The URL is received by a DNS resolver server.  2. The server then queries a DNS root name server.  3.The root server responds with the address of the top-level domain server for. com.

 1.URL request by browser made from user e.g. www.bbc.co.uk  2.The browser sends the domain name to a Domain Name Server (DNS)  3.The DNS maps the domain name to an IP address and returns it to the browser.  4.GET request for the webpage / resource is sent to the webserver using the IP address.  Requested webpage / resource is returned to the clients web browser. Star and Mesh topologies  Network topology: “ A given arrangement of all the elements that you need for networking” Star Topology  In a Star Topology all devices are connected to the centre.  In a star topology, all the devices are connected to a central switch or server that controls the network.  The switch is intelligent and makes sure traffic only goes where it is intended.  If a single cable breaks only that computer is affected.  The switch however is still a serious point of failure. Pros Cons  If a device fails or a cable is disconnected, the rest of the network is unaffected.  It’s simple to add more devices to the network.  Better performance than other setups – data goes straight to the central device so all devices can transmit data at once (unlike ring network) and there are very few data collisions (unlike data network)  In wired networks, every device needs a cable to connect to the central switch or server. This can be expensive, e.g. for an office building with 50 terminals.  If there is a problem with the switch or server then the whole network is affected. Mesh topology  In a Mesh topology all devices are connected to each other.  A mesh topology is a relatively new network layout. It is decentralised – networking devices are either directly or indirectly connected to every other one without the need for one central switch or server. Mesh networks work by sending data along the fastest route from one device to another. Pros Cons  There is no single point where the network can fail. If the  They were very expensive – you needed a lot of wire to

central switch or server of a star network fails then the whole network fails – in a mesh network, if one device fails then the data is sent along a different route to get to its route. connect so many devices together. But now more people are using wireless technology, mesh networks are a more practical option. Partial mesh topology:  Multiple routes exist between different devices.  However, every device is not connected to every single other device.  A compromise solution which lowers the amount of hardware needed compared to a full mesh network. 1.3.2 Wired and wireless networks, protocols and layers Modes of connection: Wired: Ethernet (Wired)  A standard for networking technologies  Used for communicating on a wired local area network.  Includes a number of associated protocols.  Provides reliable, error free, fast communication between two points.  Originally used in old style bus networks.  Still used today in more modern star and mesh networks  Data is transmitted in frames which includes: -Preamble of bits used to synchronise transmission. -Start frame deliminator to signify the start of the data part of the frame. -Source and destination MAC addresses. -The actual data -Error checking information  Users location is limited by the need for a physical cable connection  A set up relying on Ethernet relies on lots of cables, connections, ports and physical hardware which will affect cost. Wireless: Wi-fi  Users can move around freely  Easier to set up and less expensive