Please enable JavaScript.
Coggle requires JavaScript to display documents.
computer science S1 review - Coggle Diagram
computer science S1 review
data representations
binary shift
after left shift: digit that exceeds the
most significant digit
results in overflow
shifts the binary digits left or right
left shift 1 digit: multiply binary number by 2
right shift 1 digit: divide binary number by 2
after right shift: digit that exceeds the
least significant digit
results in underflow
two's complement
using signed binary values to represent negative numbers
use the columns of
(-128,64,32,16,8,4,2,1)
number systems
binary or base-2 number system
all data need to be converted to
binary for computers
to understand
computer uses
logic gates
that only have
two states
only has two digits 1/0, each digit represent a different state of on or off
denary or base-10 number system
made up of 10 digits, from 1~9
used by humans to count, measure, calculate
hexadecimal
made up of 16 digits, from 1~9 & A~F
one hexadecimal digit stands for a binary nibble (4 digits)
uses fewer digits to represent a value
easier for human to read compared to binary
less prone to errors
uses
MAC address
consists of 12 hex-digits
the first 6 digits: organizationally unique identifier
the last 6 digits: control address, network interface controller specific
stands for media access control address
color codes
consists of 6 hex-digits
URL
character set
ASCII
uses 7 bits, which means maximum of 128 character represented
limited to English alphabet and numbers, not other languages or modern emoji's used in today's conversation
uses a lot less spaces than Unicode
Unicode
uses a minimum 16 bits, which means a minimum of 65000+ characters represented
represent all major languages and emojis in modern world
uses a lot more spaces than ASCII
set of characters that can be represented in a computer system
each character given a
unique binary code
set ordered logically
a
standard
for computers to communicate
storing sound
processes
sound wave begins as
analogue
analogue converted to a
digital form
for computers
computer measure the amplitude of the analogue sound wave, called
samples
each measurement generates a value, which is stored in binary
sound is stored in secondary storage, and can be played back by reversing the process
audio resolutions
sample rate
def: the amount of samples taken per second
measured in
hertz
, 1 hertz means 1 sample
the higher the sample rate, the higher the audio quality, the bigger the file size
sample resolution
def: number of bits stored per sample
the higher the sample resolution
the higher the audio quality
the bigger the file size
calculating size of sound file: sample rate x duration in
seconds
x sample resolution
storing image
image resolutions
resolution
def: total amount of pixels, calculated by height & width
the higher resolution
the more details in image
the higher the image quality
the more bits stored
the bigger the file size
color depth
def: number of bits used to store the color of each pixel
the higher color depth
the more details in image
the higher the image quality
the more bits stored
the bigger the file size
if color depth is 1, the image is black and white
calculating size of bitmap image: (resolution) or (image width x image height x color depth) x color depth
bitmap is made up of
pixels
pixel is the smallest element of a bitmap image
each pixel stored as
unique binary code
units of data
bit: 1 binary digit
nibble: 4 binary digits
byte: 8 binary digits
KB: 1024B
MB: 1024KB
GB: 1024MB
TB: 1024GB
conversion
bit->byte: x8
KB->MB->GB->TB: x1024
compression
impact
reduces size of file
less storage required; can store more files
shorter transmission time; quicker to share
lossy compression
benefits
reduces file size more than lossless compression
normally, the difference is unlikely to be noticed by humans
downsides
process is irreversible, cannot be returned to original state
data is lost
loses file quality
methods
group similar colors together
reduce the amount of colors
def: lost data to reduce file size
lossless compression
def: data is encoded, or converted to a different format to reduce the file size without losing data
benefits
process is reversible, can be returned to original state through
decompression process
no data lost, file quality preserved
downsides
reduces file size not as much as lossy compression
method: run length encoding
look for patterns and repetition
condenses identical elements to a single value with a count
automatically applied to document formates such as DOCX and PDF
data transmission
Packet Switching
data packets
def: small parts of data that make up a larger piece of data
broken down by transmission control protocol to be
easier and quicker transmitted or route over the internet
route means finding the most optimal path over a network
structure
header
source IP address
destination IP address
packet number
payload
actual data being transported
trailer
additional security information
notice computer for the end of packets
def: method of sending and receiving data
processes
data broken down into packets
packets assigned a header and packet number
each packet is sent over the internet through routers
routers control the routes taken for each packet
routers see packets and decide to send a packet down a different route to avoid data traffic
packets are
reordered correctly based on packet number
packets arrive in any order and are check for errors; if packets didn't reach destination or are corrupted, receiver sends a resend request
benefits
avoid interference or corruption, as individual packets can be resent
saves time and internet bandwidth, as the whole file doesn't need to be resent if corruption occurs
quicker than sending a large packet, as each packet finds its quickest route to destination
harder to hack every packet of the file
def: methods of transmitting data from one device to another using wire or wireless connection
transmission types
Serial
for example: USB
stream of bits sent in sequence, one after the other
advantages
reliable over long distacne
cheap
low interference
disadvantage
slow trasmission speed
Parallel
stream of bits is sent in a sequence, one after the other
across multiple wires at the same time
asynchronous
, data don't always arrive at the same time
skew
cause data to arrive out of order
for example: printer cable
advantage
fast transmission speed
transmit large amounts of data
disadvantages
only used on short distances
high interference
simplex
advantages
cheap
only one wire used
disadvantages
slow
expensive for bi-direction (only one direction)
data transmitted one bit at a time
half-duplex
advantages
cheaper for bidirectional
two directions
disadvantages
slow
one direction
at a time
full-duplex
disadvantages
expensive
advantages
fast
travel in both directions simultaneously
Hardware
Storage
Primary Storage
charcteristics?
relatively small capacity
directly accessed by the CPU
volatile, maintain its data only when computer is powered
access time faster than secondary, FDE time reduced
used short-term working memory
RAM
directly connected to CPU
holds data or instructions currently in use
fast read/write
Secondary Storage
characteristics
non-volatile, maintain its data after power-off
large capacity (larger than primary source)
used for long term storage currently
not in use
slower than primary source
magnetic
magnets to store 0s and 1s
made up of several metal discs with magnets called
platters
, which contains several tracks and sectors. spinned at high speed
iron particles magnetized to represent 0 or 1
R/W arm moves the head over the surface of disc using
electromagnets
high storage; low cost; moderate R/W access speed
can get damaged; can be heavy; prone to mechanical failure; loud
solid-state
electronic circuits store binary 0s and 1s
eg: solid state drives (SSD) & USB flash memory
use
NAND
and
NOR gates
to control flow of electrons
made up of tiny cells that contain bits of data
contains transistor that acts as a switch
control gate (control if current flows)
floating gate (control a charge)
store: high voltage applied to control gate (electrons pushed through oxide layer) onto the floating gate
remove data: high voltage charge opposite direction, pulling electrons off floating gate
high storage; fast W/R speed; no moving parts; silent
high cost; limited R/W cycles
optical
use lasers to burn the surface of a disk
create pits and lands to store 0s and 1s (permanently)
shining a laser at disk and processing the reflection
arm moves laser across the surface of disk to read data
land to pit: laser scatters
captured by sensor
low cost; silent
low capacity; low RW speed; can be damaged
Virtual Memory
extension of primary storage located on secondary storagr
when
RAM full,
VM used to let computers remain operational
programs & data not used transferred to virtual memory
program & data back to RAM when needed
slower than RAM, negatively impact experience
Cloud Storage
long-term secondary storage of data
remote servers, using HDD & SSD
accessed through a wide area network
access data everywhere; high security; endless storage space with cost; use less local space; allows collaboration; with
back-up data
on multiple servers
costly (monthly plan); no access without internet; employees work more
ROM
smaller capacity than RAM
read only primary storage that holds the first instructions a computer needs to
start up
small memory chip located on computers motherboard
fast but slower than RAM
non-volatile (x primary storage)
Von Neumann Architecture (design for CPU)
input & output
input
hardware components that allows the user to interact with computer system by inputting data or commands to the system
barcode scanner
digital camera
optical mouse
QR code scanner
touch screen
infra-red: detect interrupted infrared laser beam
resistive: detect by pressing a flexible layer
capacitive: detect changes in electrical charges on screen
three-dimensional 3D printer
output
hardware components that receive information from a computer system and present it to the user
control unit (CU)
coordinates how data moves around the CPU by sending signals
decodes the instructions
fetched from memory
Arithmetic logic unit (ALU)
performs arithmetic operations & logical decisions
registers
small and extremely fast memory
hold small amounts of data temporarily needed in FDE cycle
Program counter PC
hold the memory address of the
next instruction
increments by 1 as the FDE cycle runs
Memory Address Register MAR
holds the memory address of where data & instructions are to fetch from memory
Memory Data Register MDR
stores the data or instruction which has been fetched
Accumulator ACC
stores the results of results of ALU
Current instruction register CIR
stores the instruction the CPU is currently decoding
buses
set of parallel wires which data/signals are transmitted
address bus
unidirectional
carries addresses
data bus
bidirectional
carries data or instructions
control bus
bidirectional
carries commands and control signals form control unit CU to tell components when they should receive reads or writes
sensors
monitor: track the state of a system
control: control the system base on inputs
Central Processing Unit (CPU) also called microprocessor
purpose:
to fetch, decode, and execute instructions
or input, process, and output
it's an integrated circuit on a single chip
FDE process
Fetch
program counter holds the address of the next instruction
address of the next instruction or data is copied into memory address register MAR
address of the data or instruction is sent along the address bus and awaits a signal from the control bus
signal sent along the control bus is sent from the control unit to the main memory
data or instruction received from main memory is fetched to the memory data register MDR through the data bus
a copy of the instruction or data is stored to the current instruction register (CIR)
program counter increments by 1 for next instruction to be executed
Decode
CPU works out what the instruction is and what it needs to do
opcode: what instruction?
operand: what to do?
Execute
perform a calculation
store a result or data back in main memory (RAM)
go to main memory to fetch another data
instruction or data is always fetched from the memory, gets decoded then executed
performance characteristics
clock speed
measures the number of FDE cycles in 1 second, measured in Hertz
cache size
cache is small and fast memory next to CPU
quick access to a
copy of frequently used instruction and data
bigger cache size, fewer fetch cycles, quicker than fetching from memory
number of cores
multiple cores means many units that
FDE the same time
, each core execute a separate instruction independently
multi-core processors run powerful programs easier
dual core: two cores; quad core: four cores
instruction set: all commands that can be processed by CPU
each command has a binary code or machine code
binary code made up of opcode (the operation) & operand (the location for operation to be performed)