Followers

Monday, 4 April 2011

Character Coding Schemes

ASCII
- Uses 7 bits so can therefore represent 128 different characters.
- A different binary number is assigned to each character.
Example- The letter A has a binary number assigned to it - 1000001
- Some of the characters are control codes, such as tab.
- The 8th bit is used usually for error checking.
- Extended ASCII uses the 8th bit in a byte to code more than characters, such as symbols like copyright and characters in french.
- Digits have different binary representations when they are stored as text rather than numbers.

Unicode
- Unicode represents characters using 16 bits instead of 8.
- Unicode provides a unique number for every character no matter what program or language.
- Extended ASCII is included in Unicode.
Example- The letter A is coded as 0000000001000001 in binary
                                                                            0041 in Unicode
                                                                                65 in denary

Error Checking and Correction
- Single Parity Bit - Is an extra bit.
                           - It is added to the pattern for error checking
                           - A computer system uses either a ODD bit parity or an EVEN bit parity
                           - In an odd bit parity the number of 1 bits are odd
                           - In an even bit parity the number of 1 bits are even
Example: Odd
  11001100
111001100
Example: Even
  110001000
1110001000

- If an ASCII character is transmitted using an even parity the reciever will check the parity after it has been transmitted.
- If the parity is odd then there has been an error in the transmission.






 

Sunday, 27 March 2011

Binary and Hexadecimal Numbers

Bits and Bytes
- Storage locations in digital computers are built using electical circuits that can either have a high voltage or a low voltage.
- 0 represents a low voltage
- 1 represents a high voltage
- A byte is 8 bits together
- A word is a group of bytes

Denary
136 represented in denary is (1x100) + (3x10) + (6x1)

Coverting Binary to Denary
- Create a Binary table
- Write in the binary number from right to left
- Add up the values where a '1' is in the column.

Example:  01110101
128     64     32     16     8     4     2     1
  0        1       1       1      0     1     0     1

= 64+32+16+4+1
= 117

Converting Denary to Binary
- Create a Binary table
- Go from left to right making sure each number in the table is less than the number before
- Fill gaps with '0'

Example: 51
64     32     16     8     4     2     1
0        1       1      0     0     1     1

Adding Binary Numbers
- Put binary numbers into column method

Example:
     10011
     01011
=   11110  = 30

Rules of Adding Binary

0 + 0 = 0 (no carry)
0 + 1 = 1 (no carry)
1 + 0 = 1 (no carry)
1 + 1 = 10 (0 and carry 1)
1 + 1 + 1 = 11 (1 and carry 1)

Multiplying Binary
Example:
 110
x 11
= 1100

Binary Multiplication Method
1.Start on the second row at the left.
2.For each 1 you find you create a row below the bar with the number at the  top followed by the number of places to the right of the 1 you are considering.
3.Finally add all the rows below the bar – using binary addition rules
 
Converting Denary Negatives into Binary
- Find Binary equivalent to denary
- Change 0's to 1's and 1's to 0's
- Add one to the result
 
Example: -13
16     8     4     2     1
0       1     1     0     1 (binary equivalent)
1       0     0     1     0 (change 0's and 1's vice versa)
1       0     0     1     1 (add one)

 Converting Binary Negatives into Denary
- Put into binary table
- Convert 1's to 0's and 0's to 1's
- Add one to the result
-Convert to denary and place a negative sign in front

Example:  0100111
64     32     16     8     4      2     1
0        1       0      0     1      1     1 (binary in table)
1        0       1      1     0      0     0 (change 0's to 1's vice versa)
1        0       1      1     0      0     1 (add one to result)
= -89

Subtracting Binary
- Convert number to be subtracted  into a negative number and add them.

Hexadecimal
- Hexadecimal goes from denary 1 to denary 16.
- Hexadecimal goes from 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10

Converting Denary to Hexadecimal
- Convert to binary
- Take each group of 4 and convert into hex

Example: 213
128     64     32     16     8     4     2     1
 1         1       0       1      0     1     0     1
1101 = 13 = D
0101 = 5 = 5
= D5

Decimals
- Create a binary table with a decimal place after 1
e.g.  32      16      8      4      2      1     .     0.5     0.25  etc.
       
Example

48.75
32     16     8     4     2     1     .     0.5      0.25
 1       1      0     0     0     0     .      1          1 

Sunday, 13 March 2011

Finite State Machines

- Finite means countable.
- A FSM is a machine that consists of a fixed set of possible states.
- These states can be - Allowable inputs that change the state
                                 - Outputs that change the state back to the original.
