1/211
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
TOPIC 1: COMPUTATIONAL THINKING
TOPIC 1: COMPUTATIONAL THINKING
Computational Thinking
Process used to solve complex problems. It means formulating a problem and expressing it's solution in such a way that a computer can carry it out
Abstraction
Identifying the key parts of the problem and removing any unnecessary detail so it becomes easier to solve
Decomposition
Breaking down a complex problem into smaller, more manageable parts which are easier to solve.
What are subroutines?
Subroutines are small blocks of code in a modular program designed to perform a particular task
Decomposition creates subroutines. List some advantages of these.
-Makes debugging and maintaining the program easier
-Subroutines can be tested seperately and shown to be correct
-A particular subroutine can be called several times in the program
What are flowcharts?
A usefool tool that can be used to develop solutions to a problem. They graphically represent steps in a problem
What is pseudocode useful for?
Useful for developing an algorithm using programming-style constructs, but it is not an actual programming language
Why is pseudocode useful?
The programmer can concentrate on figuring out how to solve the problem without worrying about the details of how to write each statement in the programming language they will use
Define algorithm
A sequence of steps that can be followed in order to complete a task
Explain the difference between an algorithm and a computer program.
A computer program is one way of implementing an algorithm in a particular language (like python) but the algorithm is the series of instruction and it's order
What is a trace table used for?
Show how the values of variables change during the execution of the program. As each line of code is executed, the current value of any variable that is changed is written in the appropriate column on the table
What is a syntax error and what does it do?
A syntax error will prevent your program from running. It is typically caused by a mistake in the spelling or 'grammar' of the code.
What is a logic error and what does it do?
A logic error may crash your program or produce an unexpected/incorrect output. Logic errors occur due to things such as < or > symbols, or brackets, which could affect loop conditions or range checks.
What is a runtime error and what does it do?
A runtime error is one which will be detected when the program is run. It may be caused by a logic error, erroneous user input or by the program not allowing for a condition such as a user inputting 0 or entering no data at all. Division by 0 may also cause it.
Name 2 search algorithms
Binary and Linear search
What does a binary search do?
Can be used to search a list in numerical or alphabetical order. It works by repeatedly dividing in half the portion of the list that could contain the required data item
What does a linear search do?
In a linear search, the item will be checked one by one in the list. This is very slow for large lists but necessary if the list is not sorted.
Linear Search VS Binary Search
Linear:
- Inefficient but easy to implement
Binary:
-Very efficient and fast, but harder to implement and only works on sorted lists
How does a bubble sort work?
It works by repeatedly going through the list to be sorted and swapping adjacent elements if they are in the wrong order
How does a merge sort work?
In the first stage, the list is succesively divided in half until each sublist is the length of one. In the second stage each pair of sublists is repeatedly merged to produce new sublists until one, final sorted list is produced.
Bubble sort VS Merge sort
Merge sort: More complex, recursive algorithm (it uses a subroutine that calls itself). Many times faster for large data sets.
Bubble sort: Iterative algorithm, meaning it uses WHILE and/or FOR loops, repeating the same step many times
How is efficiency of an algorithm calculated?
The efficiency of an algorithm can be measured by the time it takes to execute , or the amount of memory required for a given dataset.
QUESTION: What are the benefits of using decomposition and abstraction?
Decomposition breaks down a complex problem into subproblems, which are much easier to solve, easier to understand and can also be examined in more detail. Therefore, if a problem is not decomposed it is much harder to solve.
Abstraction filters out unecessary information. Abstraction allows programmers to create a general idea of what the problem is and how to solve it. The process instructs them to remove all specific detail and any patterns that will not help find a solution. An idea of the problem can then be formed. This idea is known as a 'model'
TOPIC 2: DATA
TOPIC 2: DATA
A computer is made up of...
Billons of switches, each with an off or on state.
What is binary?
This is how the on/off is represented. off is 0 and on is 1.
Why is binary important?
It is the only language computers can understand, so everything must be converted into binary before being fed into a computer.
There are two types of binary shift. Logical and arithmetic. What does a logical shift do?
A logical shift moves all the bits in a given binary number either to the left or to the right by a given number of places. All the empty spaces are then filled with zeroes.
What does an arithmetic shift do?
Left arithmetic shift is the same as a left logical shift.
With a right arithmetic shift of one place, each bit moves right. The rightmost bit is discarded and the leftmost bit is filled with the previous value.
Why are hexadecimals used?
- Easier to read
- Easier to remember
- Take up less data
When are they used?
- Colour values
- MAC addresses
- memory address locations
What is meant by character encoding?
Each character on a keyboard has a binary code which is transmitted to the computer each time a key is pressed
What is a pixel?
Short for a picture element, the smallest identifiable area of an image
If you have 16 colours in an image, what is your bit depth?
4
As the number of bits per pixel increases, so does.....
The quality of the image
What increases with picture quality?
File size (significantly)
How do you calculate image file size in bits?
height x width x bit depth
Density of pixels in an area is called....
Resolution
Analogue sound must be....
Digitally recorded in binary
What is sample rate?
The number of audio samples captured every second
What is sample resolution
The accuracy to which the height is recorded
Sample rate is measured in........
Hertz (Hz)
How does compression software work?
It uses algorithms to remove repeated or unnecessary Data.
What affect does compression have?
It reduces the file size, saving space and also saving time for downloadable videos or images. However there is of course a loss of quality.
Pros and cons of Lossy and Lossless
Lossy: Reduces internet traffic and file size, but detail is permanently lost
Lossless: Original quality is preserved and no data is lost, but there is a less significant reduction in file size
TOPIC 3: COMPUTERS
TOPIC 3: COMPUTERS
What is the purpose of the CPU?
To continously fetch, read and execute instructions stored in memory
What does the CPU contain?
ALU, CU, registers
Every operation carried out within the FEC is regulated by a 'tick' or cycle of the CPU _________
Clock
Function of ALU
- Carries out mathematical and logical operations inlcuding AND, OR and NOT as binary shifts
- It compares values held in registers
Function of CU
- Coordinates all of the CPU's actions in the fetch decode execute cycle (coordinates all CPU's operations)
- Sends and recieves control signals to fetch and write data
Function of Clock
The clock synchronises related components by generating pulses at a constant rate
Function of Registers
- Very small, very fast memory locations
- Each has a very specific purpose
Function of the buses
- Wires used to transfer data and instructions from one component to another
Address Bus
- Unidirectional
- Carries the addresses which data needs to be written or read from
Data Bus
- Bidirectional
- Carries the actual data or instructions
Control Bus
- Bidirectional
- Carries command and control signals telling components when they should be recieving reads or writes
The REGISTERS:
MDR: Holds data or an instruction which is waiting to be written to memory
Accumulator: Where all the results of ALU operations are stored
PC: Register which holds the memory address of the next instruction to be executed
MAR: Holds the address of the current instruction or piece of data to be fetched or stored
What does the Von Neumann architecture consist of?
- CU
- ALU
- Memory unit (normally RAM)
- Inputs and outputs
What is a computer?
- An electronic device which; Takes an input, processes data and delivers an output
The fetch, decode, execute cycle in detail
Fetch: The program counter holds the address of the next instruction to be executed, this address is used by the MAR to fetch the instruction from the RAM (main memory) and bring it into the CPU. The address in the PC is incremented to point at the next instruction
Decode: The CU decodes the instruction to see what has to be done
Execute; Now we know what to do we execute the instruction. What we do depends on the instruction (Could be asked to fetch data, write data into RAM etc.)
Main memory is directly accesible by the CPU: True/False
True
What is primary storage
The immediate memory that the processor has access to
What is RAM required for?
To temporarily store the programs, instructions and data the computer needs whilst it is in operation
RAM vs ROM
RAM:
- Computer's temporary working memory
- It is volatile which means it gets wiped as soon as the power is switched off
ROM:
- Stores instructions and data that never need to be changed (such as computer start up)
- It is Non-Volatile
What is an embedded system?
- A system used to control the function of simple electronic devices such as those commonly found at home
- Very specific
What is secondary storage?
Where the programs, operating system and data are held when they are not in use
Secondary Storage is storage excluding RAM and ROM. What does it include and why do we need it?
- Includes magnetic storage, SSD storage and Optical too
- We need secondary storage for longer term storage of files and data because it is non volatile
- They are portable and have large capacities
Compare the three main secondary storage devices with their advantages and disadvantages;
next
Optical
Capacity - From 650mb to 50gb
Speed - 50mb/s
Portability - Highly portable and lightweight
Durability - Susceptible to scratches and degrades in sunlight
Cost - Very Cheap
Magnetic
Capacity - Up to 16TB
Speed - Up to 200mb/s
Portability - Not so portable, size of large smartphone
Durability - Can be affected by magnetic fields, heat, but also bumps and movement
Cost - More expensive
Solid State
Capacity - Up to 4TB, Max 256GB for USB
Speed - Up to 3.5gb/s
Portability - Highly portable
Durability - Extremely durable
Cost - Expensive
Explain how magnetic storage works
1. Read/write head moves into position across the concentric tracks which hold the data (this takes time)
2. The drive spindle rotates the disk, and the disk contains magnetised (1) and unmagnetised iron particles (0)
3. To write data, the head magnetises or demagnetises the iron particles
4. To read data, the head makes a note whether the particle is magnetised or unmagnetised, and translates this into binary which the computer can use
Explain how optical storage works
1. A disk contains pits and lands which are stored in the long spiral tracks on a disk
2. The optical drive uses a laser to reflect light off the surface of the disk
3. When the laser beam hits the curved start or end of a pit, the light is refracted and a 1 is recorded. Where the light is reflected from the flat bottom of a pit, or from an area with no pit (a land), a 0 is recorded
Explain how SSD storage works
1. SSD's work by forcing electrons into floating gates between two oxide layers
2. This changes the charge of the floating gate which can be measured as a 0 or a 1
Apllications of storage:
SSD - Require little power and generate little heat. This makes them suitable for devices used on the go (laptops, tablets). The lack of moving parts also means they are small and very reliable, so used in phones and cameras. Also used in large computers and in mass storage facilities as they can be 100 times faster and do not require expensive coding equipment
HDD - Common in desktop computers as they are cheap for storage and portability does not really matter
Optical - Useful for archiving data in the short to medium term (10 to 25 years)
What is an embedded system?
A computer system with a dedicated function within a larger mechanical system. Typical properties are amll size, low power use, low cost and rugged operating ranges.
What are system software programs?
Programs that are needed to enable the computer to function, such as the OS, utilities, library routines and programming language translators
What is the OS?
The OS is a group of programs that is essential for managing the computers resources.It provides the interface between the user and the hardware
What are the 4 major functions of an OS:
- Process management
- Peripheral management and drivers
- File management
- User management
Explain the function of user management
- Different users are provided with their own username and password (Allows different users to use same computer)
- The OS controls different levels of access and permission depending on their needs and levels of security
- The OS retains settings for each user, such as icons or backgrounds
- The OS also monitors login and log out activity
Explain the function of file management
- The OS allows users to create, delete, move and copy files
- It can search for files, restore deleted files, frees up space for new ones and prevents conflicts when two users attempt to modify the same file at once
- Access rights will also be managed
- The OS presents a logical structure of files and folders, which makes it easier for the user to keep track of them
Explain the function of peripheral management and drivers
- Peripheral devices are devices connected externally such as printers and monitors
- The OS communicates with these peripherals, and messages such as "out of paper" or "out of ink" must come via the OS
Explain the function of process management
- The OS coordinates the CPU to schedule processes
- All current processes in memory are held in a circular que, and the CPU allocates a time slice to these processes
- Processes with higher priority are given longer time slices (known as multitasking), and each process has exclusive use of the CPU during its allocated time slice
- Several time slices may be required to complete a process, so an unfinished process must await its next turn at the back of the que
Explain the function of authentication
- Many systems require some form of authentication before allowing you into it
- Most common way of authenticating is a username and password, however they can be hacked
- A more modern approach is biometrics (fingerprints, face ID, voice patterns)
- These sorts of patterns are completely unique to the person so they are a very secure way of authenticating an individual
What is utility software?
Software that is used in conjuction with the OS in order to manage extra features/functions. NOT ESSENTIAL, but make specific tasks easier and add a layer of housekeeping
List the 4 commmon examples of utility software:
- Defragmentation software
- Data compression software
- File repair software
- Anti Malware software
How does defragmentation software work?
- Files are stored on the hard disk in blocks
- As different files are added and deleted over time, gaps appear which may not fit all of the next file to be stored, and files therefore become fragmented
- The software defragments this all, which reduces file retrieval and storage times
How does data compression software work?
- An algorithm is used to resave the data in an existing file using less space
- Sometimes data is lost (lossy) or all data is kept (lossless)
How does file repair software work?
- The data making up the file can become corrupted if the disk develops a fault or a computer crashes during writing
- Your computer scans itself looking for corrupted or damaged files and then attempts to repair them
How does anti malware software work?
- Malware is software written with the specific intention of causing a nuisance or harm to programs and data
- Anti malware software finds patterns of known malicious code in files, and quarantines those files for deletion
Define robust software
The ability for an algorithm/program to continue to operate despite abnormalities in input, calculations etc.
Why does software need to be written as robustly as possible?
In order to reduce the threat posed by misuse, malware, hackers and other attacks
What are some important robust software design considerations?
Anticipating misuse: A programmer should never underestimate the level of creativeness, laziness or malice of users of a new system. Every possible input should be anticipated
Authentication: When validation or verification cannot resolve the issue, help messages and careful instructions should be used. Methods of authentication include a simple user ID and password, a PIN number or biometric methods such as fingerprint or face ID
What are audit trails and why are they useful?
- An audit trail provides a list of changes that have been made to software, by whom and on what date
- They are sorted into chronological order so changes can be traced back to their orginal form, to better understand any bugs or security flaws that reveal themselves for patching
What are code reviews and why are they useful?
- Code reviews involve checking your own program code with a colleague or partner to find errors that may have been left in
Peer code reviews:
- Find vulnerabilities that were not picked up in testing
- Streamline software development
- Improve the efficiency of the code
- Improve programmers skill levels by identifying poor practice
What are the features of a high level language:
- Syntax and structure similar to english
- Designed to be understood by humans
- High level languages must be compiled or interpreted into machine code before it can be run
- Less memeory efficient and can be slower to execute if not optimised
What are the features of a low level language (assembly language):
- Typically used to control specific hardware components
- Executes faster and occupies less space in memory than the machine code produced from a compiled program
- Allows programmers to express programs using simple commands
- These languages were closely mapped to machine architecture
- Extremely efficient, but requires a great deal of intellectual effort as it is hard to understand and write
There are two main translators:
Compiler + Interpreter