phone: 016-6933793
e-mail: darknessofsorrow@hotmail.com

Friday, 2 November 2012

Computer System Organization



                                                HARDWARE                                       SOFTWARE        

Examples:CD-ROM, monitor, printer, video card, scanners , label makers, routers , and modems.Quickbooks, Adobe Acrobat, Winoms-Cs, Internet Explorer ,Microsoft Word , Microsoft Excel
Types:Input,storage,processing,control, and output devices.System software, Programming software, and Application software.
Inter dependency:Hardware starts functioning once software is loaded.To deliver its set of instructions, Software is installed on hardware.
Function:Hardware serve as the delivery system for software solutions. The hardware of a computer is infrequently changed, in comparison with software and data, which are “soft” in the sense that they are readily created, modified, or erased on the computTo perform the specific task you need to complete. Software is generally not needed to for the hardware to perform its basic level tasks such as turning on and reponding to input.
Reliability:Hardware stays at steady reliability level in useful life.Software needs constant testing after upgrades.
Failure:Hardware failure is random. Hardware does have increasing failure at the last stage.Software failure is systematic. Software does not have an increasing failure rate.
Fault:Hardware faults is physical.Software faults are not.
Lifetime:Hardware wears out over time.Software does not wear out over time.
Nature:It is physical in natureIt is logical in nature
Definition:Devices required to store and execute (or run) the software.Collection of instructions that enables a user to interact with the computer. Software is a program that enables a computer to perform a specific task, as opposed to the physical components of the system (hardware).
Simple small definition:Anything which we can see when the computer is off is hardware.Anything which we can see on the screen when the computer is on is software.

                                                               HARDWARE



     SOFTWARE

Thursday, 1 November 2012

Hardware

COMPUTER







MOTHERBOARD


The main circuit board of a microcomputer. the motherboard contains the connectors for attaching additional boards. Typically, the motherboard contains the CPU, BIOS, memory, mass storage interfaces, serial and parallel ports, expansion slots, and all the controllers required to control all the standard peripheral devices, such as the display screen, keyboard, and disk drive; sometimes you will find that the motherboard has other integrated devices such as an audio card and video card. The motherboard is the largest circuit board in most computers and is held by several screws.


CPU

CPU (Central Processing Unit) is the 'brain' that control the internal activities of a computer. Also know as the 'microprocessor', it processes everything from basic instructions to complex functions using its components such as control unit, arithmetic logic unit and register. It is the most expensive part of a computer and the reliability of a computer system is determined by the quality of its processor.


ALU (Arithmetic Logic Unit) - This unit performs the computing functions involving integers (whole numbers).

   # Arithmetic operations which include addition, subtraction, multiplication     and division.

   # All logic operations which involve comparisons such as less than, greater than, or equal to.


All information in a CPU is reduced to a numeric function; therefore, the ALU is constantly handling arithmetic and logic operations.

The results of these operations are stored in the registers or in memory or sent to output devices.

Registers - All data is temporarily stored in registers during the execution of programs and the size of the internal register determines how much information the CPU can process at one time.

Control Unit - This unit handles the timing and control signals to all the operations in the system. You can compare the control unit to a police officer directing traffic at a busy intersection; but, instead of directing cars, the control unit directs data flow between the computer processor, memory and peripherals.

Input - This is the process by which external data is received into the computer. This could either be running a program or getting keyboard responses. Common inputs include a keyboard, mouse, modem, scanner, etc. The computer system analyzes the input data.


Output - Output is the process by which the CPU sends data to devices such as the monitor, printer, disk drive, etc. Output takes the results of the processing and sends them to be stored in memory or printed or displayed. Output is the final result of the processing of the data that was input and used by the computer system.

Data must be stored either temporarily or permanently. Therefore, this is where memory is required. The computer needs a way to hold onto data as the processing is being performed.

Memory - The computer stores data in memory and retrieves the data it needs from memory. There are two kinds of memory - ROM and RAM.

ROM (Read-Only Memory) is permanent and will be retained even when the computer is turned off - eg. BIOS.

