















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Comp sci notes for IB CS (2024 examination)
Typology: Study notes
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















C O M P U T E R A R C H I T E C T U R E
Abstraction and the elements of a computer system Get to know these Terms: -Hardware -Software -Human resource | People who take care of the system/who keep it running -Network -Peripheral
The central processing unit Abstraction is the understandability of program or architecture to a person.
Application Programming languages Libraries Operating systems
Architecture Components Integrated circuits Logic gates
Transistors
High Abstract
Low Abstract
Level1 : Transistors , Tiny circuits which help regulating voltage.
Level2 : Logic gates , Transistors are typically combined n groups of 3 or 2 into small circuits called logic gates
Level3 : Fundamental operations , Individual logic gates are then combined into larger, combined cir- cuits that do more complicated things.
Level4 : Processing unit, Logic gates and fundamental units are cleverly combined into units.
ALU = Performs arithmetic processes where as a CU provides instruction to the ALU
Software Layer
Hardware Layer
Level5 : Machine/assembly language , type of low level programming language that is indented and are designed to be readable by humans.
Level6 ( or higher ) : Higher level programming languages, even more readable to humans like python.
Programs and Softwares
The address of the next instruction is copied onto the MAR from PC, the data is fetched using the address from the MAR and sent to the MDR. The instruction is stored in the MDR which is then copied into the CIR. The instructions are then sent to the CU which makes changes to the ALU. The ALU then executes the instruction and stores them in the Accumulator if needed. The accumulator stores the result of the executed instructions.
Working with Binary and Hexadecimal
Provides user interface Does memory management Keeps in track of secondary storage Manages peripherals Allows multi-tasking Provides security features
Key roles of an OS
Binary to Decibel Decibel to Binary Binary to hexadecimal Hexadecimal to Binary Negative decibel to binary integer fractional to Binary Negative integer fractional to Binary
Converting
Predicted vocabulary Consistent grammar Consistent syntax
High level programming languages: Lets human read, write. Softwares which makes sense to humans. Different kind of look different t each other but have all these in common
Goal is to make sure every computer program has an unambiguous meaning. These programs are not for computer processers it needs to be translated to a series of insrtuctions this is where compliers help. It is a special piece of software which converts written code to computer language.
Applications
The operating system
Spreadsheets Presentation software Database management Web browsers Computer aided designs ( CAD ) Page design Graphic processing software Communication software
Binary to Decibel
Now I will take the ones to be HIGH 0s to be LOW, I will take the powers of 2s in the ones place and add them all together. 2, 4, 8, 16, 32 1, 0, 1, 1, 0 = 2+8+ = 26 is the Decibel
Our question is -57. We take positive 57 and lets draw 8 dashes 57 _ _ _ _ _ _ _ _ -- They all go by 128, 64, 32, 16, 8, 4, 2, 1 now we put one in places which will eventually add up to 57 at the end, Basically just finding the Binary for positive -57. We get a binary of 0 0 1 1 1 0 0 1. Now we flip this to --> 1 1 0 0 0 1 1 0, now you just add an one So -57 is equal to 1 1 0 0 0 1 1 1 as Binary.
let us take another example because this is a little tricky :)
65 _ _ _ _ _ _ _ _ 128, 64, 32, 16, 8, 4, 2, 1 we get the binary of 65 to be : 0 1 0 0 0 0 0 1 We flip it to : 1 0 1 1 1 1 1 0 We add one so it becomes : 1 0 1 1 1 1 1 1 -65 is equal to 1 0 1 1 1 1 1 1
Great job! you did it right.
Incase I want to convert " 10110 " to Decibel then I write down the powers of 2
Decibel to Binary
Pretty easy and straight forward,! Divide your Decibel by half ( 2 ) and ignore the reminder. Example 13. 13/2 = 6 6/3 = 3 3/2 = 1
1, 3, 6, 13 --> is what we got, now write 1 for odd numbers and 0 for even numbers and we will get 1, 1, 0, 1
Negative Decibel to Binary ( 2s complement )
NAND gate / A.B
NOR gate / A+B
EX OR gate /(A.B) + (A.B) or A⊕B
Unicode
International encoding standard for use within different languages and scripts, by which each letter, digit, or symbol is assigned and scripts, by which each letter, digit, or symbol is assigned by which each letter, digit, or symbol is assigned an unique numeric value that applies across different platforms and programs written in 16 bits to represent.
Representing colors in computers
RGB, Red, green, blue are the only colors used, the system decides how bright the colors are, they display the brightness of each pixel in different strengths to make new colors, to show in the monitor
Legacy system : Old technology, application ..etc Example: Floppy disks, Parellel printer cables.
Merger : Combination of two entities or more, especially companies into one example: Vodafone and Mannesmann
Local software vs remote software
Carry burden of security, availability and performance No technical knowledge needed.
Minimization of IT responsibility and cost Reduction in staff workload Employee mobility
Security Government regulation Customization Availability Usability Data corruption
You can either buy or rent a program in a particular device [ local ]
or you can buy rent/use software that is installed on the PC somewhere on the network [ Cloud/Remote ]
SaaS ( Software as a Service ) Third party provider host application on the network
Benefits:
Drawbacks:
Implementation of software/ installment of software ways
Direct change over/plunge : Old system is topped new system is started immediately. Advantage: Minimal time and effort Dis-Advantage: If new fails, there is no fall back
Parellel running : New system has started but the old system is kept running along side. Advantage: if new system fails there is always a back up Dis-advantage: Not cost efficient.
Pilot running : The new system is piloted with a small subsect of organization. The organization tests it, once its running, it is fully implemented.
Phased conversion : The new system is introduced gradually by replacing bits and pieces one by one. Advantage: Allows people to get used to the software. Disadvantage: If new fails there is no fall back.
Data migration = Moving data
Incompatible file formats Data structure difference Validation rules Incomplete data transfer International conventions
Problems which may occur
Testing
Security Functionality Test management Performance Compatibility
Implicit, proof reading, check resource code or syntax Reviews, walkthrough Involves verification
Runs code Can begin before or after completion Involves validation
Individual parts will be tested
Performed by employees/devs Usually takes up to months
Performed by clients or end users Usually takes a few weeks
Functionality testing Treats software with no prior knowledge about internals.
Structured User manufacture knowledge Uses Manufacture knowledge
Many things must be tested.
Static testing:
Dynamic testing:
Dry run: Using pen and paper by the programmer " mentally runs " the algorithm
Unity testing:
Alpha testing:
Beta testing:
Black box testing:
White box testing:
Release management
Continuous delivery --> Short cycle Agile software development --> Evolutionary development Devops --> High speed delivery with high quality software dev ad IT operation teams
Common terms
Hardware: Physical components. Internal hardware : Mother board External hardware : Monitor
Peripherals: Anything external that provides input and output can do both I/O
Software: Computer program or set of instructions stored as binary
Client: Device which interacts with a software or Server.
Server: " Computer " Which, provides, processes and stores data.
Thick client: Functions without a server example laptops with windows.
Thin client: Anything which depends on servers example Google, Discord.
Dumb terminal: No processes on going locally, servers as input output device to an attached powerful computer/server. Example monitor or mouse
Client server model
Router: Hardware which connects two or more subnetworks, servers 2 purposes. Forwarding data packets to intended IP, allowing multiple devices use same.
Servers can provide resources and service to one or more clients. Server can either accept/deny request
DNS
Domain name server, memoizable names for websites on the network
How does DNS work
STEP1- Send request to resolve a domain name example google.com STEP2- Searches locally in cache STEP3- Contacts ISP or resolver if it does not have the Cache for it then STEP4- Contact root domain, connects ISP to Top level domain server for .com STEP5- Connects you to the right Authoritive name server like the route STEP5- Connected to the authoritive name server which will then have the IP for what you are currently searching for.
LAN : Local area network, Covers small geographical area like home, office or a building, it is made for computers which are physically present and close to each other. LANs are commonly used in homes and businesses to enable communication and resource sharing between devices, such as computers, printers, and servers. They can also be used for gaming and media streaming, among other applications.
WAN : Wide Area network, Covers a wide area like a country, The internet is also a WAN, WAN connects multiple LAN's to make a bigger and wider network, used by Government organizations, companies etc. WANs can be established using a variety of technologies, including leased lines, satellite links, and the internet. VPNs (Virtual Private Networks) are a popular way of securely connecting remote locations to a central network over the internet.
VLAN : Virtual Local area network, It is a way to create multiple logic networks in one physical network For example, a company might create separate VLANs for different departments such as finance, marketing, and IT. Each VLAN would act as a separate network, even though they are all physically connected to the same network switch. Devices connected to one VLAN would not be able to communicate with devices on another VLAN without going through a router or a layer 3 switch. This type of segmentation provides several benefits, including improved security, better network performance, and simplified network management. By separating traffic into different VLANs, administrators can more easily control who has access to specific resources on the network, reduce network congestion, and simplify network troubleshooting.
PAN : Personal area network, network used to connect electronic devices within a relatively small area, typically within reach of an individual person. PANs are designed for personal use and often involve wireless communication technologies such as Bluetooth. PANs are useful for tasks such as transferring files between devices, streaming audio and video content, and sharing an internet connection. They can also be used for home automation tasks such as controlling lights, thermostats, and security systems.
WLAN : Wireless Local Area Network, which is a type of computer network that uses wireless communication technologies, such as Wi-Fi, to connect devices within a limited area such as a building, campus, or home. A WLAN allows devices such as smartphones, laptops, and tablets to connect to the network without the need for physical cables. The network access points or routers transmit and receive data to and from the devices using radio waves. Devices that connect to a WLAN must be equipped with a wireless network adapter that is compatible with the wireless network technology used by the WLAN.
SAN : Storage area network, specialized network that connects servers and storage devices in a way that allows the servers to access storage resources as if they were local. In simple terms, imagine you have several computers in your office, and you want to store a large amount of data that all the computers need to access. You could store the data on a hard drive connected to each computer, but this can be inefficient and hard to manage. Alternatively, you could create a SAN, which is a dedicated network that connects the computers to a centralized storage system. This enables all the computers to access the storage resources quickly and efficiently, without the need for each computer to have its own local storage.
N E T W O R K S
Types of Networks
P2P : Peer to peer, Network architecture that allows computers and other devices to communicate and share resources directly with each other, without the need for a central server. In a P2P network, each device on the network acts as both a client and a server. This means that devices can request resources from other devices on the network, and also share their own resources with other devices on the network. P2P networks are commonly used for file sharing, where users can share files directly with each other without relying on a central server. P2P networks can also be used for other applications, such as video conferencing, online gaming, and distributed computing.
Extranet : An extranet is a private network that is extended beyond an organization's internal network to provide secure and controlled access to external users, such as customers, partners, and suppliers. It is a type of network that allows authorized external users to access specific resources, services, and information that are relevant to their needs. Extranets typically use the internet as the underlying communication medium, but they are designed to provide secure access to internal resources and information by using security measures such as firewalls, access controls, and encryption. Extranets can be used for a variety of purposes, such as sharing product information with suppliers, collaborating on projects with partners, and providing customer support services to clients. They can also be used for e-commerce applications, such as online ordering and payment processing.
Protocols
data integrity - protocols can help ensure that the data received by the receiving computer is complete. flow control - protocols can help make sure data is received in the correct order deadlock - protocols can help ensure that a network doesn't get "stuck" waiting for data congestion - protocols can help make sure that networks don't get too full, which can lead to deadlock above. error checking - this is similar to 'data integrity'; protocols can create systems to make sure that data doesn't have any errors.
A protocol is an agreed-upon system for exchanging information. Most protocols are standards, but some protocols are not because they are proprietary - for example, the way that messages are sent using discord may not be standardized, it may be secret to discord, but it is still a protocol.
Ethernet
A computer decides to send some information to another computer over the network It adds a header to the data it wants to send that contains the MAC address of the destination computer It then checks to see if the "cable" is available. if it is, it will take over the cable to send the message. This means that every computer connected to that cable can actually see the data! The protocol states that only the computer whose MAC address is on the header will listen, but that's just an agreement. IF the "cable" is currently being used, then it will wait a programmed amount of time (that is partially random) to try again - this is to reduce congestion and avoid deadlock.
This protocol allows computers that are connected over a LAN to communicate with each other. The basic process is this:
a.
Ethernet works really well with a small number of computers, or a large number of computers that aren't using the network a lot. As congestion increases, it becomes important to break an ethernet network into smaller pieces and connect them using hardware such as switches or routers.
UDP The user datagram protocol is a different protocol for sending and receiving and assembling packets. In this protocol, the sending computer will put a packet number and a final number on the packet, but they never resend and do not expect responses. This results in a system that is more efficient, but it is possible that packets are never received. A time- sensitive application like video streaming would likely use UDP, since missed and re-sent packets would arrive too late to be useful.
Packet switching
Data from a sending computer is broken into small pieces Each packet is stamped with the address of the receiving computer and a packet number Each packet is sent through the internet and might take a different path to get there The receiving computer reassembles in the order defined by the packet numbers
TCP and IP together define the protocols that create packet switching. Packet switching works like this:
TCP/IP UDP/IP
When you combine TCP and IP together, you get a combination protocol often simply referred to as "TCP/IP", which is considered the foundational protocol combination of the modern internet. Of course, some of it uses UDP instead, but you rarely see the phrase "UDP/IP". These protocols work together to label packets with an address and port (IP), a packet count and number (TCP/UDP), and set up a system of rules that govern routing (IP) and packet receipt confirmation (TCP); everything the internet is is built on those ideas.
DNS protocol
The DNS protocol, or domain name server protocol, defines the system by which computers can convert human-readable names like "google.com" to actual IP address, like 142.251.128.78. This is done through a combination of local files and information hosted by special servers on the internet called DNS servers.
DNS protocol The hyper-text transfer protocol defines the system for sending information that is associated with the World-Wide Web. It was designed for communication between web servers and browsers, but is a pretty flexible protocol that can be used to send all kinds of information. The basic structure involves a client, usually a web browser, sending requests called GET requests to get information from a local server such as web pages, pictures, files, etc. The server sends each of those elements to the browser independently, which then combines them together.
OSI layer
In computer networking, there is a very popular model for the various layers of abstraction in how information is shared over networks. This model is called the OSI Model for Network Layers and it basically looks like this:
PLEASE DO NOT TOUCH SARA'S
PET ALLIGATOR
-A little neumonic :)