Programming in C1.1

 Unit-I

Introduction of Computers: 

Computer system may be defined as an electronic device used to store, process and analyze the data followed by the instructions given to it by the user‖. Also defined as an electronic device that operates on data accepted by it as input, processes the data in a predefined way and produces the output known as information.

If we take the literal meaning of the term, a computer is one, and which can ―COMPUTE‖ which means to Calculative.

In 1822 Father of computers charless Babbage Invented difference engine. 

A computer is an electronic device. It has high-speed memory. It can perform arithmetic and logical operation at a high speed by accepting DATA as input stores and process the data and send the results of output devices stores large amount of data and information for sub-sequential manipulations draws and prints the graphs. A visual representation diagram shows the computer process for the information. 

Uses of computers: Computers have entered every area of the society. Society includes the organizations, where individual work. The organizations are educational, commercial, industrial, administrative, transport, medical, and social legal and   financial organizations. 

Characteristics of a Computer

The Characteristics which make computer indispensable are

1) Speed :- The computer is able to process the date and give the output in fractions of seconds such that required information is given to the user on time enabling the user to take right decisions on right time. A powerful computer is capable of executing about 3 million calculations per second.

2) Accuracy :- Inspite of its high speed of processing, the computers accuracy is consistently high enough which avoids any errors. If it all there are errors, they are due to errors in instructions given by the programmer.

3) Reliable :- The output generated by the computer is very reliable, but it is reliable only when the data, which is passing as input to the computer and the program, which gives instructions are correct and reliable.

4) Storage Capacity :- The computer has a provision to store large volumes of data in the small storage devices, which have capacity to store huge amounts of data and help the retrieval of data an easy task.

5) Versatile :- The computer perform three basic operations

a) It is capable to access and accept information through various input-output devices from the user.

b) It performs basic Arithmetic and Logic operations on data as desired.

c) It is capable to generate the desired output in the desired form.

6) Automation :- Once the instructions fed into computer it works automatically without any human intervention until the completion of  execution of program until meets logical instructions to terminate the job.

7) Diligent :- The computer performance is consistent even to all extent of more than 10 million calculations, it does each and every calculation with same speed and accuracy.

According to size computer types are

1. Super Computers

2. Main frame Computer

3. Medium scale Computer

4. Mini Computers

5. Micro Computers.

(1) Super Computers : These computers are characterized as being the fastest, with very high processing speed, very large size, most powerful. There are widely used in complex scientific applications like processing geological data, weather data, genetic engineering etc. These computers with 16 microprocessors, will recognize words upto length 64 bits and more. The speed of calculation is upto 1.2 billion instructions/second, and they can take input from more than 1000 individual work station.

Ex. PARAM developed in India.

(2) Mainframe Computers : These Computer will has capability to support many peripheral devices and terminals, which can process several Million Instructions / second (MIPS), as well which support 1000 remote systems, these computers are mostly used for Railway reservation etc.

(3) Medium Scale (size) Computers : These computers are mini versions of mainframe computers, they are relatively smaller than mainframes and have less processing power than Mainframes their processing speed support upto 200 remote systems.

(4) Mini Computers : These computer are smaller and less experience than Mainframe and medium sized computers. They are relatively faster it can support about 10-20 user terminals. These computers are generally easy to use. They can handle database, statistical problems Accounting  etc.

(5) Micro Computer : These are the mostly used category of computes called as personal computers (PC's). The word Micro suggests only the size, but not the capacity. They are capable to do all input - output operations. They can also be connected to peripheral devices.

Anatomy of Computers

Computer is basically composed of essentially the following:

1. Hardware

2. Software

1. Hardware: Computer hardware is the collection of various physical components of the computer, like the computer itself, the input-output devices. This computer Hardware performs some operations like addition, Subtraction, data transfer, control transfers and simple tests.

  • Input and output devices 
  • Central processing unit (CPU)
  • Memory unit and storage devices 
  • Interface unit

2. Software: Software is set of instructions usually termed as programs which are required for processing activities of the computer. These set of programs can be used to solve real world problems. The capability of computer depends upon the software components.

Basic Input/Output Devices

Input Devices

These are those devices which facilitate a user to gives input, 

Key Boards: This is the most common and popular input device. It is similar to the ordinary typewriter. Key boards usually contain the following keys:-

i) Numeric Keys

ii) Character keys

iii) Function keys

iv) Special keys

Mouse: This input device is used specially for Graphic User Interfaces(GUI). It contains one to three buttons. This is used as a pointing device.

Joy Stick: This is one of the popular input device, which is used for playing video games.

Light Pen: Light is a type of pointing device that is used to choose a displayed menu option on screen for a program. This pen contains a photocell placed in a small tube.

Voice Input Devices: These devices are in stage of experimenting and development, where various problems like speech should be independent of persons.