RAM (Random Access Memory) is volatile and data stored in RAM will be erased when the computer is turned off. The processor uses RAM to store data and retrieves data from RAM as it's needed. The instructions of a program, for example, would be stored in RAM. RAM will be lost if the computer loses power.


RAM (PRIMARY STORAGE)

RAM (random access memory) is the place in a computer where the operating system, application programs, and data in current use are kept so that they can be quickly reached by the computer's processor. RAM is much faster to read from and write to than the other kinds of storage in a computer, the hard disk, floppy disk, and CD-ROM. However, the data in RAM stays there only as long as your computer is running. When you turn the computer off, RAM loses its data. When you turn your computer on again, your operating system and other files are once again loaded into RAM, usually from your hard disk.




SECONDARY STORAGE

Secondary storage is commonly referred to as hard disk. It is a non-volatile storage and is capable of storing large amounts of data. As secondary storage is non-volatile, it is used for safe or offline storage of data and all the data can be stored permanently.


INPUT DEVICE

Keyboard
Mouse
Joystick
Scanner
Light pen
Voice recorder
Graphic tablet
Webcam

OUTPUT DEVICE

Monitor 
Speaker
Printer
Plotter
Projector








Wednesday, 31 October 2012

Software

Software consists of programs written to perform specific tasks. There are 2 types of software - SYSTEM SOFTWARE and APPLICATION SOFTWARE.




SYSTEM SOFTWARE

# System programs that control the computer.
# The operating system is an example of system software. It is the first to load when turning on a computer.
# It handles memory management, input and output activitities, storage management.

Example:
Microsoft Windows, Apple's macintosh, Linux, UNIX, Mac OS

APPLICATION SOFTWARE

* Perform a specific task such as using computer word processors, games, java.....
* All application programs are written using computer programming language.

Example:
Microsoft Word, Notepad, Windows Media Player, MP3 Converter, Adobe Photoshop

Tuesday, 30 October 2012

Programming Languages


The Different Generations of Languages


There are currently five generations of computer programming languages. In each generation, the languages syntax has become easier to understand and more human-readable.

First generation languages (abbreviated as 1GL)
Represent the very early, primitive computer languages that consisted entirely of 1's and 0's - the actual language that the computer understands (machine language). Also known as low level language.

Examples: 011100001, 1000001

Second generation languages (2GL)
Represent a step up from from the first generation languages. Allow for the use of symbolic names instead of just numbers. Second generation languages are known as assembly languages. Code written in an assembly language is converted into machine language (1GL).

Examples: LOAD 3, STOR 4, ADD

Third generation languages (3GL)
With the languages introduced by the third generation of computer programming, words and commands (instead of just symbols and numbers) were being used. These languages therefore, had syntax that was much easier to understand. Third generation languages are known as "high level languages" and include C, C++, Java, and Javascript, among others.

Examples: Marks = assignment + exam

Fourth generation languages (4GL)
The syntax used in 4GL is very close to human language, an improvement from the previous generation of languages. 4GL languages are typically used to access databases and include SQL and ColdFusion, among others.

Fifth generation languages (5GL)
Fifth generation languages are currently being used for neural networks. A neural network is a form of artificial intelligence that attempts to imitate how the human mind works.

Monday, 29 October 2012

Java





Java is a high-level programming language developed by Sun Microsystems. Java was originally called OAK, and was designed for handheld devices and set-top boxes. Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web. 

Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors. Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension), which can then be executed by a Java interpreter. Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems, including UNIX, the Macintosh OS, and Windows.




PROCESSING A JAVA PROGRAM

 # Using editor, write Java code using Java syntax. This is what we called the source code.

 # Compile the source code for correctness of syntax and translate into bytecode.

 # Run the program. A program in JDK(Java Development Kit) library which called Linker links the bytecode with necessary code residing in the library.

 # Loader : Transfers the compiled code(bytecode) into main memory.

 # Interpreter : Reads and translates each bytecode instruction into machine language and then executes the statements in a program written in a high-level language.




Sunday, 28 October 2012