- The outputs only depend on the current state.
- The current state depends on the history of the sequence of inputs.
- Many types of digital machines are FSMs.
- Each state is one step towards the solution of the problem.
- Increasing the clock rate of a computer enables it to solve problems more quickly.

State Transition Diagrams
- A ballpoint pen is an example of an FSM.
- It has a finite number of states - Ballpoint extended
                                                - Ballpoint retracted
- It has a set number of allowable inputs - Clicking the pens button
- It has a set of outputs - retracting or extending the ballpoint
-In the diagram it has two states 1 and 0 and two transitions indicated by curved arrows
- State 1 is the ballpoint being exteneded and State 0 is the ballpoint being retracted





State Transition Tables
- We can use a table that shows the state that follows for every state and every input.
Table for ballpoint pen


- One reason FSMs are so useful is that they can recognise sequences.
- An FSM with no outputs is called a Finite State Automaton FSA.
- FSAs have an initial state and one or more acceptingstates, or goal states.
- State transition diagrams use a special arrow to indicate the inital state.
- A double circle is used to indicate the accepting state, or goal state.

Decision Tables
- A decision table is a precise yet compact way to model a complicated logic.
- Decision tables make it easy to observe that all possible conditions are accounted for.

Example
If X is greater than 6 and Y is less than 7 - then output "pass"
                                                              - else output "false"

Tuesday, 1 March 2011

The System Life Cycle

The System Life Cycle makes it less likely for a project to fail. There are five stages within the cycle that help to reduce failures. Formal procedures are essential to make sure that everyone involved can contribute and can give a solution to the problem. Any system will eventually cease and the whole process will start again.

Phase One: Analysis
- Specification of the product - what is it's purpose?
                                             - Who will be using it?
- Research - Interviews
                 - Observations
                 - Questionnaires
                 - Examination of Documentation
- The result of the analysis stage is a requirements specification with system objectives.

Phase Two: Design
- A good design will be detailed enough for specialists to produce the system the way that the designer wanted.
- System Components need to be specified within the design
              - Hardware
              - Software
              - Data Files
              - User Interface
              - Required Inputs
              - Required Outputs
              - Manual Procedures
              - Test Plan
- A final specification is produced and a final design is produced.

Phase Three: Implementation
- Involves - Development of Software
                - Installation of Hardware
                - Installation of Software
                - Preparation of Data Files
                - Training people to use interface
                - Writing the system documentation
- This phase is mainly for making sure that people can use the system without and difficulty.

Phase Four: Testing
- During program design and writing a large amount of time is spent of testing the product.
- When the parts are put together and the software is installed; the whole system needs to be tested before it goes live.
- It also makes sure that the people trained to use the product can with the software installed.

Phase Five: Evaluation
- When the system is fully operational, evaluation needs to be carried out to see what can be improved and to see whether the customer is satisfied.
- Some questions that are asked - Does the system meet the specifications?
                                                 - Is it effective for solving the original problem?
                                                 - Can users operate the system without mistakes?
                                                 - Can users work without stressful conditions with the system?

In the future software is updated. This is so that errors and bugs can be fixed as soon as they are discovered. Users may change their requirements so software has to be updated with the new specifications.

Saturday, 12 February 2011

Representing Sound

Sound
- Sound is an air pressure wave that is sensed by our ears.
- Can either be analogue or digital.
- Analogue sounds are when pressure waves are captured by a transducer and produces an electrical current which varies with the sound pressure.
- The electrical signal produced can be transmitted by telephone, over the radio and can be preserved on magnetic tape.
- At the other end when being broadcasted or transmitted by telephone the electrical signal is used to re-create sound via vibrations.
- The higher the pitch of the sound the more rapid the vibration.
- A pure tone is a regular sine wave, but when two waves get put together they superpose meaning you then get a pulsating tone.
- Today most sound systems are digital.
- The electrical signal from the transducer is converted in to a digital signal meaning it is represented by binary (1's and 0's)

Analogue to Digital Conversion (ADC) and Digital to Analogue (DAC)
- Converts an anologue signal into an equivalent digital signal.
- A computer may be used to record sound, but first the sound must be converted into digital form.
- The analogue signal is sampled.
- Sampling is when a wave is measured at regular time intervals and then rounded to the nearest binary value.
- To play back sound the signal must be converted back to analogue.
- The technique to do this is called pulse code modulation.

