Hardware is the term used for any physical compnent of the computer.
For example,
the case
the mouse
the keyboard
the RAM
CPU
Graphics Card
Motherboard
The rule of thumb is, if you can touch it, it is hardware.
Software is the programs that run on the computer, they are code and cannot be touched physically like hardware.
There are 2 types of software, application software and system software.
There are many components that make up a computer system, but for the purpose of this GCSE, you need to understand a few in depth.
These are:
CPU
Main Memory
Secondary Storage
Buses
Diagram showing the main components of a CPU.
CPU stands for Central Processing Unit and as the name suggests, it is the unit at the center of all processing carried out by the computer. The best way to consider the CPU is like the brain of the computer.
The CPU is made up of 4 main components:
The Arithmetic Logic Unit (ALU) - This is responsible for all calculations regarding arithmetic (maths) and Logic (decisions).
The Control Unit (CU) - This is responsible for ensuring the CPU performs its tasks with the correct timing and works with the system clock to ensure this is inline with the rest of the computer.
Registers - The registers are very small, very fast spaces of memory that allow the CPU to store the instruction it is currently working on, a bit like when our brains are holding what we are currently thinking about.
Cache - Cache (pronounced "cash"), is another very small, very fast space of memory (they are bigger and slower than registers but smaller and faster than main memory) that are used to store the frequently used instructions,a bit like when our brains might store the information of something we do every day like our home address or phone number.
There are 3 factors that affect the performance of the CPU:
The number of cores - The more cores a CPU has the more "brains" are working at the same time, this reduces the amount of time it takes to complete a task.
The clock speed - The faster the clock speed, the faster the cores are able to think and this reduces the amount of time it takes to complete a task.
The cache size - The more fast memory there is, the more instructions the CPU can store close by and this reduces the amount of time it takes to complete a task.
There are 4 types of main memory in a computer system:
RAM
ROM
Cache
Registers
Cache and Registers both exist on the CPU and we have discussed them above as part of the CPU so we will focus on RAM and ROM in this section.
RAM is Random Access Memory, which, as the name suggests, is a type of memory that the CPU can access randomly (any space on the RAM can be accessed at any time). It stores the data and instructions of currently running software.
RAM is typically medium capacity (16GB to 128GB) and is considered relatively fast memory, cache and registers are both faster but secondary storage is slower.
RAM is an example of volatile memory which means that when the computer is switched off, the contents of the RAM is wiped (as nothing is currently running anymore).
ROM is Read Only Memory, which, as the name suggests, is a type of memory the CPU can access only to read the contents, it cannot change the contents of ROM. It stores the boot up instructions and BIOS (Basic Input Output System) for the computer. Without these, the computer wouldn't be able to start, which is why we do not want the CPU to be able to change it.
ROM is typically low capacity (4MB to 8MB) and is much slower than RAM but still faster than secondary storage.
ROM is an example of non-volatile memory which means that when the computer is switched off, it keeps its contents (as the computer wouldn't be able to start again if it was wiped).
ABOVE: Diagram showing the inner workings of a Magnetic Hard Disk Drive (HDD)
BELOW: Diagram showing the theoretical layout of a Solid State Drive (SSD)
All of the storage types we have explored so far are relatively small, very fast and store data and instructions for the running of the computer and software.
Secondary storage, on the other hand is used to store our files like our pictures and homework. Secondary storage is non-volatile as you wouldn't want your pictures or homework wiped when you turn the computer off.
There are 3 types of secondary storage you need to know:
Magnetic
Solid State
Cloud
Magnetic storage is Hard Disk Drives (HDDs). These work by having a stack of metal disks that have a magnetic coating that spin under a read/write head (each disk has its own read/write head) that changes the magnetic polarity of the coating to North or South and this is used to denote a 1 or 0.
Pros and Cons of HDDs:
+ Cheap
+ Large capacity (500GB - 12TB+)
+ faster than older methods of storage
– Lots of moving parts - reduces durability
– Affected by magnets - a powerful enough magnet can destroy the data stored on the disk
– Not very portable (especially when powered on, any sudden movement can cause data corruption)
solid state drives (SSDs) use electrical circuits to persistently store data by passing an electrical current through the drive which foces the elctrons through a barrier, if they get trapped in the barrier, it is a 0, if they make it to the other side it is a 1.
Pros and Cons of SSDs:
+ Near silent operation
+ No moving parts - very durable and portable
+ Very Fast
– Expensive
– Similar capacity to HDDs
– Can get very hot under load (thermal throttling) - requires cooling solution
cloud storage refers to saving data in an off-site storage system maintained by a third party, for example, Microsoft OneDrive or Google Drive.
Data is saved to servers at a remote location
These servers can use magnetic and/or solid-state storage
The data is accessed via the Internet
Data that is stored on cloud storage can be located anywhere in the world
Some providers may let the customer choose which country the data is stored in – this may help in meeting data protection requirements
Cloud storage may make multiple copies of the same data stored at different locations – this means that if one data centre had a fire the data could be accessed from somewhere else.
Pros and Cons of Cloud Storage:
+ Easy to use - apps for desktop and mobile devices to manage their data
+ Large storage capacity - easily increased by increasing subscription
+ Access data from anywhere with an Internet connection
+ Backups are carried out by the cloud provider so save the need for local backups
– The data cannot be accessed without an Internet connection
– User won’t be directly able to control the security of the data - trusting provider's security
– Uploading and downloading data could take a long time - depends on the bandwidth of the user’s connection
A bus is a collection of wires through which data/signals are transmitted from one component to another. All of the hardware we have discussed above are connected to eachother via buses on the motherboard.
There are 3 main types of bus in a computer system:
The address bus - carries the address of the instruction - one way (CPU to RAM)
The data bus - carries the data to and from the CPU and RAM (two way)
The control bus - carries the control signal around the entire computer (two way)
These 3 buses together form the system bus.
The CPU continually reads instructions stored in main memory and executes them as required.
The Fetch-Execute Cycle is made up of 3 stages:
Fetch: the next instruction is fetched to the CPU from main memory
Decode: the instruction is decoded to work out what it is
Execute: the instruction is executed (carried out). This may include reading/writing from/to main memory or performing an arithmetic or logical operation.
Embedded Systems are a system made up of a CPU, RAM and ROM but the system can only perform a single task.
Embedded systems perform a single task, like a washing machine, microwave or fridge freezer.
Their CPU is typically slow
Programs are stored on ROM
New programs can't be installed
They are typically very reliable - for example, a microwave should not have a bug that might make the defrost setting cook on full power.
Non-embedded systems can perform multiple tasks like a computer, laptop or tablet.
Their CPU is typically fast
Programs are stored on secondary storage
New programs can be installed
They can be unreliable - software may have bugs that cause unexpected behaviour.
As mentioned earlier, software is the code that runs on the computer. There are two types of software:
Application Software
System Software
Application software (also known as Apps) are software that provide users with additional functionality above what is offered by system software.
Examples include:
Web Browsers (safari, chrome, edge)
Word Processors (Microsoft Word, Google Docs)
Video Games
Spotify
Social Media (Instagram, Tik Tok, Snapchat, etc.)
System software is the software that provides a platform for other software to work.
Types of system software include:
Operating System (OS)
Utility Programs (anti-virus, disk defragmenter, etc.)
Operating systems (OS) manage computer hardware, users and the resources used by software
They are responsible for managing:
Processor(s) - The OS is responsible for deciding which program will run on the processor and how much time it will get to run.
Multitasking - Where an operating system manages many tasks happening at the same time and sends interupt signals if a task needs priority.
Memory - The operating system keeps a record of where each program and its data are located and will make sure not to overwrite existing programs and data.
Input/output (I/O) devices - The operating system must manage input/output devices by getting inputs from and sending outputs to peripheral devices like mice, keyboards, printers, displays, digital cameras, etc. It does this thropugh device specific drivers.
Applications:
The operating system (OS) provides graphical user interface (GUI) features such as windows, minimise, maximise, resize,
When an application is opened the OS will copy the program into RAM and allocate an area of RAM for the program to use
When an application is closed the operating system will make sure that it is removed from RAM
The operating system may also be responsible for installing and updating applications
Security - The operating system is responsible for keeping the computer system and operating system, application programs and user data secure.
Users - The operating system is responsible for user logins and passwords and keeps the system secure by providing each user with their own access rights.
Operating systems come bundled with additional utility programs which helps to keep
them working well. Utility programs provide extra functionality and perform housekeeping tasks that keep computers running efficiently.
They are often packaged as part of the operating system but some utility programs, such as anti-virus software, are bought as stand-alone software programs.
Examples of utility programs:
Encryption software - used to encode text so that it cannot be understood without knowing the key to decode it.
Defragmentation software - When you save a large file it may not fit on the disk in consecutive memory locations, the file is referred to as ‘fragmented’. Defragmenting the hard disk reorganises files so they are stored together which makes read times much faster and free space is also in one place so new files do not need to be fragmented.
Data compression - This reduces the amount of storage data requires, this means that less space is needed on a disk, if sending the files, it reduces the amount of data that is sent. Compression may allow attachments to be sent via email that would otherwise have been larger than a file-size limit and more data can be stored on backup media if it is compressed.
Disk clean-up tools - Removes unneccessary or unused files to free up space on the drive.
Disk formatters - Allows drives to be cleared and have their storage methods changed to allow them, to work with different OS's.
Anti-virus software - protects the operating system from viruses by scanning files and folders for malicious code.
High-level languages are written in a more human-friendly format that is easier to read and understand and resembles English.
Python, C, Java, C++, PHP are all examples of high-level languages.
Many high-level languages have been especially designed to make it as easy as possible to write programs to solve certain types of problem.
These languages must be translated into machine code in order to run.
A single statement usually translates into several machine code instructions.
A program written in a high-level language such as Python, can be run on different types of processor with very few changes, if any, to the program statements. - This is known as machine independence.
Advantages of High-level Languges:
+ A high-level language is easier to learn.
+ Programs can be written faster in a high-level language.
+ It is easier to understand and debug a high-level language.
There are 2 low-level languages you need to know.
Machine code:
the lowest form of language. Every instruction is written in binary.
Each instruction completes one very small task.
Writing programs in machine code is difficult and time consuming and you are likely to make mistakes.
Assembly Language:
a low-level language that uses acronyms for machine code instructions.
Each assembly language instruction maps directly to a machine code instruction.
Assembly language has to be translated into machine code before it can be executed.
Assembly language is typically only used for software used in embedded systems, such as a washing machine or microwave oven or the software used to control specific hardware components such as device drivers.
Assembly language allows the programmer to precisely control any instruction on the processor. This means that programs can be made to be very efficient. For instance, when a graphics device driver is programmed to run quickly and make use of all the advanced features
Processors can still only execute instructions in machine code and the machine code instructions will be specific to a particular processor or family of processors.
Advantages of Low-level Languages:
+ A program written in a low-level language can run very quickly.
+ The code will usually require less RAM.
+ Statements in a low-level language can be used to control and manipulate specific hardware components.
As mentioned above, both high-level languages and Assembly Language must be transalted into Machine Code to be able to run.
To do this, there are 3 types of translator:
Assembler: Used to translate assembly language into machine code. LDR R1 #20 ➡️01101 001 10100
Compiler: Used to translate a high-level language into machine code. This translator translates the entire program into machine code in one go so if the code changes it will need to be re-compiled.
Interpreter: Used to translate a high-level language into machine code but does not produce the object code (saved machine code). This translator translates one line of the program at a time as it is being run, so if the code changes it will start again from the beginning next time it is run.
Think of your classroom and your teacher, if your teacher only speaks French and the class speaks English, there are 2 ways the lesson could be delivered.
The teacher writes down everything they want to say in French, ahead of time, and gives it to someone who speaks French and English and they write it out in English to give to the class. - Compiler
The teacher stands at the front and talks in French and there is someone there who speaks French and English and they say what they have said in French, in English so the class understands. - Interpreter
In scenario 1, the person who speaks both languages has translated the whole thing in one go. In scenario 2, they have translated it 1 line at a time as the teacher is saying it and nothing is written down by the translator.
The image above is the AND Gate.
AND has the Symbol: .
AND logic requires both inputs to be True (1) for the output to be True (1).
Below is the Truth table for AND logic:
The image above is the OR Gate.
OR has the Symbol: +
OR logic requires one or the other or both inputs to be True (1) for the output to be True (1).
Below is the Truth table for OR logic:
The image above is the NOT Gate.
NOT has the Symbol: ¯
NOT logic inverts the input to be True (1) if it is False (0) or False (0) if its True (1).
Below is the Truth table for NOT logic:
The image above is the XOR Gate.
XOR has the Symbol: ⊕
XOR logic requires one or the other but not both inputs to be True (1) for the output to be True (1).
Below is the Truth table for XOR logic:
it is possible to combine the above gates together to form logic circuits that allow us to do more complex logic.
For example, below is a logic circuit for a security door where the door (D) will open if the user has the key (K) or their security card (S) but not if there is someone stood on the pressure pad (P)
This Circuit can be expressed as D = (K OR S) AND (NOT P) or by using the symbols stated above, it is more accurately:
The truth table for this circuit is:
When dealing with logic expressions, we are given the expression and need to get back to the circuit and truth table.
Lets look at the following expression:
Q = A.B⊕C
now, knowing that the . is an AND and the ⊕ is XOR we already know what gates are involved in the circuit. So the circuit will look like this:
From this we can calculate the table. Columns need to be A, B, C and Q then we need a column for the result of (A AND B) and then the Q column will show that result XORed with C. like this: