0% found this document useful (0 votes)
8 views

ZNOTES CS

The document covers fundamental concepts of information representation, including data representation in binary and character encoding standards like ASCII and Unicode. It also discusses multimedia elements such as bitmap and vector graphics, sound data conversion, and compression techniques. Additionally, it explores networking concepts, including LAN and WAN, client-server vs. peer-to-peer models, and the infrastructure of cloud computing and the World Wide Web.

Uploaded by

NotFeris Xd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
8 views

ZNOTES CS

The document covers fundamental concepts of information representation, including data representation in binary and character encoding standards like ASCII and Unicode. It also discusses multimedia elements such as bitmap and vector graphics, sound data conversion, and compression techniques. Additionally, it explores networking concepts, including LAN and WAN, client-server vs. peer-to-peer models, and the infrastructure of cloud computing and the World Wide Web.

Uploaded by

NotFeris Xd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 26
CAIE AS LEVEL ee Soe as er 1. Information Representation 1.1. Data Representation +The two fundamental characteristics of any number system are + Abase: The number of diferent cigits that a system can use to represent numbers + Place value: The specificvalue of e digt based on its position within @ number + Denary - Base 10 ary Systems Base 2 ‘+ Possible bits (binary digits): 0 and 1 + All data and characters are represented in binary we) et) |) Gel 42d o o | 0 | 0 |o,ojolo ‘+ For example, 65 in binary is 01000001 «= Denary vs. Binary prefixes: Denary Prefix | Factor Value | Binary Prefix | Factor Value kallo-(&) x10 kibi- xi? mega-(M) x08 rmebi- (Mi) xg Bigs: (6) x10? gibi- (Gi) xp? tera x10! tebi-(T) x2 WWW.ZNOTES.ORG + Character Encoding Standards: ‘ASCII Extended ASCII Unicode ‘ASCIIS extension |Superset for ASCII & Only the English Also includes mast | extended ASCII- alphabet can be European recognized by represented languages’ various global alphabets languages th character Tehas an excellent ASCII extended to 8 bits, hence 256 possible characters encoding takes up 7 bits, hence 128 possible characters range of characters, using 2 or 4 bytes per character 2or 4times more Storage space per character Smaller storage space 1.2, Multimedia - Graphics, Sound map Images + Definition: Bitmap images are created by assigning a solid color to each pixel using bit patterns. + Encoding: ‘* Bit patterns are generated by considering each grid row as a series of binary color codes. corresponding to each pixels color. ‘+ These bit patterns are ‘mapped’ onto the main memory, + Pixels: The smallest picture element whose color can be accurately represented by binary code. + File Header: Bitmap images contain a file header with metadata, including image size, number of colors, et. + Image Resolution + Definition: the number of pixels that make up an image. Example: 4096x3192 pixels. + Effect: Higher resolution results in sharper, more detailed images. + Screen Resolution + Deffnition: The number of pixels that can be viewed horizontally and vertically on a device's screen. * Calculation: Number of pixels = width x height (eg. 1680 « 1080 pixels) thors areal ee oben Wesrineerbrstonal Sees On 31.25 ee Soe as er + Colour depth * Definition: The number of bits used to represent the colour ofa single pixel * Calculation: An image with n bits has 2” colours per pixel (eg, 8 16-color bitmap has 4 bits per pixel because 2416) + Effect:Increasing color depth improves color quality but also increases file size. + File Size Calcutation + File Size = Number of Pixels = Color Depth + Convert bits to bytes by dividing by eight if necessary, + Applications: Scanned images and general computer usage, where small file sizes and easy manipulation are beneficial Vector Graphics ‘+ Definition: Made up of drawing objects. + Drawing Objects: Mathematically defined constructs (eg., rectangles, lines, circles) ‘+ Drawing List:A set of commands defining the vector. + Properties: Basic geometric data that determine the shape and appearance of each object. + Encoding: Data is encoded using mathematical formulas to generate properties for drawing lines ‘and curves to create the image. ‘+ Scalability: Objects can be resized without losing quality, unlike bitmaps. ‘+ Applications: Company logos and other graphics that require scaling. WWW.ZNOTES.ORG + Sound + Analogue vs Digital: + Analogue data consists of continuous electrical signals. + Digital data consists of discrete electrical signals, + Sound Signals: Vibrations thraugh a medium, inherently analogue due to infinite detall + Conversion + Analogue signals are converted to digital signals, by sampling, + The sound wave's amplitude is sampled at set time intervals, ‘+ These samples are encoded as a binary number, sequence, providing a digital representation of the sound wave + Sampling Rate + Definition: Number of samples taken per unit of time. Effect: increasing the sampling rate improves the ‘accuracy of the digitized sound wave representation but increases file size. ‘+ Sampling Resolution ‘© Definition: Number of bits used to encode each sample. + Effect: increasing sampling resolution improves the accuracy of digitized sound waves but increases file + BitRate + Definition: Number of bits used to store 1 second of sound, + Calculation: Bit Rate = Sampling Rate * ‘Sampling Resolution + Length of Sound: Measured in seconds. 1.3. Compression + Definition: Compression is the process of reducing fle size without significant loss in quality, resulting in ‘+ Reduced time needed to search for data. + Faster transfer of compressed files, using less bandwidth than uncompressed files thors areal ee oben Wesrineerbrstonal Sees On 31.25 ee Soe as er + Lossless Compression ‘© Definition: A type of compression that allows original data to be perfectly reconstructed from a compressed file by utilizing some form of replacement. = Examples: Bitmap (.bmp), vector graphic (svg), png mages, text file compression, database records, ‘+ Run-Length Encoding (RLE): + Definition: A form of lossless compression used for compressing text files and bitmap images. + Mechanism: Reduces fie size by encoding sequences of adjacent, identical elements (characters in text files and pixels in bitmap images) into two values: run count and run value. ‘+ Example: RLE of a bitmap image. + Lossy Compression ‘© Definition: A type of compression that irreversibly eliminates unnecessary data. ‘Effect: File accuracy/quality is lower than with lossless compression, but fie siz is significantly reduced (often to about 10% of the lossless size) + Examples: Sound files (.mp3), jpeg images. = Mechanism in Sound Files: + Perceptual Coding: Removes parts of the sound. that are less audible or discernible to human hearing, as used in mp3 compression. 2. Communication 2.1. Networks, including the Internet LAN WAN ‘Anetwork that connects | Annetwork that connects devices within a small devices within a larger {geographical area, often within geographical area, such as a the same building. city, country, or globally. Only private ownership. Private or public ownership. “Transmission medium: Twisted Pair Cables , Coaxial Cables or Wi-Fi. ‘Transmission medium: PSTN or Satlink Higher data transferrate. Lower data transfer rate. Less congestion. Higher congestion WWW.ZNOTES.ORG + Networking devices: Interconnected devices that enable fast data transmission within a network. + Networking benefits: sharing: Easily share data between different interconnected devices. + Resource sharing: Use network-connected output devices like printers or share software within the network. + Higher storage: Files can be stored in network- connected storage mediums. + Client-Server Mode! + Server-based network: A dedicated server provides applications (administration of users, security, and resources) for the client computer to utliz. + Client-server Applications: ‘+ Printer: Manages print jobs from client ‘computers. ‘+ File Sharing: Clients access software and user data files stored on the server. + Proxy server. + Email server: For sending, receiving, and storing, emails, + Database server: Manages DBMS. + Domain controller server: ‘+ Manages user accounts (IDs & passwords) ‘© The client sends a login request to the server, which processes and grants the request if the user ID & password are recognized. Thin Clients ‘client that solely runs on the resources provided by the server and has no local age. Only provides input and receives output: processing is. done by the server. Thick Clients ‘An independent cient that does not require the server to Thick client processes most of the application locally ‘Smaller purchase cost expensive, demanding hardware is not required, Can function even if no server is connected (works offline). ‘Tmiproved security: Cannot run unauthorized, harmful Rane problems, No lag rel to network thors areal ee oben Wesrineerrstonal See On 31.25 ee oe eros o “+ Thin Clients vs. Thick Clients + Peer-to-Peer network model (P2P) + Definition: A decentralized network where each connected computer stores data and operates, independently as a ‘peer, acting as both a client and ‘+ Applications: Internet and Ad hoc networks, Client-Server Centralized backup, Peer-to-Peer Lesser initial setup cost. Lesser network traffic: Each peer can simultaneously receive data from different Files & resources centralized in server: Prevents illegal resource usage. Improved security: Fles are | Itcan work evenfa device stored ona central server, goes down, but the client- which would be regularly server model can't work ifthe scanned for malware server goes down, + Client-Server vs, Peer-to-Peer models ‘+ Network Topologies + Bus + Asingle line (bus) connects all devices with terminators at each end, + Other computers can read data being sent between any two computers. + Unsuitable for heavy traffic due to frequent callsions. + Star * Consists of a central server (switch) with all other computers connected via dedicated connections. ‘The server can send packets to different devices simultaneously and bidirectionally. + No collisions are possible. = Mesh + Every device (node) is directly interconnected with teach of the other devices (nodes). ‘+ Commonly used for wireless networks, such as the Internet, through the mesh connection of routers. + Hybrid ‘+ Acombination of two or more topologies. + Example: A connection between two or more LANs of different topologies. WWW.ZNOTES.ORG Benefits Drawbacks Less expensive and Doesn't perform well Copper easier to instal. Flexible. with small charges. Case |" tasertomate tected by cominstons.__|__deavomagnetom eae band improved sear sc| iowegnccasys_ | Need expeshe opt her opt| fat and ascgoal |" ansriers and boosthgarerequred: | "recehers Used in long-distance ired Networks + Use copper (twisted-pair cable or coaxial cable) or fiber-optic cables. + Cables are connected to an Ethernet port on the network router. Benefits Drawbacks ‘Can travel over large distances with a wide range of wavelengths. Low frequency means less data can be Rado Lranmited atone tine Relatveh nespersie weaves Relaely neers etd bynerterence He TLaeae "rom radosatens win ‘ilar requences, communications. ET DIIE,| rcerbandwsth sons | ‘emtaing towers, Tore data transfer Physical obstacles can Inertere wth signals, distance commUMatn, pg see satettes » inerterence. Expensive sed nsatelte phones eae and radio broadcasts. + Wireless Networks * Use radio waves (including WiFi), microwaves, and satellites to connect devices to networks without cables. thors peearal ee oben Wesrineerrntonal Sees 09S 31.25 ee Soe as er Real-time ‘On-demand Existing digital files are converted to encoded bit- streaming format for broadcasting on the internet by uploading to a dedicated server. ‘The eventis captured live via a vvideo camera that is connected toa computer. ‘link for encaded videos placed on the website, and the user clicks on the link to view encoded streaming video. Encoded video signal uploaded) The datas streamed toa from computer to a dedicated | buffer in the user's computer, streaming server via cables or | and the buffer stops the video high-speed wireless internet _ from belng paused as the bits connection, are streamed. ‘The server then sends live As the buffer is emptied, ts images to allusers requesting filed again, thus providing them as a real-time video. continuous viewing, Itcannot be paused, fast- Can be paused, fastforwarded, forwarded, etc. etc Video signal converted to an encoded streaming video signal WWW.ZNOTES.ORG + Ethernet + The most common wired medium for data transmission in LANs or WANS. + Typically used in bus topology; data collisions are managed by the CSMA/CD (Carrier Sense Multiple ‘Access with Collision Detection) method, + CSMAJCD Process: + Device checks if the channel s busy before device waits a random time before retrying. ‘+ During transmission, the device listens for other transmissions. ‘= Ifa collision occurs, transmission is aborted, and both devices wait random times before retrying, + Bit Streaming + Sequence of digital signals (bits) transferred over a ‘communication path at high speeds, requiring a fast broadband connection and buffers. * Bit Streaming Types: * Real-time: Live events captured and transmitted directly * On-demand: Pre-existing files are converted and streamed as requested. + Importance of High Broadband Speed/Bit-Rate + The user has to download and display bits at the same time + Higher quality media requires faster speeds due tolarger data frames as well + Real-time streaming needs higher speeds due to simultaneous data requests coming from multiple different users. + Cloud Computing * On-demand provision of computing services over the internet, including infrastructure, and platforms. ‘Infrastructure: Storage capacity and higher processing power. * Platform: Software, testing & debugging Public cloud vs. Private cloud thors peearal ee oben Wesrineerrntonal Sees 09S 31.25 ee Soe as er Public cloud Private Cloud ‘Access provided by third-party | Owned and maintained by a service providers, shared single organization, providing, ‘among multiple users. exclusive access. Managed by cloud service Can be managed internally by providers using large server the organization itself, or farms outsourced, Benefits Drawback Cannot access the Less technical knowledge | resourcesidata stored on the required, easy to implement. _ cloud if there are bandwidth Poor data privacy, since there sxiblity to scale with —|_may be data leakage in the organization's growth mindset, multi-tenant architecture (public clouds), + World Wide Web (www): ‘Description: Collection of web pages stored on websites ‘+ Function: Protocols are used to transmit data across the WWW. + Internet (Interconnected Network): ‘+ Description: Massive, open network of networks. ‘+ Protocol: Uses TCP/IP protocol, which uses IP addresses to identify devices connected to the Internet. ‘+ Access: Provided by Internet Service Provider. + Communication Methods: Wired, radio, and satellite + Router ina Network: ‘= Function: Connects two networks together which operate under the same protocols (for example, IP) + Connections: Allows internal connections between LANs or external connection from the main LAN to a WAN. ‘+ Additional Roles: Acts as a gateway and firewall, ‘+ Setup: Usually attached to a server or switch in a LAN, ‘+ IP Address Translation: Translates private IP addresses to public IP addresses and vice versa. WWW.ZNOTES.ORG + LAN-Supporting Hardware: + Switch: + Connected to all devices in a LAN. + Can simultaneously broadcast information to all devices. + Server: + Device/software that provides specific functions for computers in the network. + Network Interface Card (NIC): + Provides each device (end-system) in the wired LAN with a unique MAC adcress to uniquely identity it on the network. ‘+ Allows each device to connect to the network, + Wireless Network Interface Card (WNIC): ‘+ Provides each end-system of a wireless (WiFi) LAN a unique network address to identify it. + Wireless Access Points (WAP): ‘Allows devices to connect to the LAN via WiFi instead of using a cable. + Usually built into the router. + Cables: * Awired transmission medium that allows ‘communication in wired networks. + Bridge: ‘= Connects two LANs which work using the same protocol, which can be two segments of the same network. + Stores network addresses for all devices (end- systems) between the two networks. + Looks for the receiving device before it sends the message. + Repeater: * Connects two cables. + Regenerates the sent data signal over the same network before the signal weakens (attenuation) to prevent it from being corrupted. thors paearal ee oben Wesrineererstonal Sees On 31.25 ee Soe as er iPva ad + Internet-Supporting Hardware: 32 bic address, spitinto 4 | The 128bit address is divided + Modems: blocks by." into eight 16-bit blocks by =” Allows a device to connect to the Internet via a ach block could have a value | Each block can have 4 hex telephone line, between 0 and 255 (00 to FFin| values ranging from 0000 to ‘+ Function: A transmitter uses a modem to convert hex. FEF. digital signals (from the transmitting device) to TPvé can be shortened By analogue signals sent down the telephone line. A removing at least (2) 2 blocks receiver uses a modem on the other end to containing only zeroes. For convert the analogue signals to digital signals so ‘example: For example, 255.0.1.255. _°2001:0db8:85a3:0000:0000:8a2_ the receiving device can understand the data, ‘2001 -odbs 8535:0000-0000%842 ‘+ PSTN (Public Switched Telephone Network): ‘+ Refers to all telephone networks. -20010g08:8558:8322:0070-73 + Channel: Used between two endpoints for the 36 call duration via circuit switching. . . : + Resilience: Lines are active even during a power + IPvavs. v6 outage. + IPv4 Functionality: + Communication: Bi-directional. + IP Address Structui + Dedicated Lines: + Network Identifier (netiD): Kdentifes the + Telecommunication path between endpoints, network to which the host (device) is connected, + Not shared with multiple users; it's ‘+ Host Identifier (hostiD) Identiies the host boughtleased. within the network + Function: Able to host websites as well as carry + Classful Addressing: Used for IPvs, where phone calls. Allows continuous, uninterrupted different bit lengths for identification impose access to the Web. restrictions on available addresses. + Cell Phone Network: + Subnetting: + Wireless networks spread over land areas divided + Definition: The practice of dividing a network into into hexagonal) ces two or more networks. + Base Stations: Each cel is served by at least one + Structure: IP addresses are broken down into base station (transceiver, which uses a different three parts by not changing the netiD but frequency range compared to adjacent cells to partitioning the host ID into a subnet ID and host transmit data 1D + Capacity: Larger capacity is possible since the ‘+ Subnet ID: These bits are used to identify same frequencies can be used in non-adjacent ‘each subnet within the network cell ‘+ Subnet Masks: Numbers that hide (mask) the + Transmission: Radio waves are usually used for netiD of a system's P address and leave only transmission. Can be broadcast in all directions the host part as the machine identifier, over a wide area. allowing data to be routed within the subnet + Portable Transceivers: Devices ike mobile to the appropriate host. phones can communicate and access the internet via base stations. WWW.ZNOTES.ORG schoran for pesoratus eyo oh Weemanser erat! thos on SVE. ee Soe as er + Public and © Public IP: + Provided by the ISP. Unique and can be accessed across the internet. + Private ate IP Addresses: ‘Issued by the LAN’s router. ‘+ Unique within the LAN and can only be accessed within the LAN. ‘+ NAT (Network Address Translation): Required for private IP addresses to access the internet directly ‘+ Security: Private IPs are more secure than public IPs since they are not directly accessible on the Internet and are hidden by NAT. ‘+ Address Range: The range of IP addresses used for private IP addressing can never be assigned to public IP addresses. Static Dynamic The IP address wil change at regular periods, Static IP addresses are valid Dynamic P address is relatively when websites need to more secure, hence used remember a device for along where data privacy is quite time, e.g VPNs whitelisting. important. Faster upload/download | Maintaining the cost of the speeds, dynamic IP address is alesser. IP address never changes. ‘+ Static vs. Dynamic IP address ‘+ URL (Uniform Resource Locator) “© Unique reference address for the exact location of an internet resource on the WWW ‘+ Protocol: Enables the browser to know what protocols used to access information in the domain. + Host-name: The domain name. ‘+ Location of Server: The path indicating the server location. ‘+ Domain Name Service (DNS) ‘+ Definition: A naming system used for computers or resources having an internet connection. ‘+ Structure: Consists of a hierarchy of DNS servers which have a URL database and their corresponding. IP addresses, 3. Hardware 3.1. Computers and Their Components WWW.ZNOTES.ORG + Ageneral-purpose computer system comprises a processor, memory, and /O functionality. + The following essential features are needed in a computer - ‘Input: Takes in data from the outside world, + Output: Displays data for human understanding, + Primary Storage: Main memory storing critical program instructions and data + Secondary Storage: Non-volatile storage for oncritical data + Removable secondary storage: ‘+ File backup and archives ‘+ Portable transfer of fles to a second device + Embedded systems: + Miniature computer systems such as. microprocessors that are often a part of a more ‘extensive system, + Each embedded system performs a few specific functions, unlike general-purpose computers Benefits Drawbacks Reliable since there areno Difficult to program functions moving parts, since there is no interface oo Expensive expert help is Cereal needed for the repair Cheap to mass-produce Principle Operations of Hardware Devices Laser printer: + Alaser beam and rotating mirrors are used to draw an image of the page on a photosensitive drum + The image is converted into an electric charge, which attracts charged toner such that it sticks to the image * Electrostatic-charged paper rolled against the drum + Charge pulls toner away from drum and onto paper ‘Heat applied in the fuser to fuse toner to the paper + The electrical charge was removed from the drum, and excess toner was collected 30 Printer: ‘The process starts with a saved digital file that holds the blueprint of the object to be printed + The object is then built by sequentially adding layers of a material (e.g. polymer resin) until the object created + The object is then cured (e.g, resin-made objects are hardened by UV light) Microphone: thors peearal ee oben Wesrineerrntonal Sees 09S 31.25 ee oe eros o ‘= Incoming sound waves enter the screen and cause vibrations in the diaphragm “+ Vibrations cause the coll to move past a magnetic core ‘+ Electrical current is generated, which is then digitized Speaker: ‘+ Takes electrical signals and translates them into physical vibrations to create sound waves ‘+ The electric current in the voice coll generates an electromagnetic field ‘© Change in digital audio signal causes current direction to change, which changes field polarity ‘+ Electramagnet is either attracted or repelled to a permanent magnet, causing a diaphragm that is. attached to the coll to vibrate “+ Vibration transmitted to air in front of the speaker ‘+ The degree of vibration determines the amplitude and, frequency of the sound wave produced Magnetic Hard Disk: “+ Hard disks have platters whose surfaces are covered with 2 magnetisable material ‘+ Platters are mounted on a central spindle and rotated at high spees ‘+ The surface of platters is divided into concentric tracks & sectors, where data is encoded as magnetic patterns ‘+ Each surface is accessed by read/write heads ‘+ When writing, current variation in the head causes: magnetic field variation on the disk ‘+ When reading, magnetic field variation from the disk produces current variation in the read head Solid state (Flash) Memory: ‘+ Most use NAND-based flash memory ‘© Consist of a grid of columns & rows that has 2 transistors at each intersection + Two transistors: “+ Floating Gate; stores electrons, and the presence or absence of charge (electrons) represents either 1 or 0 ‘+ Control Gate: controls charge (electrons) flow for read/write Optical Disc Reader/Writer: WWW.ZNOTES.ORG The disc surface has a reflective metal layer and is spun, + The tracking mechanism moves the laser assembly + Thelens focuses laser onto the disc + Alaser beam shone onto a disc to read/write ‘Tracks have sequences of amorphous and crystalline states on the metallic layer + When reading, the reflected light from the different states on the track is encoded as bit patterns ‘+ When writing, the laser changes surface to crystalline and amorphous states along the track, corresponding to 180° Os. Touchscreen: * Considered as both an input & output device + There are two main-types: Resistive Capacitive Made from materials that store electric charge Pressure causes plates to When touched, the charge is. touch, completing the circuit transferred to the finger Point of contact registered with coordinates used to calculate the position Consists of two charged plates + Virtual (Reality) Headset: * Virtual headsets consist of 2 lenses, (an LCD) display, ‘a circuit board with sensors, a cover and foam padding + The display provides a simulation of a 30 environment generated by a 3D graphics package + The user can move’ in the virtual environment by moving their head or using controllers + Buffers: + A queue that temporarily stores data to balance input/output speed of data, while the cache is the short-term memory storage that stores frequently used data, + Random Access Memory vs. Read-Only Memory RAM ROM Non-voiatile memory: does not lose content when power 's tured off Te ean only be read Used to store currently Used for storing OS kernel and executing program bootup instructions Volatile memory: loses content. when power is turned off Tecan be read and altered ‘+ Types of RAM - Static RAM vs. Dynamic RAM thors paearal ee oben Wesrineerbrstonal Sees On 31.25 ee oe eros o ‘SRAM DRAM Doesnt need to refresh; hence, Has to be refreshed; it has Ituses less power and faster slower access times and needs access time higher power Only a single transistor & capacitor, hence less expensive ‘to purchase More complex circuitry, hence ‘more expensive Fach bits storedina fiplop | Each bits stored as a charge Has higher data density Used in main memory Has lower data density Used in cache memory ‘+ Types of ROM - PROM vs. EPROM vs. EEPROM PROM EPROM EEPROM Erasable Electrically Erasable Programmable ROM programmable ROM Programmable ROM Ieeanbe Tecan be erased by | Itcan be erased by programmed only | UVlightexposure _ an electrical signal onceafteritis | andcanthenbe | and.can then be created reprogrammed | reprogrammed Chip has tobe Can update data Data cannot be cradarieleed | _Temoved for | without removing, reprogramming the chio, WWW.ZNOTES.ORG ‘+ Monitoring and Control Systems + Monitoring System: + Monitors some state external to the computer system + No changes were made to the environment by the system, and hence, no feedback + Control System: + Regulates the behaviour of other devices or systems + Event-driven sy system's state in response to some event ‘+ Time-driven system, where the controller takes action at a specific point in time + Hardware typically used in a syste ‘+ Sensor that measures an (analogue) property and transmits itto a processing unit, generally as an electrical or optical signal ‘+ Actuators that switch on/off heavy appliances (eg. heater to heat/fan to cool) + ADC that converts analogue signals to digital signals * Transmission cable to transfer signals + Feedback Systems: + Output from the system affects the input of. + Ensures the system operates within the given criteria + Enabling the system output to affect subsequent system inputs may cause a change in the actions taken by the system + This enables the system to adjust conditions in a continuous process automatically 1m: the controller alters the 3.2. Logic Gates and Logic Circuits + Logic Gates: use ane or mare inputs and produce a single logical output ‘+ AND gate: If both inputs are high, the output is high (ae a 8 Output 0 o ° ° 1 ° 1 ° ° 1 1 1 thors paearal ee oben Wesrineerbrstonal Sees On 31.25 ee oe eros o a 5 Output ° ° 1 ° 1 1 1 ° 1 1 1 ° ‘+ OR gate: If either input is high, the output is high (A+B) a 5 Output ° 0 ° ° 1 1 i ° i + NOR gate: (A+B) 1 1 1 a 5 Output ° 0 1 0 1 o 1 o ° 1 1 ° ‘+ NOT gate: an inverter (A) a ‘output + XOR gate: (408) 1 © be F a 5 Output ° ° ° ° 1 1 1 ° 1 1 1 ° A out + NAND gate: (4'8) WWW.ZNOTES.ORG scorn for pesoratusslyby sh Weert erat! cos on VOUS. ee Soe as er A B 4. Processor Fundamentals 4.1. Central Processing U Architecture (CPU) Von Neumann model + Von Neumann realized data & programs are indistinguishable and can, therefore, use the same memory. “+ Von Neumann's architecture uses a single processor. «It follows a linear sequence of fetch-decode-execute operations for the set of instructions, ie. the program. ‘+ Todo this, the processor uses registers. Registers + Registers: smallest unit of storage of microprocessor; allows fast data transfer between other registers + General Purpose registers Used to temporarily store data values which have been read fram memory or some processed result + Assembly language instructions can use it + Special Purpose Registers + Some are accessible by assembly language instructions + Only holds either data or memory location, net both + Particular purpose registers include: ‘+ Program Counter (PC): holds the address of the next instruction to be fetched ‘+ Memory Data Register (MDR): holds data value fetched from memory ‘+ Memory Address Register (MAR): Holds the address of the memory cell of the program which isto be accessed ‘+ Accumulator (ACC): holds all values that are processed by arithmetic & logical operations. + Index Register (1X): Stores a number used to change an address value + Current Instruction Register (CIR): Once program instruction is fetched, itis stored in CIR and allows the processor to decode & execute it + Status Register: holds results of comparisons to decide later for action, intermediate and erroneous results of arithmetic performed ‘The Processor (CPU) + Arithmetic and Logic Unit (ALU): part of the processor that processes instructions which require some form of arithmetic or logical operation + Control Unit (CU): part of the CPU that fetches instructions from memory, decodes them & synchronizes operations before sending signals to the computer's memory, ALU and /O devices to direct how to respond to instructions sent to the processor + Immediate Access Store (IAS): memory unit that the processor can directly access ‘System Clock: a timing device connected to a processor ‘that synchronises all components. Buses thors paearal ee oben 3 Wesrineerrstonal Sees On 31.25 WWW.ZNOTES.ORG ee Soe as er ‘Set of parallel wires that allow the transfer of data between components in a computer system ‘© Data bus: bidirectional bus that carries data instructions between processor, memory, and VO devices. ‘+ Address bus: unidirectional bus that carries the address of the main memory location or input/output device about to be used, from pracessor to memory address register (MAR) Control bus Bidirectional ‘+ used to transmit control signals from the control unit, to ensure access/use of data & address buses by components of the system does not lead to conflict Performance of Computer System Factors WWW.ZNOTES.ORG + Clock Speed + Number of pulses the clock sends out in a given time interval, which determines the number of cycles (processes) the CPU executes in a given time interval + Usually measured in Gigahertz (GHz) * Ifthe clock speed is increased, then the execution time for instructions decreases, Hence, more cycles per unit time, which increases performance, + However, there is a limit on clock speed since the heat generated by higher clock speeds cannot be removed fast enough, which leads to overheating. + Bus Width * Determines the number of bits that can be simukaneously transferred + Refers to the number of lines in a bus + Increasing bus width increases the number of bits transferred simultaneously, increasing processing ‘speed and performance. * Cache Memory * Commonly used instructions are stored in the cache memory area of the CPU. + Ifthe cache memory size is increased, more commonly executed instructions can be stored, and the need for the CPU to wait for instructions to be loaded reduces. Hence, the CPU executes more cycles per unit of time, thus improving performance, + Number of Cores ‘+ Most CPU chips are multi-core — have more than one core (essentially a processor) + Each core simultaneously processes diferent instructions through multithreading, improving computer performance, Ports. thors paearal ee oben 3 Wesrineerrstonal Sees On 31.25 ee oe eros o “+ Hardware which provides a physical interface between a device with CPU and a peripheral device ‘+ Peripheral (VO) devices cannot be directly connected to the CPU, hence connected through ports. ‘+ Universal Serial Bus (USB): Can connect both input and output devices to the processor through a USB port, ‘+ High Definition Multimedia Interface (HDMI) + Can only connect output devices (e.g, LCD) to the processor through a HDMI port ‘+ HDMI cables transmit high-bandwidth and high- resolution video & audio streams through HDMI ports. ‘+ Video Graphics Array (VGA) ‘+ Can only connect output devices (e.g, second ‘monitor/display) to the processor through a VGA port ‘+ VGA ports allow only the transmission of video streams but not audio components Fetch-Execute (F-E) cycle + Fetch stage ‘+ PC holds the address of the next instruction to be ed ‘+The address on the PC is copied to MAR + PCis incremented + Instruction loaded to MOR from the address held in MAR + Instruction from MDR loaded to CIR ‘+ Decode stage: The opcode and operand parts of instruction are identified ‘+ Execute stage: Instructions executed by the control unit sending control signals, ‘+ Register Transfer Notation (RTN) © MAR < [PC] + cep et + MDR [MARI] + CIR< (MDR} + Decode + Execute Return to start ‘Square brackets: value currently in that register + Double square brackets: CPU is getting value stored at the address in the register Interrupts WWW.ZNOTES.ORG + Asignal from a program seeking the processor's, attention + Handles the interrupt by controlling the processor * Different ISRs used for different sources of interrupt + Atypical sequence of actions when an interrupt occurs: + The processor checks the interrupt register for Interrupt atthe end of the F-E cycle for the current instruction + Ifthe interrupt flag is set in the interrupt register, the interrupt source is detected * Ifthe interrupt is low priority, then an interrupt is disabled * If interrupting Is a high priority: * Allcontents of registers of the running process are saved on the stack * Cis loaded with the ISR and is executed * Once ISR is completed, the processor pops the registers’ contents from the stack, and the interrupted program continues its execution. ‘+ Interrupts re-enabled and ‘+ Return to the start of the cycle 4.2. Assembly Language thors paearal ee oben Wesrineerbrstonal Sees On 31.25 ee oe eros o ‘+ Assembly language: low-level programming language with instructions made up of an op code and an operand ‘+ Machine code: code written in binary that uses the processor's basic machine operations ‘+ Relationship between machine and assembly language: every assembly language instruction (source code) translates into exactly one machine code instruction (object code) + symbolic addressing ‘+ Symbols used to represent operation codes + Labels can be used for addresses + Absolute addressing: a fixed address in memory + Assembler ‘+ Software that changes assembly language into machine code for the processor to understand + The assembler replaces all mnemonics and labels with their respective binary values (that are predefined before by the assembler software) + One pass assembler ‘Assembler converts mnemonic source code into machine code in one sweep of program + Cannot handle code that involves forward referencing ‘+ Two pass assembler: software makes 2 passes thru code © On the first pass: ‘+ Symbol table created to enter symbolic addresses and labels into specific addresses + Allerrors are suppressed + On the second pass: ‘= Jump instructions access memory addresses via table ‘+ Whole source code translates into machine code + Error reported if they exist ‘+ Grouping the Processor's Instruction Set WWW.ZNOTES.ORG OpCode _Operand Explanation Addressing Lom #n___Immediate: Loadn into ACC Direct: load contents at sep address into the ACC indirect load contents of Lol address at given address into ace ix indexed: load contents of given address +IR into ACC Data Movement aD ‘Store contents oF ACC into address arithmetic Operations: [ ‘ADD ‘Add contents of register to ACC rd ‘Add 1 to contents of the register Comparing Compare contents of ACC with ni that of given address oar sn Compare contents of ACC wih Conditional jumps jump to address if compare JPE Le P Jump to address if compare ca FALSE Unconditional jumps IMP Jump to given address Wo Data NW Input any character and store ASCIIvalue in ACC ‘Output character whose ASCII our vvalue is stored in ACC Ending ED Return Control to operating system denotes immediate addressing B denotes a binary number, e.g, BO1001010 & denotes a hexadecimal number, e.g. &4A, thors paearal ee oben Wesrineerbrstonal Sees On 31.25 ee oe eros o + Modes of Addressing ‘© Direct Addressing: loads contents at address into ACC ‘+ Indirect Addressing: The address to be used is at given address. Load contents of this second address toacc ‘+ Indexed addressing: form the address to be used as + the contents of the IR (Index Register) ‘+ Relative addressing: next instruction to be carried out is an offset number of locations away, relative to address of current instruction held in PC; allows for relocatable code ‘+ Conditional jump: has a condition that will be checked (lke using an IF statements) ‘+ Unconditional jump: ne condition to be followed, simply jump to the next instruction as specified 4.3. Bit Manipulation ‘+ Binary numbers can be multiplied or divided by shifting + Left shift (USL #n) ‘Bits are shifted to the left to multiply + Eg. to multiply by four, al digits shift two places to left + Right shift (LSR #n) ‘+ Bits are shifted to the right to divide + Eg. to divide by four, all digits shift two places to right ‘+ Logical shift: zeros replace the vacated bit position ‘+ Arithmetic shift: Used to carry out mutiplication and division of signed integers represented by bits in the accumulator by ensuring that the sign-bit (usually the MSB) is the same after the shift. “+ Cyclic shift: the bit that is removed from one end by the shiftis added to the other end, Bit Masking WWW.ZNOTES.ORG + Each bit can represent an individual flag. + =-byaltering the bits, flags could be operated upon. ‘Bit manipulation operations: ‘+ Masking: an operation that defines which bits you want to keep and which bits you want to clear. ‘+ Masking to 1: The OR operation is used with a 1 + Masking to 0: The AND operation is used with a0. + Matching: an operation that allows the accumulator to compare the value it contains to the given value in order to change the state of the status register. Practical applications of Bit Masking: + Setting an individual bit position: ‘+ Mask the content of the register with a mask pattern which has 0 in the ‘mask out’ positions and 1 in the ‘retain’ positions. ‘+ Set the result with the match pattern by using the ‘AND command with a direct address. + Testing one or more bits: ‘= Mask the content of the register with a mask pattern which has 0 in the ‘mask out’ positions and/1 in the retain’ positions. + Compare the result with the match pattern by using the CMP command or by "Checking the pattern’. * Checking the pattern ‘+ Use AND operation to mask bits and obtain resultant. + Now subtract matching bit pattern from resultant. The final ‘non-zero’ result confirms the patterns are not the same else vice versa, 5. System Software 5.1. Operating System thors paearal ee oben Wesrineerbrstonal Sees On 31.25 ee Soe as er = Need for 05 ‘+ Asset of programs designed to run in the background on a computer system which + Controls operation of computer system + Provides a user interface + Controls how computer responds to user's requests + Controls how hardware communicate + Provides an environment in which application software can be executed ‘+ OS hardware is unusable without an OS, as the OS acts as an interface since it controls communication between user and hardware key Management Tasks ‘+ (Main) Memory Management ‘+ Memory protection to ensure 2 programs do not try to.use same memory space = Paging + Use of virtual memory ‘+ File Management + Provides file naming conventions ‘= Maintains a directory structure + Allocates space to particular files + Security Management ‘+ Proves usernames & passwords + Ensures data privacy ‘+ Prevents unauthorized access + Carries out automatic backup + Hardware (input/output/peripherals) Management. ‘+ Installation of appropriate driver software ‘+ Controls access to data sent to and from peripherals ‘+ Receives & handles interrupts from hardware devices + Process Management ables multiprogramming and multitasking ‘+ Resolution of conflicts when 2 or more processes requires the same resource ‘+ Eg. via Round-robin method Utility Software WWW.ZNOTES.ORG + Disk Formatter + Prepares a hard disk to allow data to be stored on it + Deletes any existing data on disk + Performs formatting, process where computer ‘draws lines’ on disk surface to splitit into small areas, + Virus checker + Checks for and then removes any viruses found + Constantly checks all incoming and outgoing files + Defragmentation Software + Files can be big so have to be stored in multiple sectors, which can result in fragmentation (contents Of file scattered across >2 non-contiguous sectors) + Fragmentation slows down disk access and thus the performance of the entire computer. + Defragmenting software works by physicaly reorganizing disk contents (files) such that they are stored in contiguous sectors. * This defragmentation reduces number of movements of the read/write heads require to access the disk contents, hence increasing computer performance + The defragmentation also creates larger contiguous {ree space regions * Disk contents analysis/disk repair software + Software utility for visualization of disk space usage * Gets size for each folder and files, and generates a graphical chart showing disk usage distribution according to folders or other user defined criteria, + Allows disk to report errors (e.g. "bad sector") + Software will attempt to offer a solution + File Compression + Reduces file size by removing redundant data in files + Causes improvements in the computer's performance by reducing the data that needs to be stored + Back-up Sofware + Makes copy of files on another storage medium in the event of a hard drive failure, user error, disaster or accident. * Should be a regular process + Can provide synchronization between devices Program Libraries thereat paearal ee oben Wesrineerbrstonal Sees On 31.25 ee Soe as er ‘+ Pre-written code that can be linked to a software under development without any amendments ‘© Can perform common ar camplex tasks “+ Takes the form of classes + Benefits: ‘+ Saves time: less code needs to be written ‘+ Smaller testing time: pre-tested and used by others ‘+ Library file is a complex algorithm which the user does not need to understand to use it ‘+ Dynamic Link Library (OL, files ‘+ Shared library file that contains code and data + Code saved separately from the main .EXE file, reducing the .EXE file's size + Code only loaded to main memory when required ‘+ DDL fle can be made available to several applications simultaneously, thus reducing strain on memory ‘+ DLL files act as modules in more complex programs, making it easier to install and run updates 5.2. Language Translators + Assembler ‘+ Software that translates assembly language statements into machine code (binary) for execution ‘+ The mnemonics used translates into machine opcodes + Process simple because assembly language has a ‘one-to-one relationship with machine code. + Compiler and Interpreter WWW.ZNOTES.ORG Compiler Interpreter ‘Translates a high-level Translates and executes a high language program to machine level language program, line code. by-line Creates a exe file which can be easily distributed. ‘Once compiled, .exe file does Execution very slow - not need to be compiled again,_ translated each time program resulting in faster execution. run. Reports all errors at the end of Debugging easier/faster, since compilation: dificultto locate it stops translating when it errors: development process reaches an error. This allows No .exe file created long. realtime error correction ‘Only be produced when all Canrun program any time, errors are fixed, even before code finished. Used when development is Fe development eee Used during development. thors paearal ee oben 3 Wesrineerrstonal Sees On 31.25 ee oe eros o ‘© Two-step translation ‘Java and some other high level language programs ‘may require two-step translation, Le, they will be partially compiled and partially interpreted + Java code first translated to bytecode by java compiler ‘+ Bytecode finally interpreted by the Java Virtual Machine to produce machine code ‘+ Integrated Development Environment (IDE) features + Coding + Context-sensitive prompts: Displays choice of keywords and available identifiers appropriate at current insertion point and provides choices in alphabetical order ‘+ Hightights undeclared/unassigned variable Identifiers + Initial Error Detection ‘+ Dynamic syntax checks: Automatic checking and highlighting of syntax errors, as soon as line typed + Type checking & parameter checking, + Presentation + Prettyprint: Automatic indentation and color- coding of keywords + Expand and Collapse code blocks: Saves excessive scrolling i collapsed, and easy to see global variable declarations and main program body when collapsed = Debugging ‘Single stepping: Executes program line-byline to see the effect of each statement on variables ‘+ Breakpoints: Pauses program at a specific line to ensure program operates correctly up to that line + Variables/expressions Report Window; Monitors, variables for comparing values. 6, Security, Privacy and Data Integrity 6.1. Data Security WWW.ZNOTES.ORG + Data Security: ensuring data is protected against loss and unauthorized access. + Data Integrity: making sure that data is valid and does nt corrupt after transmission + Data Privacy: ability to determine what datas shared with a third party + Data Security and Computer System Security Data Security System Security Protection of data ona Protection ofthe computer computer system system To prevent access of viruses to the system and prevent hackers from entering your computer system Eg. ID & Password ‘To prevent corruption of data and prevent hackers from using data Eg. encryption Threats to Computer & Data Security thors paearal ee oben Wesrineerrstonal See On 81.25

You might also like