Followers

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.