Monday, May 25, 2020

Computer Language

Computer Language



The term computer language includes a wide variety of languages used to communicate with computers. Different kinds of languages have been developed to perform different types of work on the computer. Basically languages can be divided into two categories. Two basic types of computer languages are:

1. Lower-level language

A language that corresponds directly to a specific machine. There are two types of low-level languages.

Machine language

A language that is directly understood by the hardware. Machine language is the lowest and most Elementary level of programming language. It was the first type of programming language to be developed. It uses binary digits '0' and '1' for giving instructions.

Assembly Language

A slightly more user-friendly language that directly corresponds to machine language. Assembly Language was developed to overcome some of the many inconveniences of machine language. This is another new level but very important language in which operation codes and operands are given in the form of alphanumeric symbols instead of 0 and 1. It is called mnemonics (nodes). Because of this feature Assembly Language is also known as symbolic programming language.

2. High-level language

Any language that is independent of the machine. Types of high-level languages are BASIC (beginners all-purpose symbolic instruction code), Fortran (Formula Translation), Pl/1 (Programming Language/one), ALGOL (Algorithmic Language), C, C++, JAVA etc. High-level languages allow a user to give instruction in the English language which makes them easier to learn. Programs developed on one system can be executed on other systems and will produce the same outputs. It uses the translator program for converting the high-level program into machine language. Compiler and interpreter are used as translators in HLL.

Compiler

Compiler is a translator program that converts to the whole HLL Source program into object code, machine program code at once and also generates list of errors and shows it to the user.

Interpreter

Interpreter is translator program that convert HLL programs line by line. If there is any error at any point or line, program execution will stop until error is removed or debugged.

4GL (Fourth Generation Language)

This generation of language allows non-programmer users to write program to query databases and to generate custom reports. Characteristics of 4GL
  • User-friendly
  • Execution is fast
  • Easy to learn and program by non-programmer user
  • Uses of artificial intelligence and neural network
  • 4GL are closer to human language than other high-level languages and are accessible to people without formal training as programmers. Clarion, Data flax, Forte Tool are example of 4GL.

Short Notes:

Comparison on human language and computer language
SN
Human Language
SN
Computer Language
1
Vocabulary
1
Keywords/ Reserved Words
2
Grammar
2
Syntax
3
Meaning/ Sense
3
Semantic

Generation of Computer Language

1st Generation Language - Machine Language

  • It is the least level language,
  • The instruction are written in the form of series of 1's and 0's,
  • It is directly understood by computer,
  • It is time consuming for encoding and decoding,
  • It is quite difficult to write and understand,
  • It is machine dependent i.e. varies from one system architecture to another architecture.

2nd Generation Language - Assembly Language

  • It uses symbolic code (Mnemonic Code) and Binary Code (Machine Code 1's or 0's),
  • It is also machine dependent language,
  • It is quite easier than machine language,
  • It is also called low level language.

3rd Generation Language - High Level Language

  • More approach to human language,
  • It uses English language for instructions.
  • Procedural Language/ Procedural Oriented Language
  • Most of the programming language falls on this categories. Example, COBOL, FORTRAN... etc.

4th Generation Language

  • Problem Oriented Language/ Non-procedural Language
  • Most of all database system falls on this categories.

5th Generation Language Natural Language

Instructions are in the form of human voice (human language). Example, Prolog (program logic)

   Language Processors or Translators

It is the system software that translates source code to object code.

Types of Translator/ Language Processor

  1. Assembler
  2. Compiler/ Interpreter

Assembler

It is the system software that translates a source code/program written in assembly language into machine code.

Compiler/Interpreter

It is the system software that translates a source code/program written in high level language into machine code.

Difference between Compiler and Interpreter