Pulse Code Modulation (PCM)
- Samples of the analogue signal are taken at regular intervals of time.
- The sampling frequency or rate must be at least twice the highest frequency in the anologue signal.
- These samples are represented as narrow pulses of height which are proportional to the value of the original signal.
- This process is known as Pulse Amplitude Modulation (PAM)
- To produce PCM data, the PAM samples are quantised, meaning they are rounded to the nearest whole number.

Nyquist's Theorem
- We Must Sample At A Frequency At Least Twice The Rate Of The Highest Frequency In The Sampled Signal.

Storing Sound In Files
- One of the most notable sound formats is WAV (supported by most Operating Systems)
- WAV requires 2.5 MB of memory for one minute of sound.
- WAV is commonly used when storing music and sound to CDs.
- Most common nowadays is the MPEG format, this can be mp2, mp3 or mp4.
- MPEG compresses the sound file by 10% of what WAV does.
- 1 min in WAV = 2.5 MB   -   1 min of mp3 = 0.25 MB
- MPEG also removes frequencies that the ear and brain cannot detect.

Editing Sound
- When sound is stored digitally on a computer for example, the sound can be modified allowing the user to mix multiple sources and add effects.
- When a sound is edited it can be saved as a single sound file.

Synthesising Sound
- Musical Information Digital Interface does not store sound waves but stores a digital representation of the sound.
- It takes note of the notes to be played, the instrument being played and how long a note and intrument is played for.
- The resulting form is that it is very compact.
- It can easily be transposed and played on different instruments.
- Musical Information Digital Interface is also known as MIDI.

Streaming Audio
- When you stream audio the server sends it bit by bit.
- The client buffers it and plays it when it has enough bits to keep on playing and buffering at the same time.
- Advantages - No need to download the file
                     - Saves harddrive space
                     - Makes copying harder
Disadvantages - Cannot listen when disconnected
                       - Can be affected by bandwidth

Tuesday, 1 February 2011

Representing Images

Bitmapped Graphics
- An image is divided into a grid of pixels.
- Each pixel in a grid cell is sampled and is then assigned a Binary Code to represent the average colour of the grid cell.
- The Binary Codes are then used to produce a copy of the original image.

Memory Bitmaps
- The Binary Codes of each pixel are stored in memory when an image is scanned.
- The image is displayed on a Visual Display Unit by transferring the Binary Codes back into the memory.
- Bitmap is used because the pixels of an image are mapped to specific positions in memory

Resolution
- The resolution of a Visual Display Unit is usually expressed by the # of pixels per row x # of pixels per column
- It is not the number of pixels that determines the sharpness of the image but the size of the pixels.
- For a sharper image the pixels need to be smaller.
- A small image size containing a high number of pixels is going to produce the sharpest image.

Colour Depth
- The number of bits used to represent the greyscale value of a pixel is called the image depth.
- The colour of a pixel can be coded using the RGB colour model.
- The RGB model mixes Red, Green and Blue to produce a specific colour.

1-Bit Colour
- A black and white image is known as a monochrome image.
- One bit is allocated to each pixel
- To get a white pixel the binary value is 1
- To get a black pixel the binary value is 0

12-Bit Colour
- 4 bits are allocated to each RGB components
- As 4 bits are allowed then 4096 different colours are available.
- This coulour depth is used most often when there is little colour needed, such as on a mobile phone

True Colour
- 24-Bit true colour images use 8 bits for each RGB component
- Having 8 bits for each component there are 256 different alternate colours
- When the colours are combined they give a total of over 16 million different colours

Vector Graphics
- Instead of dividing a graphic image into pixels a vector graphic identifies the objects that make up the image.
- Vector Graphics record information about these objects to define the image.
- Vector drawing software uses the commands that create objects as the source of information needed to describe the graphic.

Comparing Bitmaps and Vectors
- When a bitmap is scaled it is enlarged.
- As the magnification increases the vixels become more visible.
- Vector graphics avoid distortion because scaling is applied to a line's endpoint.
- Vector graphics do not deal with pixels.
- You do not lose resolution when you enlarge a true vector drawing.

Advantages and Disadvantages
- Geometric images require fewer bytes in vector graphic format than in a bitmap format.
- Images that have continuous areas of colour (such as photographs) take up fewer bytes in bitmap format than in vector.
- Geometric images load faster from secondary storage and download faster over the internet in a vectot graphic format.
- Vector graphics scale without distortion whereas bitmap does.

