Thursday 26 September 2013

Code

Logic Gates
Binary is the foundation of all computer systems. It is the simplest form of script made up of solely 1s and 0s. There are also different processors called gates:

  • AND gates require both inputs to be set as 1 for the output to be 1.
  • OR gates require at least 1 of the inputs to be 1 for the output to be 1.
  • NOT gates only have a single input, they output the opposite of the input.
These are the simplest form of gates, examples are displayed below.

AND Gates

NOT Gates


OR Gates

You can also combine 2 or more gates:
AND NOT Gates

Binary
Binary is a numerical system in base 2. This means it represents numerical values using two symbols, in this case 1 and 0. A single number is a bit, a group of four numbers is a nibble and a full eight numbers is a byte. A zero represents nothing and a one represents a number, which go up in powers of two. Therefore  a number 9 in binary will be:

8421
1001

as 8+0+0+1=9.

More can be found here.


Hex
Also known as hexadecimal, hex is a base 16 numerical system. The first unit represents a multiple of 16 and the second is a number added to the first. The second unit can be a number up to 9 or a letter up to F. 1-9 stand for themselves and A-F represent the next numbers to 15.



ASCII


ASCII (American Standard Code for Information Interchange) is a set of 127 characters (95 printable and 35 not) and the null code (00000000) devised by the American Standards Association for use as the main characters in telegraphs. It originally used 7 bits but as 8 bit computers became the norm, it was extended to 8 bits so 128 more characters could be added. One character is one byte.

Instruction Sets
An Instruction set is a list of all of the instructions needed in a computer for a processor to execute. These will usually include common mathematical processes, logic gates, data instructions (such as move, input, load and store) and control flow instructions.These lists are different for each brand of processor and sometimes each generation. These instructions are stored in binary  and the CPU has to decode them  so it knows what to do. There is two parts of an instruction, the operator and operand. The operator tells the CPU what to do. and the operand tells the CPU what to apply the operation to.

Sound
Sound is an analogue energy form. To store it on a computer we need to convert it into a digital one. To do this we measure the frequency/loudness etc at equal intervals. These are called samples. The bit rate is the number of bits sampled in a given time. Sound files are often quite large, this means we often have to compress them into a file format like MP3. Algorithms are devised to remove parts of the data people are least likely to hear.


Images
Binary data can represent images and store them as bits. Pictures are shown as a series of coloured pixels. The metadata is located at the start of the image in binary and give information such as resolution, colour depth, width and height. Without this the image would simply be a string of  ones and zeros. Colour depth is the number of colours that can be represented in the image. A depth of 1 bit will represent 2 colours (1 and 0). 2 bits allows 4 colours and so on. These are called bit mapped images. You can also store an image as a vector graphic. This defines them as formulae and define the points, lines and curves of the image rather than storing them as pixels. This means they can be enlarged without being distorted as the image is simply recalculated rather than enlarging each pixel.

Development Software
You need certain pieces of software to develop software. These are used to write the code that makes the program work.

Editors:
These are usually a cut down word processors that save the words but not the formatting. We use these to write the main operations of the program. You can also use software that utilises "pretty printing". This will detect things like loops, variables etc. Some will even add line numbering to help with debugging.

Compilers:
These will convert high level level languages into machine code the CPU can run. You will need a different compiler for each programming language (e.g python etc.) 

Interpreters:
Interpreters do a similar function to compilers although they do it a line at a time and execute as they go. This uses a lot more RAM and you need the correct interpreter if you ever want to run the program. It is also slower. e.g. C++

Assemblers:
Assembly language is a convenient way to write base machine code that isn't in binary. It uses a set of mnemonics to represent machine operations and is specific to the processor it runs on.

Linkers: 
Linkers are for 'glueing' modules of an application written by separate programmes in separate languages to make sure there are no conflicts.


Monday 23 September 2013

Hardware

 CPU
A CPU, or Central Processing Unit, is the most important part of a computer, there are 2 parts in the CPU, the control unit and the ALU. The control unit is for controling the data flow and the ALU is for performing arithmetic and logical operations. It controls the processing and executes the instructions stored in computer programs. To do this, the CPU has to access two things. The RAM and the cache memory. The RAM, or random access memory, is where the programs waiting to be run are stored. The cache memory is where we store data waiting to be processed, it is close to the CPU so it can be quickly accessed by the processor, therefore making the frequently used data easy to find. These are called primary storage. Secondary storage is the hard drive and any other device like it, for example, USB flash drives or SSDs, this is where data is stored when the computer is off/not in use. The CPUs main function is the fetch-execute cycle. The CPU processes programs from the main memory, then it fetches the next instruction, decodes it and executes it. 


Memory
    • RAM (random access memory) is the information stored to be accessed quickly from random locations. This is volatile data so if the computer powers off the data is lost. The RAM usually consists of the os on load up as well as any programs you are running etc.
    • ROM (read only memory) is a type of "built-in" memory that is capable of holding data and having that data read from the chip, but not written to. Unlike Random Access Memory (RAM), ROM is non-volatile which means it keeps its contents regardless if it has power or not. It is usually very small and used to store the files used for boot up.
    • Virtual memory is used when the RAM is fully used up. When there isn't enough RAM to cater to all the demands of the system, a section of the hard drive is used to store data in the RAM that is not currently used whereas it is loaded into the RAM when and if it is needed. This makes for considerably longer times when switching between programs as the system has to load the program from the virtual memory to the RAM before it can be used.
Input/Output Devices

A computer needs to be able to to get data and information in and out of its system. To do this we use Input and output devices. Something sends data to the system which interprets it and sends an output, through the same or a different device. Common examples of these devices are keyboards and mouses. A revolutionary new idea for these devices are the new steam controller, this uses haptic feedback to enhance your game. The input would be you using the controller and the output would be the game playing and receiving haptic feedback.

Secondary Storage
Secondary storage is used to store data when the power is off (non-volatile). There are three common types of secondary storage:

  • Magnetic hard disk:
  • Optical Disk
  • Flash(Solid State) Memory

Wednesday 18 September 2013

Data Protection


The data protection act and the computer misuse act are laws, declared in 1990 and 1998, to protect personal data you have stored on computers or the internet. With more and more people and businesses using computers to store private data, the government needed to find a way of regulating:
  • Who had access to this information?
  • How accurate it was
  • Was it easy to find and copy?
  • Was it stored with the persons permission?
  • Did anyone keep record of changes made to the databases?
What spawned was the data protection act and computer misuse act, it meant people could be charged and punished for:
  • Unauthorised access to private data
  • Unauthorised modification to private data
  • Unauthorised access with the intent of committing a crime
People like MI5 were exempt from this and if it was data stored for personal use (e.g friend's addresses in a contact book etc) was also allowed.

There are many reasons these acts are important, especially the data protection act. Without them, children and technologically unwise people could legally have their contact data online for anyone to access. Children' medical and contact records could be accessible to potential criminals and some naive kids might put their parents bank details online making fraud more common.

Thursday 5 September 2013

A Computer System

What Is a Computer System?

A computer system is a system that can process a set of inputs to find a set of outputs using hardware and software.

What is Reliability?
The reliability of a system is the fact you know it will never break or malfunction while you are using it. Issues with the system can cause inconvenience, loss of money or in some minor cases, death.

Embedded System

An embedded system is usually a mix software and hardware used for one specific purpose. These can range from the small, simple system in a vending machine to the complex control unit used to manage an aircraft's engine. Often peoples lives rely on these systems so they have to be rigorously tested and inspected to make sure they work.