SN
Compiler
Interpreter
1
Compiler works on the complete program at once. It takes the entire program at once.
Interpreter program works line-by-line. It takes one statement at a time as input.
2
Compiler generates intermediate code, called the object code or machine code.
Interpreter does not generate intermediate object code or machine code.
3
Compiler executes conditional control statements (like if-else and switch case) and logical constructs faster than interpreter.
Interpreter executes conditional control statements at a much slower speed.
4
Compiled programs take more memory because the entire object code has to reside in memory.
Interpreter does not generate intermediate object code. As a result, interpreter programs are more memory efficient.
5
Compile once and run anytime. Compiled program does not need to be compiled every time.
Interpreted programs are interpreted line-by-line every time they are run.
6
Errors are reported after the entire program is checked for syntactical and other errors.
Error is reported as soon as the first error is encountered. Rest of the program will not be checked until the existing error is removed.
7
A compiled language is more difficult to debug.
Debugging is easy because interpreter stops and reports errors as it encounters them.
8
Compiler does not allow a program to run until it is completely error-free.
Interpreter runs the program from fist line and stops execution only if it encounters an error.
9
Compiled languages are more efficient but difficult to debug.
Interpreted languages are less efficient but easier to debug. This makes such languages an ideal choice for new students.
10
Examples of programming languages that use Compilers: C, C++, COBOL
Examples of programming languages that use interpreters: BASIC, Visual Basic, Python, Ruby, PHP, Perl, MATLAB, Lisp

Bug

  • The error of computer program.
  • Error in computer language.

Debug

The process of eliminating error (bug).

Types of Bugs

1. Syntax Error

  • Due to the structure of instruction or reserved word.
  • It is signaled by translator.

     2. Logical Errors

  • Due to the logic of programmer.

     3. Runtime Errors

Due to hardware fault.
Computer Hardware and Software

What is System

  • Group of components working together to realize an objective.



User/Operator

A person who operates the system
  • User: A person/ an organization
  • Operator: A person

Hardware

  • The physical components/Tangible components(Touchable components/ feel/ see),
  • The working parts of the computer,
  • The component that participates on different computer activities (input, process, output).

Types of Hardware

  • Input device/unit/hardware
  • Output device
  • Processing device
  • Input-output device
  • Storing device
  • Interfaces(ports)
  • Cable/wires etc.

Software

  • The logical components of a computer,
  • It is soul part of computer,
  • It instructs hardware to perform specific operation,
  • Computer is just a 'Metallic Box' without software,
  • It is the collection/set up/ Integration of Programs/Procedures/Routines.


Example:
Input A
Here, "Input" is opcode and "A" is operand

Opcode (operation code)

  • The part of machine code instruction that defines the operation to be performed.
  • Opcode is code that instructs the computer on what task it should perform.

Operand

  • The quality on which an operation is to be done.
  • In computing, an operand is the part of a computer instruction which specifies what data is to be manipulated or operated on, while at the same time representing the data itself.

Instruction

  • It is the combination form of opcode and operand that performs specific task.

Instruction = Opcode + Operand
  • For a computer to do something, instructions have to be given to the computer processor so it knows how to do what it is being asked to do.

For example, if you were to ask the computer to draw a square, it would need a set of instructions on how to draw the square, so it can complete the task.

Program

  • It is the collection of related instructions that perform specific job. Example, adding two numbers and print the result.

Input A
Input B
C = A + B
Print C, is a program
  • A computer program is a collection of instructions that performs a specific task when executed by a computer. A computer requires programs to function, and typically executes the program's instructions in a central processing unit.

Software

Collection of related programs for specific purpose.
Example, Bold and Italic in word are programs and Word is software.
  • Computer software is a collection of instructions that enable the user to interact with computer, its hardware, or perform tasks. Without software, computers would be useless. For example, without internet browser, we could not surf the internet.
  • Computer software consists of computer programs, libraries and related non-executable data (such as online documentation or digital media).
  • Computer software is non-tangible, contrasted with the computer hardware, which is physical component of computer.

Types of Software

A. System Software

  • The integration of programs that performs system related task.
  • System software is computer software designed to provide services to other software.
  • Example of system software include operating system, computational science software, game engines, industrial automation, and software as a service applications.

  1. System management- Operating system
  2. System support- Utilities
  3. System development- Programming language or language processor
  4. System communication- Network system

B. Application Software