Compression
Run Length Encoding
-Single Compression technique that takes into account the fact that some images have long runs of pixels.
-If three or more consecutive cells have the same bit pattern then a run of cells has been found and can be encoded by two bytes.
-First byte stores the number of consecutive memory cell bytes and second byte stores the colour code.
-It is a loseless compression technique.
-Decompressing the Run Length Recording image produces an exact original image.

Lossy Compression
-Discards information that is not necessary such as a background scene.
-Decompressing an image with the Lossy technique produces a different image compared to the original.
-As the human eye is not so good at recognising exact strengths of brightness variation allowing it to be possible to highly reduce the information of the high frequency components.

Thursday, 23 December 2010

Robotics

Robotics are now beginning to be used in everyday life, from travelling to space and back, to building machines such as cars and computers.

Strengths - They are resistant to heat, pressure, pain, and radiation e.g. Submersibles
               - Perform repetitive tasks without boredom or errors e.g. Car Assembly Plant
               - They are faster and more accurate in their work e.g. Circuit Assembly
               - They can reduce the risk to human lifes e.g. Bomb Disposal

Weaknesses - Cannot cope with uncertainty or unpredictability
                    - Cannot make decisions or social decisions
                    - Still need a human commander
                    - Can only do the job they have been programmed to do
                    - They can act but cannot think

Consequences Of Using Computers

Legal

The Computer Misuse Act (1990)
- There to protect against unauthorised use of computer systems
- Three Levels - 1. Unauthorised access to data and programs
                       - 2. Unauthorised access and committing further offenses
                       - 3. Unauthorised modification of computer material
- Unauthorised access can be known as cracking or hacking
- Maximum penalty is a fine or a prison sentence

Data Protection Act - Commissioned in 1984 and recommissioned in 1998
- 8 Principles - Data Gathering - Subject knows that data is being gathered
                     - Data Purpose - Obtained for one or more specific purposes
                     - Data Quantity - How much data is recorded
                     - Data Quality - Data should be accurate and up to date
                     - Data Lifetime - Data kept for a certain amount of time
                     - Subject's Rights - Only processed under consent of subject
                     - Internal Data Security - Appropriate technical measures to keep data safe
                     - External Data Security - Is it being moved between countries

Regulation of Investigatory Powers Act (2000) - Referred generally as RIPA
- Prevents the interception of public or private messages
- Security can intercept as long as they have a warrant
- Can be used to force ISPs to help them (Encryption Keys)
- Only applies when the message is being delivered
- In a mailbox it is then covered by the Data Protection Act

Copyright, Designs and Patents Act (1988)
- Protects materials - Music, Art and Films
                              - Only use copyright items with owners consent
                              - Design right protects how something looks
                              - Patents protect how an innovation works and what it does
                              - Trademarks protect the name or logo used by a business

Health and Safety Regulations (1992)
- Employers must look after staff who use computers for a long time
- Software designers must think about colour schemes and font types
- Designers should try to reduce the amount of typing and mouse clicks


Ethical and Social
Digital Rights Management (DRM)
- Application of controls which limit the use of digital media
- Used by copyright owners to limit when you can use digital media
- It can limit the number of plays, number of transfers etc.
- Proprietary Software - Comes with a license
                                   - Must not be changed, re-sold or passed on
                                   - Open Source - Free software with different controls
                                   - Can be modified, re-used
                                   - Cannot be sold thought to make money


Code Of Conduct
- A set of instruction for how you should behave at a computer.
- Not a law - but each company has disiplinary actions
- May cover items such as - Not using other people's accounts
                                         - Not interfering with other people's work
                                         - Not to download software or install software
                                         - Not looking at personal information - e-mail, socialising
                                         - Not to use them for copying material

Sunday, 5 December 2010

Fetch, Execute Cycle & Registers Used

- Instructions are fetched from the main memory
- Intructions are then decoded
- Instructions are then executed

Registers
Program Counter (PC) - Holds the address of the next instruction to be executed
Current Information Register (CIR) - Holds the current instruction while it's decoded and executed
Memory Address Register (MAR) - Holds the address of the memory location being accessed
Memory Buffer Register (MBR) - Holds data being transferred to or from the memory that is held in the MAR
Accumulator (ACC) - Holds the result of the current calculations

Basic Machine Code Operations

- High Level language programs are translated into Machine Code
- The processor decodes this Machine Code to run programs
- Machine Code - Operation Code (what to do)
                          - Operand (what to do with it)