Class and Object

 
   ~ Object - represents either objects in the real world like automobiles, houses, and employee records or abstractions like colors, shapes, and words.
   ~ Objects have state, behaviour and identity.
      State : The condition of an object at any moment, affecting how
                  it can behave
      Behaviour : Define by a set of methods, invoking a method on an
                  object means that asking the object to perform a task.

  Identity : Each object is unique.
~ Objects are categorized into classes.
~ Each individual object is an instance of a class.


~Class - the definition of a kind of object. It is like a plan or a blueprint for constructing specific objects.


A Class as a blueprint











 Objects that are instantiations of the class Automobile.


~ Class is a caterogy of objects that share the same :
  • Attribute
  •    + A named property of a class that describes a range of values
          that instances of the attribute might hold.
       + Attribute are the way classes encapsulate data.
       + Example :
              Class : Employee
              Attributes : employee_name, employee_id,
                                 position, department etc...
  • Operation
  •    + A behavior of an object
       + Implemented in classes are methods
       + Methods are the identified and invoked by their signature,
          including name, parameters, and return type
       + Example :
               Class : Employee
               Attributes : employee_name, employee_id,
                                  position, department, salary etc...
               Operations : setEmployeeDetails
                                   calculateSalary
                                   printEmployeeDetails




    ~ Programmers often use a simpler graphical notation to summarize some of the main properties of a class. This notation is called a UML class diagram or simply a class diagram.
    *UML - Universal Modeling Lamguage

    A Class Outline as a UML Class Diagram









    ~ Declaration of object & assigning of an object reference to the variable.
                ClassName objectRefVar = new ClassName ( ) ;   
             Example :   Vehicle car = new Vehicle ( ) ;  
    ~After an object is created, its data can be accessed and its methods invoked using the dot operator (.). 
      + objectRefVar . dataField - References a data field in the object
      + objectRefVar . method (arguments) - Invokes a method on the object
         Example : + Car . colour - References the colour in Vehicle
                            class
                         + Car . printColour ( ) ;
                         - Invokes the printColour() method on Car .
                             Methods are invoked as operations on objects.

    Saturday, 27 October 2012

    Methods

    ~ When using a method, are said to invoke or call it.
    ~ Java has two kinds of methods :
       + Methods that return a single item. Example: method nextInt
       + Methods that perform some action other than returning an item.
          Example: method println
    ~ Method that perform some action other than returning a value are
       called void methods.
    ~ A method defined in a class is usually invoked using an object of that class.

    Defining void Methods
    ~ A method definition consists of a heading (1st part of the method
       definition) and a body (the rest of the method definition).

    ~ Normally, the heading is written on a single line, but if it is too
       long for 1 line, it can be broken into 2 or more lines.
    ~ The statements in the body are enclosed between braces {}.
    ~ Instance variables can be use within the body. Such variables are
       called local variables.
    *Local variable is confined to the method containing its declaration.

    Blocks
    ~ Is a compound statement that declares a local variable.
    ~ Same as a compound statement that is a group of
       Java statements enclosed in braces {}.
    ~ However, the 2 terms tend to be used in different contexts.
    ~ The variables declared in a block are local to the block and these
       variables disappear when the execution of the block ends.

    Parameters of a Primitive Type
    ~ A formal parameter in a method definition represents the argument.
    ~ It is given in the heading, within the parentheses right after the
       method name.
    ~ A formal parameter of a primitive type, such as int, double or
       char is a local variable.
    ~ Example: public int predictPopulation (int years)
       + The word years is a formal parameter.
       + It is a stand-in value that will plugged in when thr method is called.
       + The item that is plugged in is called an argument or in some
          other books called actual parameters.
    ~ The way of plugging in arguments (the value of the argument) for
       formal parameters is known as the call-by-value mechanism.
    ~ This is the only mechanism used for parameters of a primitive
       type in Java.
    ~ The data type of a formal parameter in a method heading is
       written before the parameter.

    Void methods with parameters
    modifier (s) void methodName (formal parameter list) 
    {                                                                                   
           statements                                                            
    }                                                                                   

    Methods Calling Methods
    ~ A method body can contain an invocation of another method.
    ~ If the called method is in the same class, it is typically invoked
       without writing any receiving object.