The collection of programs that perform user related tasks (fulfil demand or requirement of users).
  1. Taylor/ Custom/ Bespoke software- for organization/ a person
  2. Package-a) Designed for common users, b) Global application.


Types of Software (another way of classification)
  1. System Software
  2. Utility Software
  3. Application Software

System software is a works as a bridge between Hardware and Application Software.




Differences between Impact printers and Non-impact printers


Differences between Impact printers and Non-impact printers

SN

Basis

Impact printers

Non-impact printers

1
Descriptions
Produces text and images when tiny wire pins on print head strike the ink ribbon by physically contacting the paper
Produces text and graphics on paper without actually striking the paper
2
 Types
Dot-matrix printer
Inkjet printer, laser printer and thermal printer
3
Speed
Low printing speed
Reasonably fast
4
 Quality
Print quality lower in some types
High quality of output, capable of printing fine and smooth details
5
Letter quality
Produce near letter quality (NLQ) print only, which is just suitable for printing mailing labels, envelopes, or invoices
Letter-quality printouts

6
Consumption
Not commonly used today
Most commonly used printer today
7
Tools
 Uses ink ribbon
Uses ink spray or toner powder
8
Cost
Less expensive
More expensive
9
Durability
Reliable, durable (lasting for a long time)
Print head is less durable, inclined towards to clogging and damage
10
Sound effects
Generally noisy because of the striking activity
Generally much quieter than impact printers because there is no striking mechanism
11
Image clarity
Poor graphics or none at all
Can handle graphics and often a wider variety of fonts than impact printers
12
  Multipart forms
Ideal for printing multipart forms because they can easily print through many layers of paper
Cannot print multipart forms
13
Color output
Limited color printing
Capable of printing in strong clear color, good for printing pictures

Sunday, May 24, 2020

Advantage and Disadvantage of Impact Printer and Non-impact Printers

The advantages of impact printer

  • Dot matrix printers are cheap and durable,
  • Multiple (carbon) copies may be printed at once,
  • Impact printers are well-known for their reliability and for their ability to work in harsh conditions and environments, such as heat, cold, humidity and dust, without breaking down,

 Disadvantages of impact printers

  • They are relatively slow,
  • They create noise when the pins or typeface strike the ribbon to the paper,
  • They do not print transparencies (documents printed on clear plastic film for use with overhead projector,
  • Their colour performance is low and print low quality printouts,
  • They can only print lower-resolution graphics.

Advantages of non-impact printer

  • Non-impact printers offer better print quality, faster printing and the ability to create prints that contain sophisticated graphics, such as photographs,
  • They are much quieter than impact printer as their printing heads do not strike the paper,
  • Expanding technology (will be easier to find parts, toners, etc.),
  • They print on most types of paper but better quality is obtained with better paper,
  • Transparencies are usually supported,
  • The printer cartridges and drums are recyclable.

 Disadvantages of non-impact printers

  • More expensive,
  • More complicated maintenance,
  • A laser printer emits dust particles that can cause respiratory diseases.


Sunday, May 10, 2020

Basic Computer Knowledge in Simple Way
What is computer?

In simple words, it is an electronic symbol manipulating system that is designed to accept data automatically, process them and produce desired output step-by-step under the direction of stored program.



Main Objective of computer

To provide reliable information to the end user.



Main Activities of Computer

  • Input
  • Process
  • Output


Input

An element that is supplied to the computer or received by computer is called Input.


Types of Inputs

  • Data
  • Instruction
Data

  • Collected facts
  • Raw facts or unprocessed details
  • Meaningless facts
  • Facts and Figures

Instruction

It is a command line that instructs computer or hardware unit to perform specific operation or task.


Methods of input

i. Direct entry or Automatic entry method
ii. Manual or Indirect entry method

Central Processing Unit (CPU)

This unit processes the raw data that are send through input devices and generates the meaningful facts.

Output

An element that is obtained from computer after processing.

• Information (meaningful facts)
• Processed facts or result

Types of Outputs

  • Softcopy output (Temporary in nature): Audible form/Visual form.
  • Hardcopy output (Permanent in nature): printed form/written on disk (disk file)