What do I need to know?
- Load 15 (meaning load whatever is in memory location 15)
- Store 6 (meaning store whatever number is in the accumulator into memory location 6)
- Add #10 (meaning add the number 5 to the accumulator)

# is important to signify a number

Factors Affecting Processor Speeds

Clock Speed - The clock executes a set of instructions by ticking.
                     - Each instruction takes one or more ticks.
                     - The faster the clock the faster a program can be executed.
                     - Double the clock speed and you would double the performance.

Bus Width - The number of wires within a bus (8, 16, 32, 64)
                 - Each wire has a high voltage or a low voltage (1 or 0)
                 - The larger the number of wires the larger number of instruction can be passed through
                 - The bigger the bus, the less data has to be broken into smaller pieces, therefore increasing performance.

Word Length - The number of bits in a binary number that can be sent
                     - The largest number sent has to be equal to the number of wires on the Bus
                     - Common word length is 32 or 64 bits
                     - The bigger the word length, the less data has to be broken into smaller pieces, therefore increasing performance.

Multicore Processors - Adding more than one processor allows the computer to do things at the same time
                                 - Dual Core is now standard in computers
                                 - Quad Core is becoming common in computers

Three Box Model

The Three Box model has three components to it - Processor
                                                                          - Main Memory
                                                                          - Inputs & Outputs (I/O)

It also has a Bus which combines these components.

Processor - The brain of the system.
                - Responsible for executing programs
                - Contains a microprocessor, which can contain up to 1 billion transistors

Main Memory - Also known as the Immediate Access Memory
                      - Used to store program instructions and data
                      - Random Access Memory - Loses its data when Computer is turned off
                      - Read Only Memory - Keeps it's data (non-volatile)
                      - ROM is used to store programs which boot the computer.

Inputs & Outputs (I/O) - Everything outside the computer is a peripheral.
                                    - I/O controllers allows the CPU to communicate with them

Bus - Can be called System Bus or External Bus
       - Connects the Three Boxes together
       - Three Types - Data - Bidirectional (Two Way)
                                         - Consists of 32 wires
                                         - Used to transport Data
                              - Address - One Directional
                                              - Consists 32 wires
                                              - Used to address Memory and I/O locations
                              - Control - Bidirectional (Two Way)
                                             - Consists of 8 wires
                                             - Used to transport control signals between the three components

Monday, 22 November 2010

Logic Gates


Logic Gates are electronic circuits which perform Boolean functions. Several symbols are used to define logic gates. Logic Gates form the basis of all logic circuits. Inputs to outputs from electronic logic gates are in the form of voltages; a high voltage represents a high state (1) and a low voltage represents a low state (0). These low and high states are what an electronic piece of equipment can read in a binary format.

Half Adders - A Half-Adder uses two inputs, an XOR gate and an AND gate, and is used two add two digits, and carry over that number two the next adder.

Full Adders -  A Full-Adder adds three bits, and is comprised of three inputs, two XOR gates, two AND gates and an OR gate.

A processor uses Half Adders and Full Adders to perform simple calculations



AND Gate


Both inputs must be true (1) for the output to be true(1)
Looks like a D with Two Inputs and One Output

Boolean: A.B
Input
Output
A
B
Q
0
0
0
0
1
0
1
0
0
1
1
1


OR Gate

Used to express that either input or both being true (1) will give an output that is true (1)
A curved back to it with a slightly pointed front. Two Inputs, One Output

Boolean: A+B
Input
Output
A
B
Q
0
0
0
0
1
1
1
0
1
1
1
1

NOT Gate

Only one input. The input must be false (0) for the output to be true (1) These logic gates will only have one output.
A Triangle with One Input and One Output


 

Boolean: A
Input
Output
A
Q
0
1
1
0

XOR Gate (Extended OR)

Used to express that either output but not both being true will give an output that is true.

Input
Output
A
B
Q
0
0
0
1
0
1
0
1
1
1
1
0

NAND Gate (Not AND)

As long as both of the inputs are false (0) then the outputs will be false (0)

Input
Output
A
B
Q
0
0
1
1
0
1
0
1
1
1
1
0


NOR Gate (Not OR)


Only if both inputs are false (0) will the output be true (1)

Input
Output
A
B
Q
0
0
1
1
0
0
0
1
0
1
1
0

XNOR Gate (Extended NOR)

If neither or both of the inputs are true (1), then the output will be true (1) Therefore, if one input is true (1) and the other is false (0) then the output will be false (0)

Input
Output
A
B
Q
0
0
1
1
0
0
0
1
0
1
1
1