Scanner A scanner is a device that scans pictures or documents. So that we can store them, seen, modify and print on a printer.

Output Devices: 

Output devices can adopt different shapes and styles, which are used to give the output of the processing of data. The output can be in any form i.e. typed, printed, sketched, visible, nonviable, audio, video etc.

Printers : Printers can be categorized in to

1. Impact Printers

2. Non-impact Printers

a. Impact Printers: These are those type of printers which have direct mechanical contact between the head of the printers and paper. 

The impact printers are Dot Matrix Printers

Non -Impact Printers: - These printers print without any direct mechanical contact between the head of the printer and paper. 

These printers can categorized in to a. Thermal b. Inkjet c. Laser

Monitor: Computer display devices are known as a monitor or Visual Display Unit (VDU). Monitor of different sizes and technology. CRT (Cathode-ray tube) and LCD (liquid crystal display) monitors are the two common types of Monitors.

Central Processing Unit (CPU):- Once the data accepted it fed in to Central Processing Unit before the output is generated as data has to be processed, which is done by CPU. This unit of the computer is the brain of computer system, which does all the processing, calculations, problem solving and controls all other functions of all other elements of the computer. The CPU consists of the following three  distinct units namely.

1. Memory Unit

2. Control Unit

3. Arithmetic and Logic Unit

Control Unit : This unit which coordinates all the activities of each and every element of computer. It decodes the instructions given by various users and it sends commands and signals that determine the sequence of various instructions. Through this unit does not process data but it acts as the central system for data manipulation, as it controls the flow of data to and from the main storage.

Arithmetic and Logic Units:- This unit performs arithmetic operations such as addition,substraction,multiplication and division. It also does Logical Operations such as comparison of numbers etc. Thus this unit helps by processing data and taking logical decisions.

Memory Unit: Which holds the data in in terms of Program and files. The data stored can be accessed and used whenever required by the CPU for necessary processing. This memory unit is usually referred as primary storage section. The units in which memory unit is measured are known as BYTES.

BYTE is the space required to store 8 characters or alphabet or digits to any other special character.

1 Byte = 8 Bits.

1 Kilobyte = 1024 Bytes

1 Megabyte = 1024 Kilobytes

1 Gigabyte = 1024 Megabytes

1 Terabyte = 1024 Giga bytes

Where Bits are spaces required to store one Binary digits i.e. either 0 or 1.

An electronic storage area of a computer is known as Memory.  It is mainly of two types: primary memory and the secondary memory. 

Primary memory 

Primary memory stores the currently executing data and. Primary memory is also known as main memory. This memory is accessed directly by the processor. It includes RAM, Cache memory. 

Secondary Memory 

Secondary memory provides large storage. It is permanent memory and inexpensive. It is slower than primary memory. It is also known as auxiliary memory. It includes Storage devices such as hard disks, floppy disks, CDROMs, and magnetic tapes.

Memory hierarchy 

A computer system uses various types of memory. These memory differ in speed, cost, size, and volatility. They can be organized in a hierarchy, as shown below:


It shows that from top to bottom, the speed decreases but the capacity increases and the prices become much lower. The registers, Cache, RAM are volatile but the secondary memory are non-volatile.

Interface unit A set of parallel lines that interconnects the CPU with memory and I/O devices are known as the interface unit. 

It can be classified into three types: 

Data bus: It can carry the actual data. 

Address bus memory or Input/output device: It can transport the Addresses. 

Control bus: It can carry the control information between the CPU and other devices 

Motherboard 

It is an electronic circuit board. It holds all the components in the computer system. The motherboard provides physical connections among them. 

It consists of the following: 

CPU Socket: It holds the central processor. 

Memory Sockets: These sockets hold the RAM. 

 Interface module: It is for the hard disk, floppy disk, and CD-ROM drives. 

ROM integrated chip: It contains the BIOS programs. 

 Ports and expansion slots: It is used to connect a device with the bus. 

 PCI slots: It connects the I/O devices. 

 Advanced graphics port (AGP): It holds the Video card. 

Parallel port: It is used as the printer port, or LPT1. 

Serial ports: These are used as communication ports or COM ports. 

USB (universal serial bus): This is a serial port. USB can connect the devices, such as mouse, keyboards, hard disk drives, pendrives, cameras, modems and printers. 

 CMOS: The CMOS stands for Complementary Metal Oxide semiconductor memory. It is a type of RAM that stores information about the size of the hard disk, the amount of RAM, etc. 

SOFTWARE: - Collection of Programs are Software. The Software is those components which make the task of a user complete, as it is that component which helps a user to give set of instructions. The Software is categorized on the basis of functions they are

1. System Software 2 .Application Software

1. System Software:- The System software as a package which consists of various programs required for the functioning of the computer itself. It is also needed for translation, loading, controlling and running of the program. The System software can categorized in to

1.Operating System

2. Language Processors ( Assemblers, Compilers, Interpreters)

