Thursday, 17 July 2014

Networks

Networks have many different topologies that are each more effective than others depending on what they are being used for.

Network topologies are categorized into the following basic types:
  • bus
  • ring
  • star
  • tree
  • mesh
More complex networks can be built as hybrids of two or more of the above basic topologies.

Thursday, 1 May 2014

Software

Software definition:

Programs and applications for computer: programs and applications that can be run on a computer system, e.g. word processing or database packages






Software is a group that specifies applications within a computer system. They can perform many different tasks, some of which make your life easier and some that just pass time such as games.

Thursday, 20 March 2014

TESTING, TESTING PLEASE:

Errors occur because commands aren't entered correctly

Syntax errors are where the code is not typed correctly

Logical errors are when the syntax is correct but the logic is wrong

Thursday, 13 March 2014

Database

Key Terms:

Entity: Something that we store data about in a database
Record: All the data about one item in a database
Attribute: A characteristic of an entity. It becomes a field in a data table
Field: A characteristic of something stored in a database
Indexed sequential file: A sequential file that is accessed using an index, which is a separate file
Flat file database: Database consisting of only one table
Serial file: A file of items one after another
Sequential file: A serial file in order
Schema: Definition of a database
Data dictionary: the stored schema of a databse
DBMS: Data base management system


Definition:

A structured set of data held in a computer, especially one that is accessible in various ways.


What's a database for?

A database is for arranging large amounts of data in an organised fashion.





Thursday, 5 December 2013

Basic Program In Little Man Computer

Program

INP
STA VALUE
LDA ZERO
STA TRINUM
STA N
LOOP LDA TRINUM
SUB VALUE
BRP ENDLOOP
LDA N
ADD ONE
STA N
ADD TRINUM
STA TRINUM
BRA LOOP
ENDLOOP LDA VALUE
SUB TRINUM
BRZ EQUAL
LDA ZERO
OUT
BRA DONE
EQUAL LDA N
OUT
DONE HLT
VALUE DAT 000
TRINUM DAT 000
N DAT 000
ZERO DAT 000
ONE DAT 001

What you should do

  1. Click on the "LMC Simulator Applet" link to start the LMC simulator.
  2. Clear the Message Box and all of the LMC mailboxes -- click the "Clear Messages" button and the "Clear" button if necessary.
  3. Copy the twenty eight line program above and paste it into the Message Box
  4. Click on the "Compile Program" button.
  5. Click on the "Run" button.
  6. When prompted, enter three-digit numbers in the "In-Box", and press the "Enter" button.

What you should see

  • After the program is compiled, you should see from mailbox 0 to 23 the instructions 901, 323, 526, 324, 325, 524, 223, 814, 525, 127, 325, 124, 324, 605, 523, 224, 720, 526, 902, 622, 525, 902.  The Program Counter should start at 0 (click on "Reset" if necessary).
  • DAT reserves mailbox 23 for N (the user input), mailbox 24 for TRINUM (the value of the current triangular number), mailbox 25 for COUNT (the number of triangular numbers that have been calculated), mailbox 26 for ZERO, and mailbox 27 for ONE. 
  • When you click on "Run" or "Step", the Message Box will describe the actions of each instruction.
  • The first two instructions accept the input VALUE from the user.
  • The next three instructions initialize the values of TRINUM and N to ZERO.
  • The algorithm is as follows: calculate triangular numbers until the calculated triangular number is greater than or equal to the input value.  If the triangular number is equal to the input, then output N.  Otherwise, output ZERO.
  • The LOOP starts by checking this exit condition.  The input VALUE is subtracted from TRINUM.  As long as the result is negative, the LMC stays in the loop (i.e. the BRP does nothing) to calculate more triangular numbers.
    • To calculate the next triangular number, N is incremented by ONE, and this new value of N is added to TRINUM.  Remember, the nth triangular number is calculated by adding n to the previous triangular number.
    • The BRA LOOP indicates the end of the loop body.  This BRANCH command causes the execution of the LMC to "jump" back to the start of the loop.
  • After exiting the LOOP, the value of TRINUM is greater than or equal to the input VALUE -- the LMC has calculated enough triangular numbers to determine if the user input is one.
  • The SUB instruction is to check if TRINUM and VALUE are equal.
    • If they are equal, subtracting TRINUM from VALUE will equal 000.  BRZ will allow the LMC to skip past the code section that handles when these two values are not equal.  The LMC will then execute the code segment that outputs N to the Out-Box -- the input VALUE is the Nth triangular number.
    • If they are not equal, the result on the Accumulator will not be 000, and BRZ will do nothing.  The code after of the BRZ instruction is executed.  This code outputs ZERO to the Out-Box, and then skips past the code for the two values being EQUAL to the end of the program.