Computing A Level - All Theory
Role of An Interpreter:
(Similar to Compiler, only this looks at the source code line by line, analyses it, and if it contains syntax errors it will call the appropriate subroutine within its own program code to execute the command) • This will translate programs written in a high level language (source code) into machine code but it will not produce an object code file (.exe). It translates line by line as the program is running and never actually produces an object file (.exe). Every time you run the program it needs to be interpreted again. It is generally quite slow because each line in a loop, for instance, will be interpreted and run every time the loop is processed. An Interpreter is used when developing/debugging a program
What is a Gateway?:
(Translates packets when moving between different networks that use different protocols) • Routing packets from one network to another network requires a router if the networks share the same protocols, e.g. TCP/IP protocol. Where these protocols differ between networks, a gateway is used rather than a router to translate between them. • All of the header is stripped from the data packet leaving only the raw data (payload) and a new header is added in the format of the new network before the gateway sends the packet on its way again. • Other than the above, gateways offer similar services to typical routers, in that they move packets on towards their destination.
Components required: Components Required for Wireless Networking:
- A computer needs a Wireless Network Interface Controller (WNIC). Typically, a computer with a WNIC is called a station. - All stations on the network share the same single radio frequency communication channel and are tuned in to this frequency to pick up transmissions. Transmissions are received by all stations within range of the WAP. 1. Wireless Network Adapter 2. Wireless Access Point
• Components of a Packet include; A Header: A Payload: May also contain a Trailer:
- Holds the sender's IP address/source and recipient's IP address/destination. - The protocol being used with this type of packet. - The packet number of the total e.g. 1 of 8. - Time To Live or Hop Limit, after which point the data packet expires and is discarded. - This contains the body of data being sent/the actual data being sent. Upon receipt, the data packets are reassembled in the correct order and then the data is extracted. - This would include a checksum or Cyclical Redundancy Check CRC, to detect for transmission errors by creating and attaching a hash total calculated from the data contained in the packets payload. - The CRC/checksum is recalculated for each packet upon receipt and a match is used to help verify the payload data hasn't changed during transmission. If the CRC/checksum result totals differ, then the packet will be refused with suspected data corruption and a new copy is requested from the sender.
4.7.3.6 Interrupts (A2/NEW)
""
De Morgans Laws! LEARN
""
Von Neumann Architecture:
- Uses the STORED PROGRAM CONCEPT: where a machine would hold IN a single store (main memory) BOTH instructions (program) and the data in which the instructions were to be carried out. In other words, Program is stored in main memory. Each instruction is fetched, decoded and executed by the processor. - Most computers today are built on this principle, so general structure is sometimes referred to as V.N machine.
4.5.4.3 Signed Binary Using Two's Complement Minimum Value That Can Be Represented in Signed Binary for n bits: Maximum Value That Can Be Represented in Signed Binary for n bits:
-((2^n)-1) (2^n-1)-1
The Fetch-Execute Cycle Explain the F-E Cycle: Long-Hand
1. Address of next instruction is COPIED from the PROGRAM COUNTER into the MEMORY ADDRESS REGISTER. 2. Instruction held at that address is RETURNED along DATA BUS to the MEMORY BUFFER REGISTER. Simultaneously, the content of the PROGRAM COUNTER now holds the ADDRESS of the next instruction to be dealt with. 3. CONTENTS of MEMORY BUFFER REGISTER are COPIED to the CURRENT INSTRUCTION REGISTER. 4. Instruction held in the CIR is DECODED, splitting it into opcode and operand. 5. Instruction is EXECUTED using the ARITHMETIC LOGIC UNIT is required. 6. SR is used, a bit set if an error is flagged up etc.
Protection:
1. Firewall: Network administrator sets up rules for controlling what is allowed through to the computer, e.g. blocking of IP addresses by packet filtering. And/Or use of a proxy server with a firewall, so that the hosts are not in direct contact with the internet. 2. Encryption: Plaintext is turned into ciphertext using an algorithm. Symmetric encryption, where cryptanalysis can be used to crack the key to decrypt the plaintext, unless the One-Time Pad cipher is used, or Asymmetric encryption with the use of a public and private key e.g. SSL Secure Socket Layer.
Peer to peer vs client server 1. Status 2. Maintenance 3. Backups
1. P to P = all comps have equal status. C to S = computer is either a client or server. 2. Easy to set up and maintain. Needs a network manager to run the network. 3. Backup each computer separately. Can be done from central computer/server.
OS Handles:
1. Resource management 2. Provision of an interface for the user 3. Memory management [Allowing a user to work on several tasks simultaneously] Therefore, each program must be allocated space in memory controlled by OS] 4. Processor scheduling [responsible for allocating processor time to each application that's running simultaneously, as they compete for CPU] 5. Backing store management [when files/applications are loaded, transferred from backing storage to memory. OS is required to keep a directory of where files are stored so can be quickly accessed] 6. Management of all input and output [diff. applications require diff/ I/O devices throughout operation. E.G/ Printing = needs OS to check all OK first etc.]
Serial Over Parallel - The Advantages:
1. Significant reduction in size & complexity of connectors means lower costs and still acceptable performance. 2. "Crosstalk" creates interference between parallel wires = corrupted WORDS must be retransmitted... 3. Serial links much more reliable over greater distances. 4. Because of a LACK of interference at higher frequencies, signal frequency can be much higher with serial transmission, resulting in higher net data transfer rate even though less data is being transmitted...
Securing Wireless Networks:
1. Wi-Fi Protected Access 2 (WPA2) is a security protocol used to secure wireless networks and is built into the WNIC. It provides strong encryption and a new 128-bit key is generated for each packet sent. 2. In order to restrict which network devices using a wireless network the network administrator can set up a MAC address whitelist which means a list of MAC address that will be permitted to use the network. Any MAC address not on the list will not be allowed access to the network.
Classification of Languages Development of Programming Languages: • First computers conceived in ... • Large companies became ...
1940s during WW2. Alan Turing & others cracked the Enigma Code with the aid of Colossus, one of the very first programmable computers. interested b/c for example, payroll. They figured a comp could work out someone's payroll 1000 times faster than a human could.
3. High-Level Language.
1960s, IBM team made a major breakthrough in development of programming - in other words, allowing programmers to write programs in same language as would do algorithms. = High level (b/c enable programmers to think and code in terms of algorithms)
Internet Registries:
5 global organisations governed by the ICANN (Internet Corp for Assigned Names and Number), with worldwide databases that hold records of all domain names currently issued and their details, such as the registrar which sold them the domain name, their postal mailing address, the registrant's name, etc. The Registries also allocate IP addresses, and keep track of which address/es a domain name is associated with as part of the DNS (Domain Name System).
Advantages of MIDI Files: MIDI Metadata:
A MIDI file is a list of instructions that tell it to synthesise a sound based on prerecorded digital samples and synthesised samples of sounds created by different sources of instruments, 1. It can use 1,000 times LESS disk space than a conventional recording at an equivalent quality. 2. Music created is also easily manipulated. 3. The 'instructions' to play a specific song can be passed on to other digital instruments or translated to be played in a different key. • Each note carries with it specific information in order for a computer to recreate it accurately. This information includes the duration of the note, instrument, volume, timbre and channel. This information is called metadata. • It is data that describes other data
Secondary Storage Devices Need for: ...
A computers primary store is RAM. Unlike RAM, secondary storage is not directly accessible to the processor and with slower speeds BUT it RETAINS its contents when the computer is OFF! • So, if we wish to keep information on a computer for next time, we need SSDs.
4.5.3.1 Bits and Bytes What is a 'bit': What is a 'Byte': How Many Different Values Can Be Represented with n bits?:
A fundamental unit of information. Can have one of two values, '1' or '0'. Group of binary digits/bits; contains 8-bits. Seeing as this is in binary, the number base is 2. Therefore, the calculation you use it: 2^n/2n • For example, how many different values can be represented with 3 bits? 23 = 8 different values/patterns.
2. Majority Voting Describe: 3. Checksums Describe: Use of:
A system that requires each bit to be sent x3 times. If a bit value is flipped erroneously during the transmission over a noisy line, the recipient should assume that the two other bits which are still the same were the original bit sent and therefore correct. It is a mathematical algorithm which is applied to a packet of data, such as a block of 256 Bytes. The data in the block is used to create a checksum value which is transmitted with the ddata block. Then, when received, the same algorithm is carried out on the data again at this end and the two calculations compared. If the same, nothing wrong during transmission. E.g. adding together up each byte after converting 8 bits to decimal numbers. Delivering of goods from suppliers to commercial purchasers.
3. Memory Management Module • The objectives of memory management are to: ...
Allocate memory space to allow several processes to run simultaneously Protect processes from each other when running concurrently Enable sharing of memory space between processes when required Provide a satisfactory level of performance Make addressing space as transparent as possible to the programmer
4.5.6.2 Analogue and Digital Analogue Data: Digital Data: Analogue Signals: Digital Signals:
Analogue data uses values which change very smoothly, such as an analogue clock with a smooth changing hand that is continuous. Digital data jumps from one value to another in a step by step sequence, such as digital clocks jumping from displaying one numerical value for time to the next as a discrete change. Analogue signals are continuous and usually denoted by a wave (typically a sine wave). They can vary in amplitude, frequency or both. Digital signals are discrete and are a series of values where each value is a bit pattern - where the bit patterns might represent integer values, such as the amplitude of a sound.
4.5.5.3 Error Checking Introduction: 1. Parity Bits Describe:
Bits can change erroneously during transmission as a result of interference. Computers use a variety of systems to verify that the data they receive was the same as the data that was sent. An additional bit that is used to check the other bits transmitted are likely to be correct. Therefore, using ASCII which is typically 7-bits in an 8-bit system works perfectly as there is that one bit extra available. Use of: Two types of PARITY: Odd VS Even. • Odd Parity : number of '1's in the group must be odd THUS a '0' is the parity. Otherwise '1' is parity. • Even Parity : number of '1's in the group must be even THUS a '0' is the parity. Otherwise, '1' is parity.
Principles of Operation: Passive Tag: ... Active Tag: ...
Cheaper to produce than an active tag and they are smaller (no battery). They rely on the radio waves emitted by the reader (maximum distance 1metre) to provide sufficient electromagnetic power to the card using its coiled antenna. Once energised, the transponder inside the RFID tag can send its data to the reader nearby (the data capacity of a transponder is normally several kilobytes). Examples of use include Oyster Cards (London Transport), contactless bank card, ski area lift passes, tags inside clothes, food items etc. An active tag uses a battery to power the tag so that it actively transmits a signal for a reader to pick up. Due to the battery, these are larger than passive tags and they are used to track things that may not pass that close to the reader e.g. cars as they pass through a motorway toll booth.
Network Topology Physical Star: Operation: ... Advantages...: Disadvantages...:
Consists of a central computer - file server - with each workstation connecting directly to it. Very fast communication if the file server is a very high speed computer. No workstation can interact with another, only the file server (if the right type of software for security purposes is loaded on the file server). - Particularly suitable for WANs where organisations rely on a central computer for the bulk of processing tasks. - A type of Ethernet network. • If one cable fails the other computers are unaffected • Security is tighter • Variable transmission rates possible between file server and other PCs. • Easy to add new stations. Just plug directly into file server • Cabling costs are higher due to the length required • If a link becomes severed then no communication is possible from the workstation concerned
4.5.6.9 Data Compression What is Data Compression?: Why Are Sound/Image Files Often Compressed?: What Can Be Compressed?:
Data compression is a technique that simply gets rid of the redundancy. Instead of listing a piece of information over and over again, a file-compression program lists that information once and then refers back to it whenever it appears in the original program. This results in smaller file sizes which is very important for images on websites and for transmitting data over a communications link. To reduce storage space of files on a disk, also for quicker transmission times due to there being less data to transmit. Text files can also be compressed. ""
2. Optical Disk Characteristics: ... Capacity - ... Speed of Access - ... Purposes: ... Suitability: ... Principles of Operation:
Different formats of Optical Disk. Read-Only, CD-ROM, Recordable, CD-R, and Rewriteable, CD-RW. CD-ROM = 650 MB - big! Blu-Ray only about 50 MB. And because of this large storage, great for keeping databases/encyclopaedia's on. CD-R = The first generation of optical disc drives used 12-inch discs that stored about 1,000MB per surface. CD-ROM = Fast data access. CD-ROM - Storage and distribution e.g. music, films. Very cheap! Easy to distribute e.g. through the post. However, can be corrupted/damaged easily by excessive sunlight or scratches... General - Works by using a high-powered laser to 'burn' (change the chemical properties of) sections of the disks surface, making them less reflective. A laser at a lower power is then used to read the disk by bouncing light off of its surface. Depending on how much light is received back, it will be translated to either a 1 or 0 as binary data.
1. Magnetic Hard Disk Characteristics: ... Capacity - ... Speed of Access - ... Purposes: ... Suitability: ... Principles of Operation:
Disk spins really quickly, at speeds of up to 10k RPM. It has a read-write drive head which essentially moves across the disk to read different bits or write to certain areas. The disk drive essentially allows rapid random access to large amounts of data. Newer 3.5 inch disks have capacities for up to several Terabytes. Rapid. Desktop. Less portable than Optical or Solid State Media. Stores tonnes of info. Heavy, not great for distribution. Not damaged easily as very study. Uses rigid rotating platters, coated with a magnetic material which acts as tiny magnets. Ferrous particles on the disk are polarised to become either a north/south state which will represent either 0 or 1 as binary data. The disk is divided into tracks in concentric circles, and each track is subdivided into sectors. The disk then has a drive head which can move across to read different bits. Data is read or written to the disk as the disk passed under the drive head! The drive head isn't in contact with the disk but less than a millimetre above it. To READ data, the head hovers over an entire block and reads it all, then passes it to the computer. A block is on sector of a track. Both sides of the platter can be used to store data and there can be multiple platters which means for the high storage capacity.
Worms, Trojans and Viruses Worms: Trojans:
Exploits security holes in networks and then replicates itself - but unlike a virus, it does not need to be attached to anything. Another form of virus -it is a malicious program hidden in desirable software e.g. games. Therefore, the difference is that trojans are technically downloaded on purpose because the software they are hidden in was wanted. Viruses are downloaded accidentally.
4.6.1.2 Classification of Software What is meant by 'System Software': What is meant by 'Application Software':
Helps the overall running of the computer. • The software that is needed to run the computer's hardware and application programs. This includes; • Operating system, • Utility programs, • Libraries, • Programming language translators This type solves problems for the user. Examples include word processing software, spreadsheets and databases. • Consists of programs that perform specific tasks for user. It can be categorised as; • General purpose, • Special-purpose, • Bespoke/custom-written
3. Solid State Disk (SSD) Characteristics: ... Capacity - ... Speed of Access - ... Purposes: ... Suitability: ...
Inside the SSD, as it is packaged to look like a hard-drive, there is an array of chips on a board. Solid State Memory comprises of millions of NAND flash memory cells, and a controller that manages pagers and blocks of memory. Lower. Has faster access speeds than Hard Disks! This is because it relies on no moving parts. Access time for a typical HD is 10-15 milliseconds. Used in phones, laptops and cameras. Consumes less power and is less susceptible to damage/most robust. Silent in operation, lighter and more portable.
Information Coding Schemes 4.5.5.1 Character Form of a Decimal Digit Introduction: What does this mean?
Introduction: The number code of a character is not the same as the actual number value. • Illustrated with ASCII: the decimal number 7 has an ASCII value of 0110111, however the binary of 0110111 does not result in the decimal digit of 7 but the decimal digit of 55. Therefore, ASCII and other character coding systems cannot be used for binary arithmetic operations.
Vernam Cipher/One-Time Pad:
Invented in 1917, also part of a class of ciphers known as one-time pad ciphers - all of which offer perfect security if used properly. • To offer perfect security, the key/one-time pad must; • be equal to the length of the plaintext or longer • be truly random (not computationally generated - so instead collected from a physical and unpredictable phenomenon like white noise or radioactive decay.) • only be used once
4.6.1.3 System Software 1. Operating System. What is it? Need for/Functions of:
Is a set of programs that lies between applications Software and the computer Hardware, which works to hide the complexities of the hardware from the user, allowing them to use it without having to know how the computer actually works. 1) Resource management - managing all the computer hardware including the CPU, memory, disk drives, keyboard, monitor, printer and other peripherals. 2) Provision of a user interface E.G/ Windows, to enable users to perform tasks such as running application software, changing settings on the computer, downloading and installing new software.
Role of a Router:
Is to read the recipient's IP address in each data packet and forward it on to the recipient via the fastest/least congested route to the next router on the journey, which will do the same until the packet actually reaches the recipient/destination. - Routers use routing tables to store and update the locations of other network devices and the most efficient routes to them. - A routing algorithm is used to find the optimum route. However, the routing algorithm used to find the best route, can become a bottleneck in network traffic since the decision-making process can be complicated. Link to Dijkstra's shortest path algorithm. This is commonly used in routing. When a router is connected to the Internet, the IP address of the port connecting it must be registered with an internet registry because this IP address therefore must be globally unique over the entire Internet.
6. I/O Controllers
It is a device which interfaces between I/O devices and the processor. Each device has a separate controller which connects to the CONTROL BUS. This is because Peripherals are not directly connected to the processor they are connected to an I/O Controller that is then connected to the processor; if peripherals were directly connected to the processor, then every time a new peripheral was invented the processor would need to be redesigned! • They receive I/O requests from the processor and then send device-specific control signals to the device they control. • They also manage data flow to AND from the device. The I/O Controller is an electronic circuit that consists of: 1. Electronics that form the interface between the controller and the system bus 2. A set of data, command and status registers 3. Electronics that form the interface between the controller and the peripheral Remember that registers are just storage locations that data can be written to or read from. The processor exchanges data with a peripheral through a part of the I/O Controller called an I/O Port. An I/O Port allows the exchange of data between the processor and the peripheral and allows you to plug in your cable. • An example of an I/O Controller known as a Network Interface Card (NIC). Another very common I/O Port is a USB Port. This type of port will allow many different types of peripherals to attach to the computer such as mouse, camera, smart phone, printer etc.
4.5.6.8 MIDI [Musical Instrument Digital Interface] What is MIDI?: Purpose of MIDI: Use of Event Message in MIDI:
It is a technical standard that describe a protocol, digital interface and connectors which can be used to allow a wide variety of electronic musical instruments, computer and other related devices to connect and communicate with one another. To allow a wide variety of electronic musical instruments, computers and other devices to connect and communicate in order to create a large and perfectly timed ensemble. A MIDI CONTROLLER carries EVENT MESSAGES that specify pitch and duration of a note, vibrato and volume changes, and synchronise tempo between multiple devices.
The Processor Instruction Set What is meant by 'Processor Instruction Set'?:
It's specific to each processor inside a computer, and is basically the list of say commands, opcodes, that the computer recognises E.G/ STR, LOAD ... which may differ from processor to processor. It is the number of different instructions/list of instructions the processor understands
4.8.1 Moral, Ethical, Legal and Cultural Issues and Opportunities:
Just need to be aware of what's happened in the world with Snowden NSA and May/snoopers charter. • Use of cookies and the ability to price discriminate Hotel companies charging more to people who have just been looking at airline websites. • Moral issues surrounding AI and what makes humans human. • The power software engineers have can create great good or great harm https://www.youtube.com/watch?v=mJHvSp9AKYg (Example) CLEESE (From AS ICT think it still applies) can help in exam. Cultural, legal, ethical, environmental, social and economical
Short-Hand
MAR <- [PC] MBR <- [Memory]; PC <- [PC] + 1 CIR <- [MBR] [CIR] opcode decoded [CIR] opcode executed
Types of Networking Between Hosts Peer-To-Peer: Client-Server:
More common for very small networks, like at home. Not cost effective/necessary to have a server. Each computer is configured so it shares files and folders with other peer computers on the LAN, and hardware like printers can be shared too. - When computers and devices on a network communicate directly with each other with no need for a medium such as a server in a client-server network. All devices therefore have equal status. Most common type of network architecture. Typically means a number of client machines connected to a server (central computer). The server is then a big, powerful computer which stores all the software that runs over the networks and stored all users accounts. - If the server crashes, the network therefore goes down. - Each time a client machine wants from like a webpage from the server, a client request is made and thee server responds. - Advantage: management is centralised and clients are not dependent on other clients, just the server.
Internet Registries and Registrars Internet Registrars:
Needed to ensure a domain name is only used by one organisation - no overlaps. They hold lists of all existing website names and details of those domains that are available to purchase. - These companies act as resellers for domain names and allow people/companies to purchase them. - Therefore, they pair domain names and IP addresses together to then be kept in a table held on a DNS server (computer) by Internet Registries to keep track of everything.
2. Main Memory (& Stored Program Concept) Memory - Can be Volatile and Non-volatile.
Non-volatile: such as Flash memory, EEPROM, ROM... Volatile: such as primary storage such as fast Cache memory • Normally "main memory" refers to RAM, or large mass storage like hard disks. However, main memory itself is made up of RAM and ROM. RAM is temporary working memory that stores the current running programs and all the data. ROM stores the 'boot up' instructions to load the operating system and the POST (Power On Self Test).
4.7.3.7 Factors Affecting Processor Performance 1. Multiple Cores: 2. Cache Memory:
Number of cores linked together on a single chip. In von Neumann machine, instructions are carried out in a serial manner. Dual or quad processors mean that each processor is theoretically able to process an instruction w/ its OWN fetch-execute, working at the same time. THUS FASTER. Amount and type... Cache is a VERY SMALL amount of expensive, very fast memory located inside or near to the CPU. When an instruction is fetched from main memory = copied o CACHE in case it is needed again SOON AFTER! Thus, making it very easy to fetch afterwards and much faster.
Define 'Bandwidth': Define 'Latency': Define 'Protocol':
RANGE of frequencies that a TRANSMISSION medium can carry. The larger the range, the greater the amount of data that can be transmitted in a fixed time (Bps). NOTE: direct relationship between baud rate and bandwidth! aka directly proportional... • A good analogy is a pipe. The more people using the pipe the less bandwidth available for each person. A fat pipe is good! Lag. TIME delay between moment that transmission of first byte starts and when it is received at destination. For example, in a WAN network involving satellites, significant time delay occurs because of the physical distance between the ground stations and the geostationary satellite. This is an example of latency. A set of pre-defined rules that must be abided by.
Communication Basics Define 'Baud Rate': Define 'Bit Rate':
RATE at which the SIGNAL CHANGES. • Baud rate is the number of voltage changes per second. It is named after Jean Baudot and is a very old unit of speed. Generally speaking: One Baud = one bit/s ..but at high transmission speeds it is possible to encode more than one bit per voltage change. SPEED at which the DATA is TRANSMITTED serially is measured in bits/second. • If more than one bit is encoded per signal then bit rate will be greater than baud rate (e.g. a 2400 bit/s modem transmits at 600 baud). If one bit is encoded per signal then bit rate will equal baud rate.
Processor and its Components Role and Operation of a Processor: Important Components... • Arithmetic Logic Unit: • Control Unit: • Clock:
Responds to and processes the instructions that drive the computer. It contains the Control Unit, the ALU and registers. Located in the CPU or close to it. ALU performs different sorts of operations on data. This is where all arithmetic (e.g. addition) and logic (e.g. comparisons of data) operations are carried out. CU coordinates and controls activities of the processor, directing the flow of data between the processor and other devices. It fetches instructions, decodes and executes them (Fetch-Execute cycle). Generates a series of signals/continuous pulse switching between 0 and 1 billions of times a second. It is used to synchronise CPU operations.
What are the Advantages of Using Named Constants?:
Same as for meaningful identifier names for variables... & • If you wish to change it, all you do is set the new constant value where the constant is declared and it will update all thru the program.
4. Check Digits Describe: Use of:
Similar to a 'checksum' as it is an additional digit on the end of a string of other numbers designed to check for mistakes in input or transmission. However, the added bit is calculated from the other numbers and therefore specific only to that set, so if the rest of the bits re-calculated by a reader do not calculate the additional digit, something has gone wrong in transmission. For example, printed books have a unique ISBN (International Standard Book Number), 13-digits which includes the calculated check digit and is printed with the barcode. The first 12-digits are unique to the item, the 13th the check digit.
Principles of Operation:
So, as solid state memory is comprised of millions of NAND flash memory cells, each of the cells works by delivering a current along and the bit and word lines to active the flow of electrons from the source towards the drain. The current on the word line however, is strong enough to force a few electrons across the insulated oxide layer into a gloating gate. Once the current is then switched off, these electrons are trapped. The state of the NAND cell is determined by measuring the charge in the floating gate. No charge/no electrons means for a 1 state and some charge is considered a 0. The trapped electrons and their charge will remain even when the power is off, which means that SSD is non-volatile. The sites where the electrons are trapped, floating gate transistors, are organised in a grid and the entire grid layout is called a block, and the rows which make up the grid are a page. - Data typically stored in pages of 4kiB. However, because it is a block-oriented storage device - only if the whole block is erased can it be re-written as NAND flash memory cannot overwrite existing data. And erasing a block means un-trapping electrons..
Continued
Speaking of which, each domain name has 1 or more equivalent IP addresses. The DNS catalogues all domain names and IP addresses in a series of global directories that Domain Name Servers can access in order to find the correct IP address location for a resource. When a webpage is requested using the URL, the browser requests the corresponding IP address from a local Domain Name Server. If that DNS doesn't have the correct equivalent IP Address for the URL entered, the search is extended up the hierarchy to another, larger Domain Name Server and so on, until the correct IP Address is found and a data request is sent by the user's computer to that location to find the web page data. For example, mail.websitename.co.uk [host, website, Company 2LD, Country TLD] [websitename.co.uk = Website domain name] [mail.website.co.uk = Fully Qualified Domain Name FQDN] For example, after www for world wide web in this case, .bbc.co.uk + <root> [3LD, 2LD, Country TLD, followed by the root] Other 3LDS include: .ebay, .lidl Other 2 LDs include: .gov, .sch Other Country TLDs include: .fr, .de Instead, you could have a Generic TLD: .com, .edu, .org
The Registers...: • General-Purpose Registers Dedicated Registers, including: • Program Counter: • Current Instruction Register: • Memory Address Register: • Memory Buffer Register: NOTE: Also known as Memory Data Register (MDR). • Status Register:
Summary: A register is a high speed memory location on the processor. There are typically up to 16 GPRs in the CPU. All arithmetic, shift or logical operations occur within these registers, therefore they hold data temporarily during a calculation of some kind. NOTE: Accumulator is another name for a GPR. E.g. Accumulator, e.g. R0 R4. PC holds address of next instruction to be executed. CIR holds address of instruction currently being decoded and executed. MAR holds the ADDRESS of the instruction or data being transferred between memory and the MBR/MDR. MBR is used to temporarily hold the instruction or data being read from, or written to, memory. SR contains bits that are set or cleared depending on the result of an instruction.
5. Control Bus
Summary: Carries status information. Control signals can travel in both directions (Bidirectional) between system components. • The control bus transmits command, timing and specific status info between system components. • It ensures that access to, and use of the data and address buses by different components of the system, doesn't lead to conflict.
3. Address Bus
Summary: Carries the address of a memory location currently being read from or written to. As memory is divided up internally into units called Words, the words then have their own specific address in memory to be retrieved from. • Addresses travel in only ONE direction (unidirectional) along the address bus. The processor sends the address of an instruction or the address of some data to be stored or retrieved to memory or to an I/O controller. An address bus typically consists of 64 lines. • When the processor wishes to read a word of data from memory, it first puts the address of the word on the address bus. The WIDTH of the address bus determines the MAX possible MEMORY CAPACITY of the system. NOTE: Address bus is also used to address I/O ports during input/output operations. NOTE: For example, if the bus were to consist of 8-lines, it would have a memory capacity of 256, as 2 possible bits per line means for 2^8 = 256 bits (1 Byte).
4. Data Bus
Summary: Carries the data currently being read from or written to main memory. Typically consists of 16, 32 or 64-separate lines, provides a bi-directional path for moving data and instructions between system components. • Data can travel in BOTH directions (Bidirectional) along the data bus between the system components. The WIDTH of the data bus is a key factor in determining the overall system PERFORMANCE. For instance, if the data bus is 16 bits wide and each instruction is 32 bits long, then the processor must access the main memory twice during each instruction cycle as 32 / 16 = 2.
Meaning of the Stored Program Concept Describe what is meant by the 'Stored Program Concept':
Summary: Program is stored in main memory. Each instruction is fetched, decoded and executed by the processor. • Recap - Where a machine would hold IN a single store (main memory) BOTH instructions (program) and the data to be used/in which the instructions were to be carried out. EXTRA: 1) A program must be resident in MAIN MEMORY to be executed. 2) The machine code instructions are FETCHED from memory ONE AT A TIME, decoded and then executed IN the PROCESSOR (Fetch-Execute cycle).
Asynchronous Transmission:
Summary: one character is sent at a time preceded by a start bit and followed by a stop bit. • Only one character at a time is sent, with each being proceeded by a start-bit and followed by a stop-bit. • Start-bit alerts the receiving device and synchronises the clock inside the receiver ready to receive the character. • Stop-bit is actually a 'stop period', and allows the receiving device some time to get ready for the next character marked by a new start bit. • The receiver's Baud Rate must be set up to be the same as the sender's Baud Rate so received bits can be read at the same regular time intervals. • Parity may well be used also so an additional bit is sent for each character. • This type of transmission is less frequently used than synchronous because it is slower but is still used for PCs. Note that the start bit can be 0 or 1 but it must be different from the stop bit.
Synchronous Transmission:
Summary: timing signals synchronise transmission. • Data transferred at regular intervals, timed by clocking signal, allowing for a constant and reliable transmission for time-sensitive data such as real-time videos. PARALLEL usually involves this. • There is no need for start and stop bits to be sent with each character. • This method is less error-prone, more efficient and faster than asynchronous. For example, inside the CPU where a clock emits a signal at regular intervals and data travels along buses.
2. Utility Programs. What is it? Need for/Functions of: Such as,
System software designed to optimise the performance of the computer or perform tasks. - backing up files, - restoring corrupted files from backup, - compressing or decompressing data, - providing a firewall, etc. For example, Disk Defragmentor = program to reorganise hard disk, making file reading quicker. For example, Virus checker/Anti-Virus = checks hard drive and possibly emails etc. for viruses and removes them.
Addressing Modes Immediate Addressing: Direct Addressing:
The OPERAND is the ACTUAL value we're operating on / "Operand is the datum". OPERAND is the ADDRESS of where the value is being held - be interpreted as either in main memory or a register.
3. Clock Speed: 4. Word Length: 5. Address Bus Width: 6. Data Bus Width:
The faster the clock pulse, the faster the instructions will be executed. It is used to synchronise activities of the CPU. Typically measured in Giga Hertz as 1 billion cycles/second. Word size = number of bits the CPU can process simultaneously. Typically, around 32bits or 64bits {8 or 16 Bytes at a time}. MAJOR FACTOR in determining speed! BIGGER the word, FASTER the processor! Determines maximum addresses that can be directly referenced. RECAP: The WIDTH of the address bus determines the MAX possible MEMORY CAPACITY of the system Determines how many bits can be transferred simultaneously. RECAP: The WIDTH of the data bus is a key factor in determining the overall system PERFORMANCE. The wider it is, the less times it may have to go back to finish off collecting an instruction... NOTE - usually but not always same size as word size.
4.9.3 The Internet (A2): Structure of the Internet:
The internet is a network of networks that uses unique IP Addresses and TCP/IP Protocols. (Note: TCP/IP means 'Transmission Control Protocol/Internet Protocol' - this is a set of networking protocols that allows two or more computers to communicate) • Physical structure - Each continent is connected via a core backbone of cables. These cables are transnational lines, which are leased, that lie along the sea bed. • National Internet Service Providers (ISPs) connect directly to this backbone and distribute the internet connection to smaller providers who then provide access to individual homes and businesses.
Understanding the Need for Communication Between Components:
The user cannot directly communicate with the processor or hardware items, or I/O devices. Thus, interfaces are required as well as the bus system, and the CPU to collect instructions from the user, and pass them along/execute them.
4. Translators. What is it? Need for/Functions of:
There are 3 categories: Compilers, Interpreters, Assemblers. Change the source code into machine code that the computer can read, understand and execute. - Compilers and Interpreters translate programs written in a high level language such as Visual Basic, Pascal, C or Delphi into machine code (pure binary form understood by the computer). Assemblers translate a program written in a low level language into machine code
Instructions Consist of: 1. Opcode: 2. One or more Operands:
This is the instruction of the input, where it tells the computer what to do to the operand/s (values). For example, if the Opcode was of a dedicated 4 bits, 0101, it may translate to mean 'STORE'. This/these are the values that the computer must carry out the opcode instruction on. Depending on whether it is proceeded by a '#', is either the actual value we're operating on, or the address/register of the value we will be operating on. NOTE: The Opcode is split into Basic Machine Operation and Addressing Mode.
1. Machine Code.
This language reflects how computer actually carries out the instruction] A typical instruction holds an operation code (opcode) in the first 4 bits and an operand in the rest of the memory cell. In reality, 32 bits would usually be used to hold one. Computers use binary digits to represent data. Typically, 0 is represented by 0 volts and 1 is represented by 5 volts. Originally, computers would have been programmed in raw binary! This would have been very time consuming and error prone.
Wireless Networking: Purpose of Wi-Fi: ...
To enable a user to wirelessly connect devices like laptops and tablets to a network resource of the internet. It works via a Wireless Access Point. Typically, WAPs would have a range of 20m indoors. Home WAPS/Hubs are a combination of several devices such as a switch, router, WAP and firewall. Commercially, there are separate devices but for home they are combined into one device.
Domain Name and the DNS (Domain Name System):
Translate the domain name into an IP address to be stored in a table. Depending on the area/domain an internet resource resides in, it will be structured into this hierarchy of smaller domains - tables in each. The actual domain name tags onto the end of the URL, as it all helps to make the addresses of internet resources easier to remember for humans, otherwise you could simply enter in the IP Address for the internet resource to load it into by a web browser.
What is a Packet? (Data Packets): • Data to be ... • The size of ...
Transmitted on a network is broken down into manageable chunks - these are packets. Each can be fixed or variable but they average between 500 and 1500 Bytes (if a byte represents 1 letter - e.g. If ASCII is used with Parity-bit check taking up 8 bits - then that means 500 - 1500 words of an email).
Describe Unicode: Why Was Unicode Introduced?: Drawbacks of Unicode:
Unicode is a 16-bit coding scheme which allows for 65536 different combinations of numerical values to represent therefore 65536 characters. This is so large it can represent, in full, several different languages. Because several coding systems has sprung up globally which were not compatible with each other, such as for different numerical values representing identical characters, and vice versa. Therefore a new, universal coding system was needed. • Encodings take up more storage than ASCII, being 8 or 9 bits more needed to be stored per character representation. This significantly increases file sizes and transmission times.
Buses -
a bus is a set of parallel wires connecting two or more components of the computer. The system bus consists of three separate buses, the data bus, the address bus and the control bus. The diagram below shows the direction of transmission along the buses
Roles of Internal Components: 1. Processor Responds to ...
and processes the instructions that drive the computer. • It contains the Control Unit, the ALU and system clock. Located in the CPU or close to it. Control unit: this coordinates the activities taking place in the processor and peripherals, by sending control signals to the various devices. It operates by repeating three operations: - Fetch: get next instruction from memory - Decode: translate instruction into commands computer can process - Execute: cause instruction to be executed. • Arithmetic and logic unit: (ALU) in which all arithmetic (addition, subtraction etc) and logic operations (AND, OR, NOT etc) are carried out • System clock: generates a continuous sequence of clock pulses to step the control unit through its operation
Communication Methods Serial Transmission: • Serial = ... Parallel Transmission: • Parallel = ...
bits are sent over a single wire one at a time from source to destination. • Very high data transmission rates can be achieved by using a fibre-optic cable serial transmission, up to around 2.4 Terra bits per second! This is enough to send 200 hours of video every second... several bits are sent simultaneously over several separate wires. Uses within the computer by buses and also over short distances for data transmissions, such as a computer connecting to a printer. • When used, each wire has slightly different properties resulting in bits being sent at slightly different speeds, therefore being received at different times = problem known as SKEW; therefore, parallel transmission only reliable over SHORT distance.
2. The Scheduler • The job of the scheduler is to ...
choose the next process to load into main memory and the next process to execute. The objectives are to: Maximise system throughput Be fair to all users Provide acceptable response times to users Ensure hardware resources are kept busy Avoid deadlock
[Virtual Machine] • The role is to ... • Therefore a 'Virtual Machine' can be defined as ... • The details are ...
create a virtual machine, thus referring to how it hides the complexity of the hardware from the user so it is easier to use creating a so-called virtual machine; it does this via the API (Application Programming Interface). any instance where software is used to take on the function of a machine via an API. hidden by placing the final layers of software on top of the hardware. The final layers are the user interface and a way for application programs to call on services of the operating system such as file creation. This is achieved with an application programming interface (API).
CD-ROM Read-Only disk ... CD-R Recordable disk ... CD-RW Rewriteable disk ...
is pressed during manufacture to have pits in its surface. Those areas that are not pitted are called lands. At the point where a pit starts or ends, light is scattered/not reflected so well. So, between the areas where lots of light is received back and less is received, will be translated as 0s or 1s. Only a single track on a CD-ROM disk, arranged as a tight spiral. uses a reflective layer with a transparent dye coating which becomes less reflective when a high-powered spot laser 'burns' a spot in the track. The areas which are then reflected back under a lower-powered laser, and with more and less light reflected from different areas, will be translated into 0s and 1s. uses a layer and a magnet in order to heat a spot on the disk to a temperature of 200°C, and set its state with the magnet to be translated as a 0 or 1 before it cools again. Therefore, to clear reset a spot, the layer is used to burn it again so the magnet can change the state of the spot to be north or south before it cools and sets again.
Why is an Intermediate Language Produced as Output by Some Compilers?: • Interpreters have become ... • Bytecode may be ... • Can achieve ...
much less common. Now, languages like Python & Java use an intermediate representation which combines compiling and interpreting. The resulting BYTECODE is then executed by a BYTECODE INTERPRETER. compiled once and for all (Java) or each time a change in the source code is detected before executed (Python). Advantages: platform independence (built on one machine & can be used on another). For example, Java Bytecode - acts as an extra security layer between your computer and the program. Can DL an untrusted program and then execute the Bytecode rather than program itself, guarding against any malicious programs.
4. Input/Output Module • Interface between ...
other modules of the OS and the I/O devices Allows all the I/O devices to be treated in a uniform manner Supplies the device specific control signals to the relevant I/O device by using a piece of software called a device driver Each device has its own device driver and all devices also have a temporary storage area called a buffer
1. Process Management Module • A process is a ...
sequence of actions produced through the execution of program instructions. At any instant it can be in one of three states: • Executing: process is using the processor • Executable: process can make use of the processor if processor were free • Suspended: process is waiting for an I/O device to become available The OS maintains the three queues e.g. if an executing process uses up its time slice it is moved to the executable queue and the next process in the executable queue is moved to the executing queue. The scheduler (see later) carries out the job of choosing the next executable process.
Bitmap Colour Depth: Higher Bit Depth =: • 1 bit monochrome • 12 bit colour • 24 bit colour • 32 bit colour
• "Number of bits stored per pixel", because this determines how many colours a pixel could represent as one bit represents one colour. For the above example taken, the bit depth would have been 8 because it was a Byte per pixel... • The greater the number of bits per pixel, the greater the number of colours could be represented by the pixel. Higher audio quality for sound. • For example, 23 means 3 bits per pixel, could show 8 different colours. 3 is the colour depth. (number of bits per pixel...) One bit is used for each pixel which restricts it to just black or white Four bits allocated to R, G and B components. This would give 212 (4096) different colours Eight bits allocated to R, G and B components. This would give 224 (16 777 216) different colours. This approaches the level at which the human eye can distinguish colours for most photographic images This method is often favoured because modern computers have a word size that is either 32 bits or 64 bits. Eight bits allocated to R, G and B components as above with an extra eight bits remaining that can either be ignored or used to represent an alpha channel, which is a way of providing partial transparency.
4.5.6.7 Digital Representation of Sound Sampling Process Description: Sample Resolution:
• A digital audio recorder samples sound waves thousands of times per second (Sampling Rate). The more samples taken, the illusion of a smoker track there will be. Each sample is a digital image of the sound at a given instant. The samples, each recorded as a series of bits, are stored in memory and can be manipulated. Bits can be added or removed, their order can be altered, or their very values changed. Each modification changes the overall image of the sound wave, so when the samples are played back, you hear a different sound. • When sound is represented digitally, amplitude of analogue signals must be measured at given points and recorded to be stored in digital form as numerical values. • Sampling Resolution is the number of bits used to record the amplitude for each measurement - the representation used to write samples in digital sound recording. For example, an 8-bit recording can store 256 amplitude levels/integer values, therefore all 256 different levels would each be a sampling resolution that may be used in this instance. Whereas a 4-bit assignment to storing a sample would decrease the overall quality. • Hence, the more bits assigned to each sample, the more accurately the recorder can store and recreate the original sound's variations in loudness
4.5.6.3 Analogue/Digital Conversion ADC Principles of Operation: DAC Principles of Operation:
• A mic attached to the computer converts sound energy into electrical energy. • Then, the ADC will sample this analogue data in electrical form at a given frequency, measuring the amplitude at each interval/point, which will then be converted into a binary value to represent its integer value according to the resolution or the audio bit depth that is being used per sample. • Binary values for each sample point are translated back into either their analogue signal form or to voltage levels, and sent to an amplified connected with speakers to play sound aloud. • They are translated back with the use of the resolution or audio bit depth used to translate it as ADC in the first instance to get back to the original sound in analogue form. ** ADCs are used with Analogue Sensors...
4.9.3.2 Internet Security Firewalls:
• A security checkpoint measure designed to prevent unauthorised access between two networks, usually an internal and trusted network and an external, deemed untrusted network - often the Internet. Can be implemented both in hardware and software. A router may contain a firewall. • A firewall consists of a separate computer containing two NICs (Network interface Cards) with one connected to the internal network and the other to the external. Using special firewall software, each data packet which attempts to pass through both NICs is analysed against preconfigured rules (packet filters), then accepted/rejected. • A firewall may also act as a proxy server.
Advantages/Disadvantages of Networks in General:
• Allows the sharing of resources e.g. printers, disk storage etc. • Allows the sharing of data • Easier to install the APs e.g. Word Processors, Databases etc. on the server once only not on each individual machine • Email can be used • Easier to set up new users and equipment • Different types of machine can communicate with each other • Users become dependent on them. If the server fails then no one can use the machines to run APs etc. (unless a backup server available). It is possible that some local work can be done but this will depend on the type of machines being used and what S/W has been installed locally • If the network fails then some H/W and S/W will be unavailable • A badly managed network may operate less efficiently than stand-alone machines • Difficult to ensure the network is secure • As traffic increases on the network the performance of the network decreases
Bitmaps Size in Pixels: Storage Requirements of a Bitmapped Image: Ignoring meta data... Typical Metadata:
• Bitmap resolution, in pixels, PPI. Not DPI. In other words, how many pixels makeup the size of the image. • Resolution * Colour/bit depth (where resolution = width in pixels * height in pixels) • Typical Metadata is described as data that describes/gives information about other data. For example, image metadata, contains details like the image width and height in pixels, and its bit/colour depth. • It helps to explain why a calculate image size may not exactly equal what the computer shows as the image size.
2. Digital Camera (Input) What is it? (Purposes, Suitability): ... Purposes - ... Consists of: ... Principles of Operation: ...
• Captures a view of reality and translates it into digital form to display on a screen. Taking images to preserve, such as during an event like a wedding or on a family holiday. 1) CCD Sensor/COS Sensor 2) Shutter 3) Lens 4) Processor 5) Memory Card Uses a Charged Coupled Device (CCD) or CMOS sensor comprising of millions of tiny light sensors, arranged in grid. When the shutter opens, light enters the camera and projects an 'image' onto the sensor at the back of the lens. Each sensor measures the brightness of each pixel, turns light into electricity and stores the amount of charge as binary data. This binary data is then recorded onto the camera's memory card. + Some cheaper cameras use a CMOS sensor instead of CCD. CCD tends to produce higher quality and more reliable, but power consumption is higher.
In other words... Perfect Security: Why is it considered to Have Perfect Security?:
• Ciphers that use non-random keys can always be broken given enough time and resources. This includes ciphers that use computer generated random numbers as these are not truly random only pseudo random. To ensure a Vernam Cipher is unbreakable only truly random numbers can be used such. These numbers must be collected from a physical and unpredictable phenomenon such as white noise or radioactive decay. The sender and recipient must meet in person to securely share the key and destroy it after encryption or decryption. The key is truly random, taken from a physical and unpredictable phenomenon, such as a sample of white noise, and so the distribution of characters will also be truly random. It is also not dependent on computational security. Together, this means no amount of cryptanalysis will be able to crack this cypher.
Packet Filtering/Static Filtering:
• Controls network access according to network administrator rules/policies, by examining the source and destination IP addresses in a packets header. • If these addresses are on the permitted list, they are allowed through. • Static filtering can also block packets based on the protocols being used and the port numbers they are trying to access. So, if it is rejected, the IP address is blocked and the port numbers it's trying to access (a port is similar to an airport gate where a flight/packet is directed to the correct gate/port to allow passengers into the airport/in this case, to download the packet's payload data to the computer). Note, certain protocols use certain ports. For example, telnet is used to remotely access computers and uses port 23. If Telnet is disallowed by a network administrator, any packets attempting to connect through port 23 will be dropped/rejected to deny access. - A dropped packet is quietly removed. - A rejected packet will cause a rejection notice to be sent back to the sender.
1 Input and Output Devices 1. Barcode Reader (Input) What is it? (Purposes, Suitability): ... Purposes - ... Consists of: ... Principles of Operation: ...
• Currently 4 different types of barcode readers; Pen-type, laser scanners, CD readers and camera-based readers. • Taking a camera-based reader (camera-based imaging scanner) it can decode a 1D or 2D barcode. It can read a barcode on any surface, printed or onscreen and also works with poor barcodes e.g. damaged, poorly printed. It can also scan the code at any rotation and a variety of distances from the camera. Age verification by scanning a license, barcode coupon vouchers for a superstore, event ticketing e.g. a concert. 1) light source 2) lens 3) photoelectronic detectors 4) decoder circuitry Uses a camera and image processing techniques to decode a 1/2D barcode. For this process, it highlights a barcode using a visible red light. The reflected light is translated back from optical form into digital form by photoelectronic detectors, and is interpreted by the computer, decoded into character form to understand what it means as it then matches the information to information stored on a database.
2. Assembly Code. This had 2 major improvements:
• Each opcode was replaced by a mnemonic which gave a good hint as to what the operator was actually doing. • Operand was replaced by a decimal (or hex) number. This is called machine code. Remembering machine code and programming in it is very hard so Assembly Language was introduced.
Disadvantages of Machine Code/Assembly Code: Advantages of High-Level Langs:
• Harder to understand, find errors, easier to make errors, harder to fix errors, confusing to read, takes ages to write out, may depend on computer architecture • Relatively easy to learn • Much easier and faster to write a program in a high-level language • Programs are much easier to understand, debug and maintain • Are not dependent on the architecture of a particular machine • There are many built-in library functions available in most high-level languages
4.6.1.1 Relationship Between Hardware and Software Define what is meant by 'Hardware': Define what is meant by 'Software':
• Hardware is the term used to describe the electrical or electro-mechanical parts of a computer and its inputs, outputs and storage devices. • Software comprises all the programs that are written to make computers function. "Hardware responds to software commands"
The Harvard Machine:
• Has physically separate memories for instructions and data. • The two different memories can have different characteristics. Such as, in embedded systems, instructions may be held in read-only memory while data memory requires read-write memory. NOTE that, in some systems, there is much more instruction memory than data memory so the address bus and instruction addresses are wider than the data addresses and data bus. - Advantage = FASTER than von Neumann b/c data and instructions can be fetched in parallel instead of competing for the same bus.
Proxy Server:
• Intercepts packets entering and leaving a network, hiding the true network addresses of the source from the recipient - enabling privacy and anonymous surfing. • It can also maintain a cache of websites commonly visited and return the web page to the user right away, without reconnecting to the Internet and re-requesting the page from the web server = speeds up access time to web page data and reduces web traffic. - If a web page is not in cache, then the proxy will make a request of its own behalf of the user to the web server using its own IP address and forward the returned data to the user, adding the page to its cache for other users going through the same proxy to access, • Proxy server may serve hundreds or thousands of users. Often used to filter requests providing administrative control over the content users may demand e.g. in schools. Uses: often to filter requests providing administrative control over content that users demand e.g. in a school.
IP Address:
• Internet Protocol address is a unique address that's assigned to a network device. It performs a similar function to a home mail address/postcode. • The IP address indicates where a packet of data is to be sent or has been sent from, and routers use it to direct data packets accordingly. • If a domain name is associated with a specific IP address, then the IP address is the address of the server (still a computer) which the website resides on!
Digital Signatures/Hashing/Digesting:
• Is needed to know a message is sent definitely from who you think it was. • Digital Signature: is used to authorise a message to show it really has been sent by who you thought, and has not been tampered with. A hash or digest is produced from the sender's message, such as an algorithm gathering and summing all the ASCII values from the character's content of the message and then dividing it by 1000. The message is encrypted with the recipient's public key. The hash itself must also be encrypted however, by the sender's private key. Then, the hash is sent with the message. The message can be decrypted by the recipient with their own public and private key. Then, the recipient decrypts the hash with the sender's public key. The recipient rehashes the decrypted message and compares both digest results together. If they match = all is well. If not = tampered with.
Uniform Resource Locator:
• Is the full address for an internet resource, specifying the location of an internet resource on the internet, including the name and usually the file type so a browser can go and request it from the website server the resource resides on.
Digital Certificate & How They Are Obtained/Used:
• Issued by Certification Authorities - electronic credit card, containing a name, serial number, expiration date, public key and digital signature for someone. A sender will attach their digital certificate to a message sent to a recipient. The message Digital Certificate will have been encrypted with the recipient's public key such that only they can now decrypt it with their own private and public key. Now being able to access the information of the digital certificate, they can verify that the sender is valid and who they thought they were, and can now send a reply as they have access to the original sender's public key, such that they can now encrypt a reply with that public key and return the message as only the original sender can decrypt it with their own private and public key.
Lossless Compression: Lossy Compression: Uses of Each:
• It records patterns in data rather than recording the actual data. Using said patterns and instructions on how to use them, which have been stored, the computer can then reverse the effects of the compression and reassemble it to the original file with exact accuracy and no lost data. • It removes non-essential information. Its compression of sound and video are similar - MP3s use it to rid frequency's humans cannot hear and sounds playing too quiet at the same time as loud sounds so they cannot be heard either. 1. Typically, lossless compression is used when it is important that the original file matches exactly the decompressed file. For example, text documents, spreadsheets, executable code. Examples include zip, gif, png. 2. Typically, lossy compression is used when it is not important that the original file matches exactly the decompressed file. For example, image files and sound files. Examples include jpg, mp3, mp4.
Differences Between Lossless and Lossy Compressions: [Lossless] Principles Behind Run Length Encoding (RLE):
• Lossy can result in a noticeable drop in quality. Lossless doesn't but the file can be much larger, although it is still significantly larger than the original after compression. • Where it records the pixel's value and how many times it repeats in an image to cut down on space needed for storage of info (pushing together in groups - 5 pizza's, not pizza, pizza, pizza, pizza, pizza, etc.)
MIDI Overview:
• MIDI is a common representation for instrumental music that does not store sound waves at all. The purpose of MIDI is to instruct, via messages, a MIDI controlled instrument how to make sounds e.g. note on, note off, pitch, loudness, duration of note. It is a list of instructions that tell it to synthesise a sound based on pre-recorded digital samples and synthesised samples of sounds created by different sources of instruments. The result is a very flexible representation that can be changed to a different key and played on different instruments. A MIDI file is typically much smaller than a conventional recording of the same quality (up to 1000 times less disc space). Mobile phone ringtones and software sounds are usually stored in MIDI format for this reason.
Typical Control Lines Include:
• Memory Write: data on the data bus to be written into addressed location • Memory Read: data from the addressed location to be placed on data bus
Role of Packet Switching:
• Packet Switching - a method used to communicate packets of data across a network on which other, similar communications are happening simultaneously (the cables are shared between many communications to make efficient use of them). • The communication cables are shared between many communications to allow efficient use of them. • Website data you receive arrives as a series of packets and an email will leave your computer in a series of packets of data.
4.5.6.4 Bitmapped Graphics Graphics: How Are Bitmaps Represented?:
• Pictures can be stored inside a computer. Graphics can be generated using either a bitmapped system or a vector based system. A bitmap (or raster) image contains many pixels (or picture elements), that make up the whole image. Each pixel is attributed a binary value which represents a single colour. For example, 1 binary bit represents 1 colour, so 8 bit represents up to 2^8 different colours = 256. • The more pixels used the more memory used
What is a Router?: Hop:
• Purpose: a device that uses IP address to route packets. • Routers are used to connect at least 2 networks together, commonly 2 LANs or WANs, or a LAN and its ISP's network. The act of traversing between one routed and the next across a network.
Advantages of Machine Code/Assembly Code: Therefore, Why Program in Assembly Code?:
• Quicker, easier, understandable, find errors quick, fix errors quick, not reliant on architecture etc... • Assembly language can be optimized extremely well because it is low level Therefore assembly language is used where the utmost performance is required for applications • Assembly language is also useful for communicating with the machine at a hardware level. For this reason, it is often used for writing device drivers • Because no conversion from a higher level by a compiler is required, the resulting programs can be exceedingly small which can save valuable space
Stateful Inspection/Dynamic Filtering:
• Rather than relying on the IP addresses, protocols and port numbers to govern a packet's safe passage, this can also examine the payload contents to better assess it for safety. • It can also create temporary contextual rules based on the passage of previous a previous 'conversation' - this is to ensure that incoming responses (to your outgoing packets) arriving through the same port numbers and with the same IP addresses, can be temporarily allowed during that communication stream. • Routers usually keep a conversation data in a Connection Table which is dynamically updated and referred to in conjunction with rules created by the admin of the network. Example: when a web browser makes a request to a specific web server for a web page. The packets containing the web page data returning from the server would be allowed since the dynamic filter knows these are in response to the request just made. This provides an added security measure against port scanning for covert access to a computer, since ports are closed off until connection to the specific port is requested by a computer on the protected side of the firewalls.
4.5.6.5 Vector Graphics How Do Vector Graphics Represent Images: Vector Drawing Lists:
• Rather than storing information on each individual pixel and building up an image, they are created from geometric shapes or objects like lines, curves and polygons. A vector file therefore stores only the necessary detail about each shape in order to redraw it once the file is loaded. • For example, recreating a circle, information stored must include the position of its centre on the image, its radius, its fill and line colours and line weight. • CAD systems are vector-based. • These properties are stored in a drawing list which specifies to the computer how to redraw the image. Therefore, if the image is resized on the screen, it won't go blurry because the shapes will each be re-crafted instead the pixels 'stretched' as with bitmaps. (Examples of typical Properties of Objects:) • For example, a line of a drawing list for a circle may look like: Circle (centre = x,y, radius = r, fill = blue, stroke = red, weight = 3px)
[Lossless] Principles Behind Dictionary-Based Methods: Example & Further Explanation:
• Send a complete copy of the Oxford English Dictionary and an index to each word where it lies within the dictionary. • For example, "Pelican" on page 249 o the dictionary as the 7th word >> could be sent as 249, 7 - using only 2 Bytes, considerably less than the 7 Bytes (e.g. ASCII character code for each letter) it would have taken to send the full word ... (ignoring the space it takes to send the dictionary) • Dictionary based compression works in a very similar way. The compression algorithm searches through the text to find suitable entries in its own dictionary and translates the message accordingly: Number Entry Binary 0 Do 000 1 _unto 001 2 _others 010 3 _as 011 4 _you 100 5 _would 101 6 _have 110 7 _do 111 • Using the dictionary table above, the saying "Do unto others as you would have others do unto you" would be compressed as 0 1 2 3 4 5 6 2 7 1 4 (11 x 3 = 33 bits). This compares with 51 bytes - a reduction of 92%. This still ignores the fact that the dictionary needs to be sent too but this becomes less significant when a long body of text is being sent.
Routing Packets across the Internet:
• Success of Packet Switching relies on the ability of packets to be sent from sender to recipient along entirely separate routes from one another. • The moment a packet leaves, the fastest/least congested route is taken to the destination computer. • The packets can be easily reassembled in the correct order at the receiving end and any packets that don't make it can be requested again.
Symmetric / Asymmetric Encryption and Key Exchange:
• Symmetric/Private Key encryption - uses the same key to decrypt ciphertext as was used to encrypt plaintext. The key must also be transferred to allow decryption on the recipient's end which means it is vulnerable to hijacking/tampering/security problems. • Asymmetric/Public and Private Key encryption - uses 2 separate keys - one public and one private. Calculate the public key from the private key which itself is calculated from two, very large prime numbers. Both keys are need to decrypt.
Sampling Rate & Nyquist's Theorem: • Nyquist's Theorem: Calculation of Sound Sample Sizes (in Bytes!):
• The Sample Rate is how often a measurement of the sample is taken of the sound - frequency of the measuring (see Sampling above). The more samples taken for the length of the sound, the higher the audio quality but the more storage it will require. Unit = Hertz. • If the sampling rate is too low then the resulting sound digital sound file will be of a poor quality. If the sampling rate is too high then the resulting digital sound file will be too large to store. Hence we look to the Theorem. As the sample rate is the frequency at which the amplitude of a sample is measured, the theorem states that the sample rate must be x2 that of the highest frequency in the original signal. • Number of samples/second * number of bits per sample * length of the sample in seconds (unit = bits) (and /8 for Bytes.)
Advantages of Using Digital Signals:
• They can carry more information per second than analogue signals whether optical fibres, cables or radio waves are used. • Digital sound waves maintain their quality over long distances and can be boosted again. Each time an analogue signal is amplified, so is the noise, which means the signal sounds less and less like the original signal each time.
4.5.6.10 Encryption What is meant by the term 'Encryption': Caesar Cipher:
• This is the transformation of data from one form to another to prevent an unauthorised third party from being able to understand it. Plaintext is the original message. Ciphertext is the encrypted message. Key is the encryption method/algorithm, piece of info needed to encrypt / decrypt the msg. (Shift Cipher) A type of substitution cipher. It works by shifting the letters of the alphabet along by a given number of characters; the parameter being the key to this cipher. This cipher is based on computational security and is crack-able given enough time...
Why is it Easily Cracked?:
• To try and crack this cipher, even by brute force, there are only 25 possibilities that the key could be before the alphabet wraps around to the beginning again - 26 letters in the alphabet (but a shift of 0 = plaintext & ciphertext are identical). • Weak encryption. As soon as the key is sent over internet with the encrypted ciphertext, can be intercepted. • Cryptanalysis on longer messages would have you discover the most common ciphertext letter - and start by assuming it is one letter, and continue.
Role of An Assembler:
• Translates an ASSEMBLY CODE block into machine code for the computer to execute. It takes each instruction and converts it to the 0s and 1s corresponding to the value. Difference Between Source Code and Object Code: • Input into the assembler is called Source Code. • Output, AKA machine code, is the Object Code. Produces a .exe file.
Role of A Compiler:
• Translates high-level languages into machine code for the computer to execute. • Once the source code is inputted, the compiler scans it several times, each performing different checks & building up tables of info needed to produce the object code. • A compiler converts a whole block of code at once.
3. Laser Printer (Output) What is it? (Purposes, Suitability): ... Purposes - ... Consists of:... Principles of Operation: ...
• Type of printer used to print high volumes of documents quickly and quietly, in relatively high quality. Tends to print whole pages at a time. Good to use in the workplace because it functions quietly. Also cost-per-page of ink is lower than other printers so is more affordable. 1) Laser Beam 2) Charged cylinder - drum. 3) Mirror 4) Toner Powdered Ink 5) Finisher - uses heat and pressure as the paper passed into it to bond ink to the paper. Require a powdered ink, called toner. The printer generates a bitmap image of the printed page onto the paper inside, and using a laser unit and mirror, it 'draws' a negative, reverse image onto a negatively charged drum. Then, the laser light causes the affected areas of the drum to lose their charge. The drum rotates past a toner hopper to attract charger toner particles onto the areas which have not been lasered and the particles transfer onto the sheet of paper, and are finally bonded to it using heat and pressure.
Comparison of Approaches Advantages of Vector: Disadvantages of Vector: Advantages of Bitmaps: Disadvantages of Bitmaps:
• Usually has a much smaller file size and will scale perfectly, regardless of how it's being manipulated in terms of size. Use e.g. logo. • Therefore, due to a smaller file size, often use less memory and storage space, transmit faster and often load quicker. • However, a vector cannot easily replicate an image with continuous areas of changing colour such like a photograph taken with a digital camera. Quality is therefore then affected. • Individual pixels can be affected in the case of a bitmap image so it's good for photoshopping/touch-ups of imagery. E.g. digital photography photoshopping. • However, as said above, file sizes tend to be larger and therefore transmit times are longer, as with loading times and more.
4.5.6.1 Bit Patterns, Images, Sound and Other Data What is a 'Bit Pattern'?: How Do Bit Patterns Represent These Forms of Data? (Including graphics and sound):
A series of binary digits. For example, 010, 01010101010, 1111001011, 001011010, 001, 10. • Dependent upon the format in which the computer reads the binary digits. Such as, for an image, the first 4 bits of a Byte could represent the width, the next 4 being the height. The second Byte could include information about pixel resolution and colour and so on.
Data Types Define what is meant by a 'Data Type': User-Defined Data Type: Language-Defined Data Type:
A set of data with values having pre-defined characteristics, meaning it has been classed as type of data. E.G/ string, integers. Is something that the user of the program creates and defines a set of data values as. Means it is built into and recognised by the computing language used.
4.5.4.4 Numbers with a Fractional Part Floating Point Number Representation: Columns:
A type of number representation where the number used has a fixed number of digits after the radix point, or sometimes before. **Note: Syllabus states exam questions will offer a mantissa and exponents for floating/fixed point questions. 1/2 1/4 1/8 1/16 1/32 1/64 1/128 1/256 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.015625, ...
Pixels & Corresponding Binary Codes:
Each pixel is represented by a binary code. This binary code can vary in length. In the above example each pixel is represented using 8 bits. Using 8 bits would allow 256 colours to be represented. The binary codes for each of the pixels are stored in memory (either in RAM or in memory on the graphics card). The computer scans the block of memory and generates the required picture from the stored codes. In order to change part of the displayed picture the memory cells containing the binary codes would need to be altered.
What is meant by the term 'Imperative High-Level Language:
So-called b/c each instruction is basically a command to perform some step in the program, which consists of the step-by-step instructions needed to complete the task.
4.5.4.1 Unsigned Binary Columns: What is the Difference Between Signed and Unsigned Binary?: Minimum Value That Can Be Represented in Unsigned Binary for n bits: Maximum Value That Can Be Represented in Unsigned Binary for n bits:
128 64 32 16 8 4 2 u 0 (2^n)-1
Internal Hardware Components of a Computer Basic Internal Components of a Computer:
A computer system consists of internal and external components. The internal components are contained on the motherboard and include: • Processor • Main memory (RAM, ROM) • I/O controllers • Buses The external components are known as peripherals (on the edge or periphery) and some examples include: • Keyboard • Screen • Printer • CD/DVD drive • Hard disc drive
Viruses:
A program which replicates itself by attaching itself to other programs. Therefore, you need anti-virus software for protecting - this does not stop it getting into the system but can locate and destroy the virus - however, if a virus is threatening to get into a system for a 2nd time, the software can recognise it and prevent it. To do this, the anti-virus adds the virus to the dictionary after tackling it the first time. It may delete or quarantine the virus if it cannot be fully deleted.
3. Libraries. What is it? Need for/Functions of:
Are ready-compiled programs which can be run when needed, and which are grouped together in software libraries. Most compiled languages have their own libraries of pre-written functions which can be invoked in a defined manner from within the user's program. • These may include sorts and searches that have already been developed and tested, such as Quicksort and Binary Search; these sorts and searches can be used in any future program (saves re-writing them each time!). DLLs are examples of library programs that MS Windows uses.
Wireless Protocol CSMA/CA (with RTC/CTS): Purpose of SSID:
Each wireless network has a Service Set Identification (SSID) which is the informal name of the network e.g. BTHOME-789D3. When you log onto a wireless network you will need to select the network with the appropriate SSID and then enter a password (up to 32 bytes). Each wireless network has a Service Set Identification (SSID) which is the informal name of the network e.g. BTHOME-789D3. When you log onto a wireless network you will need to select the network with the appropriate SSID and then enter a password (up to 32 bytes).
4.5.1.6 Ordinal Numbers What Defines Ordinal Numbers?: Give Examples of Ordinal Numbers:
Objects placed in order/an array. S = {a, b, c, ...}
4.5.5.2 ASCII and Unicode Describe ASCII:
It can represent characters such as '@' in a computer by using a numerical representation the computer can understand which corresponds to the character. • It was developed to use 7-bits of a Byte as the numerical representation of characters in a computer. This allowed for the extra bit not used to be taken up by Parity, for example. • 7-bits allowed for 128 characters to be represented, and once 8-bit ASCII was developed, allowed for another 128 char's to be represented (256 total).
Define what is a 'Pixel': Bitmap Resolution:
The smallest identifiable area of the image. • This refers to the quality of image in that, if it is large in size and the resolution is small, not many pixels make up the image and it will be unfocused. However, a smaller image with a large resolution will have many pixels making it up, and will be sharp. • Careful: this does not determine the size of an image. • Commonly expressed as Width in Pixels * Height in Pixels (PPI) and DPI (dots per inch) for printer output.
Logical Bus: Operation: ... Advantages: Disadvantages:
This is a type of Ethernet network and this topology can be likened to a bus route where traffic moves along a single path. Information can be transmitted in either direction between any computers on the network. For this reason, security isn't great... • Relatively cheap because it requires the least amount of cable • It is easy to add another workstation without disrupting the network • Can be slow under a heavy load • If the cable fails at any point the whole network goes down • Finding a fault with the cable is difficult to isolate
4. RFID (Input) What is it? ... Passive Tag System: ... Active Tag System: ...
Uses radio frequencies to transmit data, timing signals and energy between a reader and RFID device. There is no electrical contact to transfer data. It can use either an Active or a Passive tag - Used to track and identify objects. - Can be read without line of sight up to 300m away. Consists of: **Transponder (If the reader is within range and sends a signal, it replies) 1) Antenna 2) Integrated Circuit **Beacon (Always sending a signal, wastes battery, even if the reader doesn't know because it's not in range...) 1) Battery 2) Antenna
4.6.1.4 Role of an OS What is the Role of an Operating System?: • It is a set of ... • It is held in ... • A computer system can be viewed as ...
programs that lies between applications software and the computer hardware and hides the complexities of the hardware from the user. permanent storage, E.G/ on a hard disk. A small program called the LOADER is held in ROM. Thus, when the computer is switched on, the loader in ROM sends instructions to load the OS by copying it from storage into RAM. a set of resources, comprising elements of both hardware and software and it is the job of the Operating System to manage these resources as efficiently as possible. The OS hides the enormous complexities of a computer system from the user.
4.5.3.2 Units Binary Units of Bytes: Decimal Units of Bytes:
• kibi, Ki, 2^10 • mebi, Mi, 2^20 • gibi, Gi, 2^30 • tebi, Ti, 2^40 • kilo, k, 10^3 • mega, M, 10^6 • giga, G, 10^9 • tera, T, 10^12
4.4.1.8 Problem Abstraction/Reduction What is Problem Abstraction/Reduction?:
Details here are removed until the problem can be represented in such a way that is possible to solve! Because the problem reduces to one which has been previously solved.
4.4.1.7 Data Abstraction What is Data Abstraction?:
Details of how data is represented/stored in the computer is hidden in this case [which allows new kind of data objects to be constructed from previously defined types of data objects.] • It is a methodology that enables us to isolate how a compound data object is used from the details of how it is constructed. • For example, when using real or float numbers in a program, we do not care for how these are actually represented in the computer!
Meaning of Nested?: Why is It Beneficial to Use More Meaningful Identifier Names?:
Inside another structure. For example, a nested iteration means a loop within another loop, such as a while loop within a for loop. • It's easier to understand what is going on and use correct variable names/Less Confusion. • Easier for someone else to read your code and understand it. • Easier to correct mistakes.
Circular Queue Implementation:
• To overcome the limitations of a linear queue, is to use a circular queue, so when the array fills and the rear pointer points to the last element of the array, say q[5], it will be made to point to the first element/q[0] when the next item joins the queue, assuming this cell is empty. This solution is less flexible than a dynamic structure if the max number of items isn't known in the beginning, and requires more effort by the programmer.
4.4.4.3 Order of Complexity (A2/NEW/Big-O Notation?) Introduction: Actual Order of Complexity:
"" O(n!) = most complex. Factorials. O(An) = anything with an exponent. O(n3) = polynomial time algorithm. O(n2) = nested loop. O(nlog2n) = logarithmic algorithm. O(n) = linear search or simple loop. O(log2n) = logarithmic. E.g. Binary search. O(n0) = No matter what n is, the result will always be the same number as the operand = most simple. • The order of complexity of a problem is taken to be the growth rate of the most efficient algorithm which solves the problem using Big O notation.
4.4.1.11 Automation What is meant by the term 'Automation':
Deals with building and putting into action models to solve problems / Once abstraction has been used effectively and the problem to be solved has been simplified an algorithm can be designed. This algorithm can then be automated which means implementing a solution on a computer. • For example, you could model the financial implications of running an ice-cream van at a given venue for a week... You'd need to think of: • creating and implementing algorithms related, then execute them and test the results...
Undirected Graph: Directed Graph/Digraph: Path: Closed Path: Cycle:
No set direction to follow from one node to another/axes do not have a direction they can travel - you can travel any way to any other neighbouring node. Therefore, edges are bidirectional. Axes have set directions you can follow - there are set ways of travelling from one node to another dependent on the direction of an edge connecting two nodes together. Sequence of edges between two particular nodes. Start and end at the same node. Closed path where all the edges are different.
Recursive Base Case: Recursive General Case:
Termination of a recursive process. A step in a recursive process.
4.3.5.2 Merge-sort Time Complexity of Merge-sort Algorithm: Trace:
You 'bubble up' the largest/smallest item, then the second largest/smallest, then the third, and so on, until no more swaps are needed and the data is ordered. Exaple of Divide and Conquer approach to problem-solving. O(nlogn) Pros: Very efficient for large list Cons: More complex to implement Numbers <- [45,62,13,98,9,50] NumItems <- Len(numbers) FOR I <- 1 TO NumItems FOR J <- 1 TO (NumItems - 1) IF Numbrs(j) > Numbers(J + 1) THEN Temp <- Numbers(J) Numbers(J) <- Numbers(J + 1) Numbers(J + 1) <- Temp END IF ENDFOR OUTPUT Numbers ENDFOR
Advantages of OOP: Disadvantages of OOP:
• No shared global data structures because communication between objects is via messages • Modification of an object's structure will have no effect whatsoever on any other part of the program • Inheritance saves much repetitive code • Can sometimes run slow because of the vast cross-referencing between objects • An object-oriented design is not always the most appropriate. Sometimes a functional design would be the most appropriate
Example of the use of a Single Array in VB: Example of the use of a Multi-Dimensional Array in VB:
• One-dimensional = useful way of representing a vector. • Two-dimensional = useful way of representing a matrix. • An n-dimensional = set of elements with the same data type that are ordered.
Used For: Overflow: Underflow:
• To store return addresses, parameters and register contents when subroutines are called (see below) • In evaluating mathematical expressions held in reverse polish notation If the stack is implemented as an array, an attempt to push an item onto a full stack would cause overflow, so an error message can be given to the user to avoid this. If the stack pointer is -1, the stack is empty and underflow will occur if an attempt is made to poop an item from the stack.
Records:
A record type groups together a number of variables which need not be of the same type. Structure TBook Dim Title As String Dim ISBN As String Dim Price As Decimal Dim YearOfPublication As Integer End Structure
Object-Oriented Programming Introduction:
This is where the world is viewed as a collection of objects. An object-oriented program is composed of a number of interacting objects, each of which is responsible for its own data and the operations on that data. Program code in this case creates the objects and allowed them to communicate with each other by sending messages and receiving answers.
4.5.1.7 Counting and Measurement Counting: Measurement:
Natural Real
How Do Functions Differ?: What Are the Advantages of Using Subroutines in Programs?:
• Functions return a value. Subroutines tend to carry out a process. In a large program - • Small enough to be understandable as a unit of code therefore relatively easy to understand, debug and maintain. • Can be tested independently which shortens the time taken to get a large program working. • Can be reused with confidence in different programs and also called more than once. • A large project becomes easier to monitor and control • Quicker to write a program with many working on it as each write a small subroutine simultaneously that fits together.
Global Variables in VB Contrasting Local Variables against Global Variables:
• Global variables are the default type used by Main Sub and can be accessed anywhere in the program. • Locals only exist whilst the subroutine is running. They cannot be used outside of the subroutine unless passed out into a parameter.
Examples of FSMs: State Transition Tables: Mealy Machines:
• Mobile phone • Wireless router • Controllers e.g. traffic lights, London Underground turnstiles, lifts • Personal Video Recorder (e.g. Sky Box) • This is an alternative way of representing an FSM. Usually shows; current state, input, output, next state. See notes for more help & a diagram. Named after George Mealy, is a type of FSM that's outputs are determined by the current state and the current input.
A TM Has Six Components: Universal Turing Machines:
1. Input alphabet 2. Output alphabet 3. Tape that is infinite in length 4. Tape head used to read contents of tape one cell at a time 5. Finite set of states including start state 6. A program in the form: (Current state, Input symbol) = (Next state, Output symbol, Movement) The problem with TMs is that a different one must be constructed for every new computation to be performed. - With a Universal Turing Machines (UTM), U is an interpreter that reads the description M of any arbitrary Turing machine and faithfully executes operations on data D precisely as M does. - The description M is written at the beginning of the tape followed by D. The read/write head must start on M and then move between M and D as M is executed. The UTM can go on then to simulate M by using the input D. - A UTM can thus simulate any other Turing Machine.
Procedural-Oriented Programming Describe the Structured Approach to Programming and Design: Designing Structured Programs:
Aims to improve clarity and maintainability of programs. • Makes use of local variables, • Makes use of white space and indentations, • Does not use "End" or "Goto" to finish a procedure, • Makes use of meaningful identifiers. • Top-Down Design = technique of breaking down a problem into smaller tasks to be performed. Each of these tasks is then further broken down into separate subtasks and so on until each subtask is sufficiently simple to be written as a self-contained subprogram.
4.5.1.2 Integer Numbers What Defines Integer Numbers?: Gives Examples of Integer Numbers:
All positive OR negative, WHOLE numbers. Z = {..., -2, -1, 0, 1, 2, ...}
Stacks Introduction: Application: Describe the following operations: • Push - • Pop - • Peek/Top - • Test for an empty stack - • Test for a full stack -
LIFO data structure, Last In First Out. Use could be such that when you go back a page in your web browser, it takes the first URL off the stack - most recently visited since, to reload to your web browser. • Can be implemented as either a static or dynamic data structure. Static needs 2 variables to be stored with it; one to record the max size of the array and one to record how many items are currently in it. Adds a new item to the top of the stack. Removes and returns the top item from the stack. Returns the value of the top element on the stack, without removing it. Tests to see whether the stack is empty, and returns a Boolean value. Tests to see whether the stack is full, and returns a Boolean value.
4.4.1.2 Following and Writing Algorithms What is meant by the term 'Algorithm':
What is meant by the term 'Algorithm': A set of rules or a sequence of steps specifying how to solve a problem. It always terminates. • For example, a cooking recipe...
Role of Stack Frames in Subroutine Calls The Role of call Stacks in subroutines: How is a call Stack used to hold return addresses?:
• A major use of the stack data structure is to store information about the active subroutines while a computer program is running. • The call stack keeps track of the address of the instruction that control should return to when a subroutine ends (return address). Subroutines could be nested so the stack may need to hold several return addresses so that control makes sure each routine completes fully.
Programming Paradigms What is meant by programming paradigms?: Paradigm #1: Procedural paradigm - Paradigm #2: Object-oriented paradigm - Paradigm #3: Imperative -
• A style of computer programming - different computer languages support tackling problems in different ways. Have a series of instructions that tell the computer what to do with the input in order to solve the problem. E.g. Python or Pascal. User uses objects, which are data items with all the processing possible on the data item attached to it. Objects are instances of a class which is the template for all its properties and methods. Objects of the same class share common properties and methods, but the values/content may change from object to object. E.g. Java, Delphi. Instructions executed in programmer defined sequence.
4.5.1.1 Natural Numbers What Defines Natural Numbers?: Give Examples of Natural Numbers:
All POSITIVE, WHOLE numbers. N = {0, 1, 2, 3, ...}
Uses: Operations:
• Output waiting to be printed is typically stored in a queue on a disk. E.g. people sending documents to be printed simultaneously, means whoever printed first, gets their first. • Characters typed at a keyboard, held in a queue in a keyboard buffer. • Queues are useful in simulation problems (one which attempts to model a real-life situation so things can be learnt about it) - E.g. Program simulating customers arriving at random times to check-outs in supermarkets, and taking random times to pass thru. Using a sim means the optimum number of check-outs can be discovered. • Adding an item - enQueue(Item) • Removing an item - deQueue(Item) • Testing whether the queue is empty - isEmpty() • Testing whether the queue is full - isFull()
Subroutines (Procedures/Functions) Step-Wise Refinement: What is meant by the term 'Subroutine':
• When solving a problem, breaking it down into smaller sub-problems is the key to finding a solution. This process is called step-wise refinement. We need to break programs down into subroutines. A subroutine can either be a procedure or a function. A procedure is a set of instructions that performs a specific task. A procedure is called with an instruction. A function is very similar to a procedure but returns a single value and is called from within an expression. A subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. It is a named block of code which is not in use until called and running during the execution of the program, and sits outside the main block of coding. It can be called within other subroutines.
FSM viewed as: Expressed using:
A Turing machine can be viewed as a computer with a single fixed program, expressed using • A finite set of states in a state transition diagram (essentially the diagram we use for mapping FSM's!) • A finite alphabet of symbols e.g. a binary alphabet of a, 1 and ☐ (the latter meaning a blank) - In other words, on each cell of the infinite tape is written a symbol. The symbols that are allowed on the tape are finite in number and include the blank symbol. - Each Turing machine has its own alphabet (finite set of symbols), which determines the symbols that are allowed on the tape. - The Turing machine has a tape head that is positioned over a cell on the tape. This tape head is able to read a symbol from a cell and write a new symbol onto a cell. The tape head can also move to an adjacent cell (either to the left or to the right). - A Turing machine has a finite number of states and, at any point in time, a Turing machine is in one of these states. When a Turing Machine begins running, it is in its start state and its tape head is positioned over one of the cells on the tape; the symbol on this cell is the current symbol. A Turing machine halts when it moves into one of the halt states.
Define what is meant by a 'Structure Chart': Advantage of Using Structure Charts?: What Are the Overall Advantages of Using the Structured Approach to Programming and Design?:
A more detailed hierarchy chart. Shows import and export of data, iteration and selection, Boolean points. Easier then to understand what exactly is happening when. • Easier for someone else to understand your code because the block of code will be separated by white space making each task more identifiable. • Comments will also help you and someone else understand your code. • It can help to make finding errors easier/better off to not make mistakes first time round.
4.4.1.5 Procedural Abstraction What is Procedural Abstraction?:
A representation of a computational method. It can be used to keep the actual values in a computation separate from the overall design THUS eliminating the need to change other parts of the program, if the design is changed. • In summary, the result of this is a procedure.
4.5.1.4 Irrational Numbers What Defines Irrational Numbers?: Gives Examples of Irrational Numbers:
CANNOT be expressed as a fraction. π, √2
4.5.1.3 Rational Numbers What Defines Rational Numbers?: Gives Examples of Rational Numbers:
Can be expressed as a fraction. Q = {1/2, 3/78, 1/8, 9/9, ...}
4.4.4.7 Halting Problem (A2/NEW) What is the halting problem?: Significance of the halting problem for computation:
Can you write a program that can tell if another program will halt or get itself into an infinite loop? Therefore, how long should you wait? (Leave the computer running forever or call it quits?) E.g. Is there an off perfect number? Where a perfect number has, all factors excluding itself, add together to make the number in question. E.g. 6 = 1+2+3. ""
Procedural & Functional help... See notes too!
Consider the process of summing natural numbers. If we add all the natural numbers up from 1 to n the sum can be calculated using the following two computations: • Sum n = ½ n (n+1) • Sum n = 1 + 2 + 3 + ... + (n-1) + n Both these equations are examples of procedural abstraction. They describe procedures and are examples of abstraction because they are both general equations in terms of n and the actual numbers to be used in the calculation are omitted. In order to achieve functional abstraction, we need to add on an extra layer of abstraction: Now we are not interested in how the sum of n numbers is to be computed. We could use either implementation and it would not affect anything. The computation method is hidden. The only thing we are concerned with is input(s) and output.
Node: Edge: Root: Child: Parent:
Contains the tree data. An edge/branch connecting two nodes together. The only node which has no incoming edges. The set of nodes that have incoming edges from the same node. Is the case for all nodes that are connected to it by outgoing nodes from this parent.
4.3.6.1 Dijkstra's Shortest Path Algorithm (A2/NEW) Introduction: In essence, what is it?: Applications of Shortest Path Algorithms:
Dijkstra was a Dutch computer scientist. Algorithm is designed to find the shortest path between one particular start node and every other node in a weighted graph. The algorithm is similar to a breadth-first search, but uses priority queue instead of FIFO queue. "" Travel - finds the shortest route from A to B via different junctions and road connections. Network - of computers, find the shortest path from Machine A to B. Social Network - on a website like Facebook, find the shortest path between two profiles, using friends as nodes in between.
Simple Tree-Traversal Algorithms • Pre-Order: • In-Order: • Post-Order: Uses of tree-traversal algorithms include: *Chapter 44 in textbook*
Drawing an outline of the tree starting left of the root. As passing the left of a node, you output the value. Used to produce prefix notation, used in functional programming languages. Starting left of the root, draw an outline. As you pass underneath each node, output the value. This visits all the nodes in sequential order. Starting left of the root, draw an outline. As you pass to the right of a node, output the data in that node. This is used in program compilation to produce Reverse Polish Notation.
• Selection: • Subroutine (Procedure/Function):
Executes a section of code depending on a Boolean result/condition to be met. Conditions are usually formed using relational operators (Boolean signs, e.g. <> or >...) For example, IF statement. Is a named block of code which performs a specific task within a program. Two types; procedures and functions for most high-level languages.
4.4.3.1 Back-Naur Form/Syntax Diagrams (A2/NEW) Meta-Languages: Syntax of a Language: (Explanation for the need of BNF)
In order to translate e.g. Python into Machine code, all the rules of the language must be defined unambiguously (manner open to only 1 interpretation). This is one reason why it is hard to get computers to understand 'natural language' e.g. English, as they are too imprecise and ambiguous with grammar and syntax. In Comp Sci, this is defined as the set of rules that define what constitutes a valid statement. It would be possible to define a valid identifier in a programming language using regular expression - but lengthy and time consuming. And some language constructs involving e.g. nested brackets, can't be defined this way. HENCE the need for meta-languages, such as Back-Naur Form. Many constructs that could be written with Regex can be done so with BNF more succinctly (clearly and briefly/concisely). (Syllabus point: why can BNF represent some languages which regular expressions cannot?)
Class = Object = Instantiation = Encapsulation =
Is a blueprint/template for an object, and it defines the attributes and behaviours (methods) of objects of that class. An instance of a class. Creation of a class, making a single object each time you instance the class. An object encapsulates both its state (values of its instance variables) and its behaviours or methods. All the data and methods of each are wrapped into a single entity so that if the attributes and behaviours of one object cannot affect the way in which another object functions - they are concerned solely with themselves - selfish! Binds together properties and methods which can manipulate the data of an object, wrapping it into this single entity (object) where if the data of one is affected somehow, it doesn't affect any other objects of the same/different class.
Pseudocode • Assignment: • Comments: • Nested Selection Inside Iteration: • Plain Selection: Other Information:
NumOK := false OR NumOK ← false Anything after a # While If - Then - Else Repeat - Until IF answer = 'Computer Science' THEN OUTPUT 'Of course it is!' ELSE OUTPUT 'Try again!' Pseudocode: is used in the Design stage and it allows the designer to write algorithms without the need to worry about the syntax of a particular language. Once the pseudocode has been written it can be converted to a programming language. This is the Implementation stage. R ← USERINPUT Area ← pi * r^2 Circumference ← 2 * pi * r OUTPUT Area OUTPUT Circumference • A program is a description in a programming language of a process that achieves some task that is useful to someone
4.3.4.2 Binary Search Time Complexity of Binary Search: Trace:
O(log n). Procedure P (Low, High, x) Found <- False Repeat Middle <- Int ((High + Low) /2) If List(Middle) = x Then Found <- True Else If x > List(Middle) Then Low <- Middle + 1 Else High <- Middle - 1 End If Until Found = True Or Low > High End P
Queues Introduction:
Queues are of a FIFO data structure. New elements only added to the rear/end of the queue, and elements only retrieved from the front/beginning. Described as "an ordered collection of items which are added at the rear of the queue and remove from the front."
Dynamic VS Static Data Structures: • Dynamic - • Static -
Refers to a collection of data memory which has the ability to shrink in size - the size of the structure does not have to be specified in advance of run time. This is managed with the aid of the heap, a portion of memory from which a free index can be assigned as the NEXT FREE variable value to anything added to the structure, and can take on an index value if an item is removed. - Useful for implementing data structures lie queues when the maximum size isn't known in advance. Fixed in size, the size of the data structure must be specified in advance of run time.
4.4.2.3 Regular Expressions (A2/NEW) Introduction: Uses include: Symbols:
Regular expressions are a tool that enables programmers and computers to work with text patterns. Matching patterns in text files (e.g. when searching for a word in a word processing program), by compilers to recognise the correct format of a variable name or the syntax of a statement and by programmers to validate user input (e.g. to check that a postcode or email address is of the correct format). • Programs like Java and Python support the use of regular expressions. • Regular expressions are often referred to as 'patterns'. See notes...
Composition aggregation = Polymorphism = Overriding = *Difference =
Stronger form of aggregation. If the container is destroyed then every instance of the contained class is also destroyed. For example: - If a hotel is destroyed then every room in the hotel is destroyed. Refers to a language's ability to process objects differently depending on their class. An example of this is Overriding. This is an example of Polymorphism. This means that a method, for example, inherited by a subclass from a parent class, may have a different implementation than the same named method the parent class has. *Difference - Overriding just refers to different implementation between methods derived from a parent class that the child class now has. Polymorphism expands this, such as, another example would be how a function varies depending on the number of parameters passed in. The polymorphic aspect here is the different implementation the function works with depending on the number of parameters it accepts as arguments.
4.4.5.1 Turing Machine (A2/NEW) Introduction: How Can it Be Expressed?: Importance of the Turing Machine:
The Turing machine consists of an infinitely long strip of tape divided into squares. It has a read/write head that reads symbols from the tape and makes decisions about what to do based on the contents of the cell and the machines current state. • Thought of as a primitive, abstract computer. Theoretically, anything that can be represented as Turing Tape is computable. It's an FSM with the addition of an infinite memory on tape. A Turing machine must have at least one state, known as a halting or stop state, that causes the machine to stop for some inputs. "" ""
4.4.1.9 Decomposition What is meant by the term/process 'Decomposition':
The breaking down of a complex problem into a number of sub-problems, each of which performs an identifiable task.
4.4.1.10 Composition What is meant by the term/process 'Composition':
The combining of several procedures to form compound procedures. It can also mean combining several objects to form compound data. • For example, records or data structures such as a tree or queue. • Bottom-up testing where subroutines are tested individually and then these are combined into sub-systems which are then tested etc.
4.4.1.6 Functional Abstraction What is Functional Abstraction?:
The result of this is from firstly, a procedural abstraction, and then another which disregards the particular computation method. • The particular computation method is hidden in this type of abstraction, because it is of no concern to the user. • For example, using a database, you sort records in a certain way, but you don't actually know how this is done, it just happens.
Hand-Tracing Algorithms:
Trace tables are used to test algorithms to make sure that they contain no logical errors. The process of hand tracing an algorithm involves working through the algorithm on paper line by line and recording the values of all the variables so you can see clearly what an algorithm produces.
Recursive Techniques Use of recursive techniques in programming: Characteristics:
• A subroutine is recursive if it is defined in terms of itself. The process of executing the subroutine is recursion. • A recursive routine has 3 characteristics; 1- stopping condition must be included, which when met, means the routine won't all itself and will start to unwind. 2- for input values other than the stopping condition, the routine must call itself 3- the stopping condition must be reached after a finite number of calls.
Priority Queue Implementation:
• Acts like a queue in that items are de-queued by removing them from the front of the array, but the logical order of the items is determined by their priority, with higher priority at the front and decreasing throughout/lowest at the rear. Therefore, it is possible for new items to join at the beginning instead of tagging on at the back. • Such as queue would be implemented by checking priority of each item in the array, starting at the rear and moving it along one place until an item with the same or lower priority is found, at which point the new item can be inserted.
Abstract Data Types/Data Structure Summary:
• An ADT is one whose data type properties are specified independently of any particular programming language. E.g. Queue, Stack, List. Therefore, their implementation does not rely on the language/change from language to language. It is abstract and therefore the programmer chooses how to implement it. • It is a way of looking at a data structure, a way of looking at how data is viewed in a computer.
Linear Queue Implementation:
1. As items leave, all others move up one space so the front of the queue is always the first element of the structure. E.g. q[0]. With a long queue = requires significant processing time. 2. It can be implemented with pointers to front and rear. An integer is needed to hold the size of the array and a variable to give the number of items currently in it - can work out how much free space there is. Problem arises as things are deleted from the front as nothing moves up, just the pointers change, and so the free memory is not filled again...
Programming Concepts • Sequence: • Assignment: • Iteration:
2 or more statements following one after the other, in order of writing. An assignment statement assigns a value to a named location in memory. A named memory location is called a variable. Means repetition. Refers to the looping of code a number of times. Depending on whether the loop is definite or indefinite, it will either have a set number of repeats to complete or will wait for a condition to become true to finish the looping. For example, For statement/While statement/Do statement.
- Graph: - Weighted Graph: - Vertex/Node: - Degree of a Vertex/Node: - Automation: - Edge/Arc:
A graph is a set of vertices or nodes connected by edges or arcs. Those edges can be 1 or 2 way. When axes are labelled / "Labelled graph". Therefore, the edges are given a value. .. Number of neighbours it has. Turning an abstraction into a form that can be processed by a computer... The connection between two nodes/vertices.
Define what is meant by a 'Hierarchy Chart': Limitations of Using Hierarchy Charts?:
A tool for representing the structure of a program, showing how the subprograms relate to each other to form the complete solution. It is depicted as an upside-down tree structure. The idea is, you keep breaking the problem down until you get problems small enough that they can be solved easily - Divide and Conquer. A Hierarchy Chart shows this process pictorially. It doesn't show the detailed program structures required in each module. For example, it doesn't show selection and iteration.
Trees • A tree is ... • A rooted tree ... • A binary tree is ... • A binary search tree is ...
A tree is a data structure. They have no cycles and are undirected. It doesn't have to have a root. ... A root, branches and leaves. One vertex has been designed as the root and each edge leads/is directed away from this root. ... A rooted tree in which each node has a max of two children. Therefore, each node can have only 0, 1 or 2 kids. ... A binary tree that holds items in such a way that the tree can be searched quickly and easily for a particular item, and items can be easily added, and the whole tree can be printed in a sequence. It is again a typical use of a rooted tree.
Constants and Variables in a Programming Language Define what is meant by a 'Variable': Define what is meant by a 'Constant':
A variable is a memory storage location of data that can change during normal execution of the program. Therefore, variables can change, but this isn't always the case. The variable name for a data item is also referred to as the 'identifier'. A constant is a set value stores under an identifier that can only change if the user does so manually, therefore it cannot be altered during normal execution of the program.
Data Structures What Are Data Structures?:
A way of storing data in an efficient and organized way inside the computer. Languages like VB and Pyton have some built-in data structures like string, array or list and record.
Graphs Introduction: Typical uses for graphs include:
Abstraction of a map can produce a graph model. • To represent computer networks, with nodes representing computers and weighted edges to show the bandwidth between them. • Roads between towns, with weighted edges to show the distances, rail fares or journey times. • Tasks in a project, some of which have to be completed before others. • States in an FSM. • Web pages and links.
4.4.4.5 Classification of Algorithmic Problems (A2/NEW) Non-Computable: Decision Problem: Undecidable: Tractable: Heuristic Approach:
An algorithmic problem that admits no algorithm. It is not computable because no solution can be produced. A Y/N algorithmic problem. For example, an algorithm which decides if a number is a prime or not. If a Decision problem has an algorithmic solution, it is said to be decidable. A non-computable decision problem. E.g. you know the answer but cannot compute a solution, such as "This statement is false." True/False? - It does not have an algorithmic solution/is non-computable. A problem that can be solved within a reasonable amount of time (polynomial time). Intractable: A problem that is computable but for which no reasonable time solution has been found (polynomial time). E.g. the Travelling Salesman problem, where 5 cities means for 24 routes, but 23 cities would take 51 years to solve... => Educated Guess/Approximations. Using knowledge and experience to guess at a solution to an intractable problem. This will not necessarily result for the most optimal solution to an intractable problem, but a sufficient solution all the same.
Single and Multi Dimensional Arrays What is a Single Array?/One-Dimensional: What is a Multi-Dimensional Array?:
An array is defined as an finite, ordered set of elements of the same type. Finite means there is a specific number of elements in the array - that it has a capacity to store - and ordered implies there is a first, second, third, etc. An array can have one or more dimension. A two+ dimensional array can be visualised with a table. It helps the user cut down on the number of other variables needed, such as values stored in two separate arrays, could be pushed into one if made 2 dimensional.
Files in VB - Member's:
Append = File opened to append to it. Binary = File opened for binary access. Input = File opened for READ access. Output = File opened for WRITE access. Random = File opened for random access.
Implementing a Graph: • Adjacency Matrix. • Adjacency List.
As a 2D array. Drawn as a grid, with a 1 if a node neighbours, and a 0 if not. Therefore, stores everything. -ve = if the matrix has many nodes without many neighbours then its storing lots of 0s = wasted space. +ve = easier to be created because everything is stored and its quicker to do. Mentions Vertex number and then records the numbers of its neighbouring nodes. -ve = more difficult to change what is stored because not everything is. +ve = stores just what you need/connected to. Note: Weighted graph/list = have to store neighbour and the value of the edge.
BNF Examples See notes for Syntax Diagram tools...
BNF: • Structure - composed of a list of statements of the form; LHS ::= RHS where ::= is interpreted as 'is defined by' E.g. <point> ::= . <point> is a meta-component/syntactic variable. | means 'or', another meta-symbol. E.g. <digit> ::= 0|1|2|3|4|5|6|7|8|9 1. Write the BNF definition of a variable which could be a single letter of letter followed by a digit. <variable name> ::= <letter> | <letter><digit> <letter> ::= A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z <digit> ::= 0|1|2|3|4|5|6|7|8|9
4.5.2.1. Number Bases Decimal: Binary: Hexadecimal: Why is Hexadecimal Used as Shorthand for Binary?:
Base of 10 Base of 2 Base of 16 1. Easier for anyone to read & understand bc shorter & more use-able (e.g. on printed items) 2. Much shorter way of representing a byte of data in 2 digits. 3. Fewer mistakes likely to be made in writing a Hex number. 4. Easier for technicians to write/remember.
Inheritance = Association aggregation =
By means of inheritance, new classes (descendants) can be derived that inherit properties and methods from a parent-class. They can have new properties and methods of their own too. The class you start with is called the base class. Uses an "Is a" relationship between 2 classes. E.g. a Human is a Mammal. Type of association. It can occur when a class is a container of other classes, but the container classes don't have a strong life-cycle dependency on the container. For example, - A player who is part of a team does not cease to exist if the team is disbanded... As opposed to Inheritance, this has a "Has a" relationship. E.g. a Teacher has a student, and a student has a teacher. Therefore, there is no ownership between the two objects and each has their own life-cycle and can be created and deleted independently.
4.4.1.4 Information Hiding What does this mean?/What is it?:
Hiding design details behind a standard interface For example, an interface which hides the system behind it so the user isn't confused by a load of code they cannot understand and can work their way around the system. [Abstraction means to leave out unnecessary details.]
4.4.2.1 Finite State Machines with and without Output What is a Finite State Machine?: Rules: Usage of FSMs:
It is a model of computation used to design computer programs and sequential basic circuits. • It's an abstract model of how a machine reacts to external events, not a physical machine e.g. washing machine... Changes from one state to another when triggered by some state and only has a finite total of states. 1. Can only be in one state at any one time. 2. Can change from one state to another in response to an event/condition - called Transition. 3. The FSM is defined by a list of its states and conditions for each transition. • Widely used in modelling the design of hardware digital systems, compiles and network protocols. • Also, used in the definition of languages and whether a word in a language is acceptable, etc. • An FSM with no output is known as a Finite State Automaton. Has a start state and a set of accept states which define whether it accepts/rejects finite strings or symbols. • If, when you are in a particular state, the next state is uniquely determined by the input, it is a deterministic final state automaton. *Accept/stop states have double circles.
4.4.1.3 Abstraction Computational Thinking:
Is a vital skill for a programmer and it involves thinking about how a problem can be solved. The 2 steps to solving a problem are: 1. Stating the problem in such a way that it is potentially solvable using an algorithm 2. Attempting to construct an efficient algorithm to solve the problem • Computational thinking involves thinking logically and applying the tools and techniques of computing to think about, understand, formulate and solve problems. Computing is sometimes referred to as the automation of abstractions.
What is the concept of 'Abstraction': • Representational Abstraction • Abstraction by Generalisation
It can be defined as "a representation arrived at by removing unnecessary detail" For example, ANY computer model of say, a flight simulator, IS an abstraction. For example, London tube map model. Simple model of the actual geography of the Tube Stations. • NOTE: The more you simplify your model, the less likely it becomes that the model will mimic reality due to stripping away details that could be important... Grouping by common characteristics to arrive at a hierarchical relationship of the 'is a kind of' type.
4.5.1.5 Real Numbers What Defines Real Numbers?: Give Examples of Real Numbers:
No Negatives... Set of 'all possible real world quantities'. R = {Natural, Rational, Irrational}
4.3.4.3 Binary Tree Search (A2/NEW)
O(log n). ""
Linear Search Time Complexity of Linear Search Algorithm:
O(n). Procedure P () Found <- False For x = 1 to Items in the List If ItemSought = x then Found <- True End For
Paradigm #4: Functional - Paradigm #5: Logic / Declarative - Paradigm #6: Event driven -
Program consists of functions which are the fundamental building blocks of a program. Statement are written as a series of functions. which accept input data as arguments and return an output. E.g. Haskell. Using a declarative language that consists of facts and rules about a particular subject instead of a sequence of instructions. E.g. SQL, you give statements that describe the problem to be solved and the language implementation decides the best way of solving it. The flow of program execution is determined by events. For example, a subroutine is executed in response to events such as the click of a button. E.g. VB.net.
Define what is meant by 'Scope':
The scope of a variable refers to the visibility of a variable and which parts of the program can see it. Some variables have a global scope and some have a local scope. Local scope means only the sub it is used in can see it. Global means every subroutine can see it.
Subtree: Leaf-node: Implementation of a Binary Search Tree: 1. One 3D Array. 2. Three 1D Arrays.
The set of nodes and edges comprised of a parent and all descendants of the parent - a subtree may also be a leaf. A node that has no children. • Beginning 1, stores Data. Beginning 2, stores to the Right of the data. Beginning 3, stores to the Left of the data. • 3 Separate for; Data, Array position for data on the right, Array position for data on the left.
4.4.1.1 Problem-Solving Developing Solutions to Simple Logical Problems: Checking Solutions to Simple Logical Problems:
• Solving logic problems shows good computational thinking as it means you think logically about how to combat the issue and apply techniques for solving it. ""
Reverse Polish - Infix Transformations Introduction: Advantages & Uses: Precedence of operators acting upon operands:
• Also called Postfix. Developed by a Pole named Jan Lukasiewicz. • Method of writing arithmetic expressions that are particularly suited to computerised methods of evaluation. Eliminates the need for brackets un a sub expression, produces expressions in a suitable form for evaluation using a stack and it is used in interpreters based on a stack e.g. Bytecode and Postscript. • The way we would normally write an arithmetic expression is called Infix. The output value after RPN is called Postfix. = ( +-) */ ^ exponentiation/powers/indices, meaning e.g. 3^2 = 32 ~ unary minus, meaning e.g. -3+2 Rule: .... * before + or???...
4.3.5.1 Bubblesort Time Complexity of Bubblesort Algorithm: Trace:
• Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing two items at a time and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. O(N^2) Pros: Very simple and easy to implement Cons: Inefficient for large lists Procedure P () i: Integer Swapped: Boolean Repeat Swapped ← False For i ← 1 to n - 1 do If List (i) > List (i + 1) Then 'Swap the records Swapped ← True End if Next i n ← n - 1 Until n = 1 or Swapped = False End P Procedure Swap(x: Int, y:Int) Temp: Integer Temp <- x x <- y y <- Temp End Swap
How is a call Stack used to hold parameters?: How is a call Stack used to hold local variables?:
• Each call to a subroutine will have any parameters be given a separate space on the call stack for these values. E.g, [local variables for subroutine] [return address] [parameters for subroutine] • Local variables declared inside a subroutine may be held in the call stack whilst the sub is active. Each separate call to a subroutine gets its own space on the stack, like with parameters. Storing local variables on the call stack is more efficient than using dynamic memory allocation, which uses heap space. **A call stack is composed of stack frames. Each stack frame corresponds to a call to a subroutine which hasn't terminated yet.
4.4.2.4 Regular Language (A2/NEW) Reason for:
• English is a natural language. You learn to speak it. They have common features - Comparising of a set of words. - Governed by rules that define grammar/syntax of a language. However, the syntax of a natural language is not always unambiguous, complete or concise. • Formal Language consists of - An alphabet - Rules of Syntax. For the formal language, the alphabet is a finite set and the syntax is clearly defined - unambiguous. Therefore, they are used to describe things like programming languages. BNF and RPN count under here.
4.4.4.6 Computable and Non-Computable Problems (A2/NEW - Links with Turing Machine - Definition of Computable)
• If no algorithm exists to be able to solve a problem then it is said to be non-computable. (non-solvable) For example, the Tile Problem. • Turing's hypothesis (also known has Church's thesis) is a widely-held belief that a function is computable if and only if it can be computed by a Turing machine. This implies that Turing machines can solve any problem that a modern computer program can solve. In other words, if a problem cannot be written for use by a Turing machine, it cannot have a programmed solution by a modern-day computer - hence it being a non-computable problem. If a problem can be reduced to 0s and 1s, it is computable. If an algorithm exists, there is an equivalent Turing Machine for it...
Typical uses of rooted trees include: Uses of Binary trees include:
• Manipulating hierarchical data such as folder structures or moves in a game. • Making information easy to search. • Manipulating sorted lists of data. A binary tree is useful for storing items that arrive in random order but that need retrieving quickly e.g. a dictionary for a word processor. By performing an in-order traversal the items in the tree can also be retrieved in alphabetical or numerical order.
Local Variables in Subroutines Characteristics of Local Variables Declared Within a Subroutine: Why is it Good Practise to Use Local Variables?:
• Only exists inside this routine. • Is only accessible within this routine. • Can be passed out of this routine into another as a parameter. • Less chance of the code coming across an error or the programmer making an error by calling the wrong variable name if similar. (less accidental errors) • Easier to debug the code to find errors. • Is easily portable for someone else to use just one subroutine etc.
Simple Graph-Traversal Algorithms Breadth-first & application: Breadth first searches are used to solve many real-life problems including: Depth-first & application: Depth first searches are used to solve many real-life problems including:
• The breadth first traversal algorithm begins at the root node and explores all neighbouring nodes. Then for each of those nearest nodes it explores their unexplored neighbours and so on (uses a queue) • Shortest path problem between two points (Dijkstra). This is really important in GPS navigation systems and computer networks • Facebook. Each user profile is regarded as a vertex in a graph and two vertices are connected if they are each other's friends • The depth first traversal algorithm begins at the root node and explores as far as is possible along each branch before backtracking (uses a stack) • Job scheduling. This is where a series of tasks need to be performed and certain tasks must be completed before the next one begins • Solving problems such as finding the way out of a maze and working out possible chess moves
Fields, Records and Files Introduction: 1. Text file: 2. Binary file: Writing/Reading from/to a Text File in VB: File(Channel #, "TextFileName.txt", OpenMode.Member)
• When we save a program we are working on, we can lose any data we entered. If we want to save the data so it can be reloaded into the program at another time, we use a file to store it. Two common types of file are text file or a binary file. Is used to store text based characters. If opened in a text editor the contents will make sense. Is used to store any type of data. If opened in a text editor the contents will not make sense. File(Channel #, "TextFileName.txt", OpenMode.Member)