Computer Science Revision

Assembly

Low level languages

principles of programming

Networks

Programming in a low level programming language such as an assembly code, requires knowledge of the internal structure of the CPU therefore it is very specialised

Program Construction

Program statements are written for certain types of CPU and make direct reference to specific registers

security and data management

Operating Systems

Assembly code is close to but not machine code. it uses mnemonics instead of the 1's and 0's that are used in machine code meaning it is easier to understand and use for programmers

Network security

An operating system is the software that manages a computer system. The operating system is loaded by the bootstrap loader (stored on ROM)

Translators

Disadvantages

A high level programming language allows code to be written in a natural human language which is very close to English.

Each computer has its own assembly language and machine code so therefore any code written for one type of CPU will not work on any other type of CPU

Some programmers prefer to use high level programming languages because:

Originally all computer programs were written in low level languages but over time high level languages have been developed which are closer to written english and are easier to learn and use for most programmers

They are easier to understand, learn and program, as their commands are similar to natural languages like English

Most programmers these days use high level languages to code their programs as they are easier to learn, use and edit if you make a mistake

The names of variables/identifiers can be long and meaningful, making programs easier to understand

They closely resemble pseudo-code algorithms

Machine code

machine code is written in bit patterns (instructio0ns and data) that can be executed directly by the CPU

Operating systems can be split into 2 types; GUI and Command Line Interface

High level language must be converted into machine code before they can be executed by the CPU, whereas machine code does not

Command Line Interface

They are quicker to input commands as you can use shortcut keys

Low level languages

Little memory and processing power is needed as they do not have to process graphics

programming in a low level language such as assembly code requires knowledge of the internal structure of the CPU and is therefore very specialised

Assembly code uses mnemonic (an abbreviation for an operation) and is converted to machine code for execution using an assembler

You dont need much storage space (there are no graphical images to store)

If you have memorised the commands it is very fast to use

Instructions cannot be guessed and therefore it is very difficult to use for beginners

Commands have to be typed precisely, and there are a large amount of commands that you have to learn to be able to use it accurately and quickly

GUI (WIMP)

Risk to data become greater as it is shared across a network

Unauthorised access to a network can allow the hacker to see all of the stored data

They are user friendly and colourful

To secure a network requires appropriate level of access (restricting people to the data/software they need to do their jobs), secure passwords and encryption (coding the contents of emails. etc)

There are no complicated commands that you need to learn as you select options by pointing/clicking

You can easily customise a GUI to your liking and make it fit your personality

Data can be easily exchanged between different software applications

Takes up a lot of hard disk space, RAM and processor time

Can be slow for an experienced programmer to use

User access levels

WIMP stands for;
Windows - the screen is made up of areas called windows
Icons - small pictures used to represent commands or files
Menus - menus allow a user to make selections from a list
Pointers - the arrow that appears when using Windows

it is not sensible or safe for every network user to have access to all the data on a computer system

User access levels define which users can change and view, view but not change, not view stored data

It will also specify what software they can or cant access

Suitable passwords

passwords add an additional layer of security when accessing a computer system

A network is a number of computer systems connected together

Strong passwords may require the user to use a combination of upper and lower case letters, numbers and symbols such as !~-/\%

Advantages include;
Sharing peripherals, Sharing software and Sharing data

Other users can guess short simple passwords, or a hacker may have access to programs that brute force attack - trying multiple guesses or in quick succession until the correct password is found

Centralised backup, centralised maintenance and the ability to access data from any computer are also all advantages

Computers can only execute binary machine code instructions. A program written in another language must be converted into machine code before the program can be run

Requirements and Connectivity

A network manager may need to be employed

we use the term 'translators' to cover all the types of software that convert code from one form to another. Compliers, interpreters and assemblers are all types of translators

Hackers can gain access to more data easliy

If the server is down all workstations on the network are affected

The initial cost of setting up a network (servers, communications devices, etc.) can be expensive

Compliers

A complier translates a source code program into machine code and creates an executable file that can be run in the future without the need for recompilation. There are four compilation stages:

Connectivity is the process of connecting parts of a network together to allow data transfer.
Without connectivity, data could not be easily exchanged between computers without the use of removable storage

Wired Connections use a wired connection protocol e.g. CAT6 cabling using Ethernet

Lexical Analysis
Comments and unnecessary spaces are removed
Keywords, constants and identifiers are replaced by 'tokens' (strings to identify each part)
Some simple error-checking is performed; is an identifier name too long?, attempts to assign an illegal value to a constant, such as a value of the wrong type
A symbol table is created of all the parts of the code:
For example:

table

Syntax analysis
Tokens are checked to see if they match the spelling and grammar expected, using standard language definitions.
This is done by analysing each token to determine if it uses the correct syntax for the programming language.
If syntax errors are found, error messages are produced

Semantic Analysis
Variables are checked to ensure that they have been properly declared and used.
Variables are checked to ensure that they are of the correct data type, e.g. strings are not assigned to intergers.
Operations are checked to ensure that they are legal for the type of variable being used, e.g. don't store division in an integer

Code Generation
Machine code is generated.
Code optimisation may be employed to make it more efficient, faster and allow it to be less intense on your computers resources

Truth Tables

NOT gate

The NOT gate is the simplest as the there is only one input and output. The output is always opposite of the input in a NOT gate. for example if the input is 1 the output will be 0 and vice versa