3. Device Drivers

4. Utility Programs etc.

Application Software:

This is that software which serves specific purposes and allows the user to create applications which are for a given purpose like financial accounting, payroll examinations, human resources management etc. These software can be further classified, depending upon the source of development as well the users:

i) Pre written application software.

ii) Custom Software

Pre written application software.

These are those software packages which are developed by group of people or an individual to be used by others. The most commonly available prewritten application software are:

i) Word processing software

ii) Electronic spreadsheets

iii) Database management software

iv) Graph generator

v)Report generator

vi) Communication software

Custom Software: 

Software that is developed for a specific user is known as custom software

Memory RAM: 

RAM stands for Random Access Memory. Any location in a RAM can be accessed directly. RAM is volatile in nature. Its contents can be erased when the power is off. So that it is also known as Temporary Memory. They are limited in size. 

TYPES OF RAM: There are two types of RAM. Dynamic RAM and Static RAM. 

Dynamic RAM (DRAM): It refreshes its data after every few milliseconds. It has higher storage capacity and is cheaper than Static RAM. 

Static RAM (SRAM): It need not be refreshed. It remains stable as long as power is supplied to it. SRAM is costlier but has higher speed than DRAM.

Cache Memory: It is high speed memory. That processor can access this memory much faster than  other memory. Cache memory is a place to the CPU where in Computer.

 ROM: ROM means ―Read Only Memory‖. It is used to read the instructions but not write the instructions in the memory. It memory consist of 3 types. They are

a.)PROM: Programmable Read Only Memory

b.)EPROM: Electrically Programmable Read Only Memory

c.)EEPROM: Erasable Electrically Programmable Read Only Memory.

Secondary Memory : Which is non-volatile memory and which is external to computer. It is a secondary media used for storing large volumes of data permanently for long term.

1. Fixed or Hard disks:- Fixed or Hard disks is usually made from aluminum or other materials instead of plastic like material. . Hard disk is permanently installed in the drive . This disk is usually large(about14inches). These disks also come in various sizes like 9inch,5inch etc.

2. Floppy disks: This new device used for secondary storage media, this small ,flexible, faster and cheap alternative for the storage purpose. This disk is made up of flexible plastic material, coated magnetic materials like iron oxide. Data is recorded in the form of invisible magnetic spots on coating. This floppy diskette comes in three basic sizes are 8 inch,5.25 inch and 3.5 inches

3.CD’s A CD is a portable secondary storage medium. Various types of CDs are available: CD-R and CD-RW. Once created Data stored on CD-R (CD Recordable) disc can’t be changed. A CD Rewritable (CD-RW) disc can be erased and reused. . CD-RW drives are used to create and read both CD-R and CD-RW discs.

4.Magnetic Tapes :- These are external storage devices which as used as high speed input and output devices. These devices use a tape which is about 12.5 mm to 25 mm wide and about 500meters long. This tape made up of plastic like material known as mylar. This tape is wound on a spool which can be loaded onto the tape deck. This deck is connected to the CPU permanently and the information stored into or read from ,the tape by the processor. This tape is coated with a very thin layer of iron oxide, magnetic material.

5.USB Flash drive: It is a small, portable flash memory card. It can be plugged into a computers USB port. It is easy to carry and more durable. Because it cannot contain any internal moving parts. It is also are called pen drive..

Operating Systems

An operating system is a system software that acts as an intermediary between the user and the Hardware. Mac, MS Windows, Linux, Solaris, Android etc are some of the operating systems. 

The common functions of an operating system: 

 Process(or) management A process is a program in execution. The operating system decides which process to run. It also assigns priority to the processes. 

 Memory management Operating system is responsible to allocate and de-allocate memory. 

 Device management The operating system controls accesses to the I/O devices among the processes. 

 File management: The file system in an operating system allows users to create, delete, modify, open, close, and apply other operations to various types of files. 

Booting 

Booting is the initial set of operations that the computer performs when it is switched on. When a computer is switched on, it performs BIOS/POST and loads the Operating system files into memory. 

Booting is of 2 types: 

Cold booting: The process of starting the computer and loading its operating system by turning the power on. 

Warm booting: The process of restarting the computer and loading its operating system again is known as warm booting

Operational overview of a CPU

 The processing required for a single instruction is called an instruction cycle. The CPU performs four steps for each instruction: fetch, decode, execute, and store.

 First, the instruction is fetched from main memory and loaded into Instruction Register (IR), Its address is specified by PC register.

  Then it increments the PC to the next instruction in the program. 

 In IR, the instruction is decoded to determine the actions needed for its execution.  The control unit enables execution of the instruction. 

 The result of the instruction is stored (written) to either a register or a memory location.  The next instruction of a program will follow the same steps. 

 This will continue until there is no more instruction in the program or the computer is turned off. 




No comments:

Post a Comment