Please enable JavaScript.
Coggle requires JavaScript to display documents.
Computer Science, Key, All examples of algorithms, image - Coggle Diagram
Computer Science
Computational thinking
Decomposition
Subprograms
Breaking this into smaller chunks in a program
Algorithms
super specific
Flowcharts
decision point
starts and finish
input output
responses
selection
repetition
iteration
variables and constants
integer
numbers that are whole
float
numbers that aren't whole
string
text/words
boolean
true or false
global variables
across the whole program
local variable
in subprograms
constants
always stay the same
lists and arrays
list
can add and change in the program
starts from 0(index from 0)
e.g 0 1 2 3 4
array
data structure that can store multiple types of data
records
collection of data objects
items in it called field
Arithmetic and relational operators
Mathmatical operators
/ + - < > =
// is integer division, rounds down the division
always gives you an integer
%
gives you the remainder (decimal) of the calculation
given as integer, representing the decimal
==
Comparing 2 variables (NOT SETTING)
2 variables in calcuation e.g.
** is power of
!=
not equal to
oppostite of double equals
boolean (true or false)
Logical Operators
and, or, not,
Trace tables
a table that helps trace how algorithm works
tracks what the variables are changing to
columns for variables, inputs and outputs
errors
Syntax
problem in the program made by the programmer
e.g. missing bracket, no indentation
Runtime
When program is told do something impossible
e.g. 0/0 or find file that isn't there
Logic
Flaw in the design of program causing unexpected or incorrect result/output
Search
, trying to find a variable
Linear
Go one by one from start of list
slow, inefficient
Binary
Sort the List
Select the median
Compare it with the search item (what you are looking for)
If what you are looking for is smaller or bigger
Only search values below or above median
Repeat until it finds number
Fast and better
Sort
bubble sort
Starts with the first 2 elements
Checks if they are in the right order
Swap them if not
Compare the 2nd and 3rd item
Swap if not
6.Repeat until you reach end of list
Go back to start and repeat until you don't need to swap any numbers
Slow and inefficient
merge sort
divide and conquer
fast and efficient
Data
Binary
0101
Transistors
only have on and off (01)
Column
128-64-32-16-8-4-2-1
255 = 11111111
2s Complement
Write out
Write negative numbers in binary
12 = 01100
Flip/invert numbers
12 = 10011
Add 1
12= 10011
00001
1 infront represents negative
-12=10111
Denary is normal numbers (base 10) e.g. 1,2,3,4,5,6,7,8,9,10
Shifts
Logical Shift
Left
1.Move each binary digit 'n' positions left
Discard leftmost 'n' bits ( get rid of them)
Fill up empty spaces on the right with 0s
Multiplication
Right
1.Move each binary digit 'n' positions right
Discard rightmost 'n' bits ( get rid of them)
Fill up empty spaces on the left with 0s
Division
For multiplication or division
Arithmetic
Left (exact same logical)
Right
Instead of filling empty space with 0
replace with most significant bit (MSB)
Overflow
When there isn't enough bits to store number
Programs may crash or produce unreliable or incorrect results
EASY PEASY
Basically remove the overflowed number, completely free
Hexadecimal
1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
Computers
Stored Program Concept
Was brainchild of Alan Turing. Nerdy ah
Programmable Computers
(basically any modern device)
Computer Architecture
Refers to Structure of a computer (DUH)
Von Neumann architecture
CPU (central processing unit) obv
Processing unit to decode and execute program instructions fetched from 1 memory at a time
Basically: A processing unit is like the brain of a computer. Its job is to understand and carry out instructions from a program, one step at a time. It gets these instructions from the computer's memory.
Input:
Stuff that inputs duh, keyboard, mouse, etc. Peripherals!!!
Input data to program, fetch i think
Output
Output results of program, onto peripherals e.g. monitor, display etc
CPU
Buses
Control bus
carries signals between CPU and other parts of the computer
Sends stuff to other components
Address bus
Holds address of memory location that the CPU will read form or write to., The number of wires in the address bus (bandwidth) determines how much addressable memory there is
Basically, moves data from CPU to RAM, so free, definition is complete yap.
1 way. Only from CPU---->RAM
Data Bus
Sends program instructions from CPU to RAM and back
2 way. CPU----->RAM------>CPU
Clock
Synchronises the actions of the CPU
Control Unit
Fetches program instructions from main memory one at a time, decodes them and directs the operations of the other parts of the system to execute them
Basically performs the fetch-decode-execute cycle
Registers
Direct-access storage for instructions, intermediate results and data within the CPU. Some are general purpose. Others such as program counter and Instruction register have specific functions
Basically stores instructions within the CPU
Fetch Decode Execute Cycle
Fetch
CPU places the memory address of the next instruction on the address bus
Control Unit within CPU sends a read signal along the control bus to memory (RAM)
Content of the specified memory location is transferred along the data bus to the CPU. On arrival it is stored in one of the CPU's registers
The CPU gets the next instruction from memory.
Decode
Control Unit looks up the instruction in the CPU's instruction set. Every CPU as its own unique instruction set-a list of all the operations that it can carry out
Decode: The CPU understands what the instruction means.
Execute
Control Unit coordinates the actions of the other components of the CPU to carry out the operation. If an arithmetic or logic operation is required, the control unit signals that the ALU is to carry it out. Then starts the next cycle
Basically. The CPU performs the instruction.
Key
Known/Formal Definition
Unknown/Make different colour so it looks nicer
Topic
Simplified Definition
All examples of algorithms