0% found this document useful (0 votes)
10 views9 pages

Familiarization with computer hardware and programming environment

The document provides an overview of computer hardware, software, and data, explaining the components of a computer system including the input unit, CPU, memory unit, and output unit. It details the functions of each component and the architecture of a motherboard, including various ports and expansion slots. Additionally, it covers basic programming concepts in C, including algorithms, flowcharts, and the compilation and execution of programs.

Uploaded by

Rohan Nayaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
10 views9 pages

Familiarization with computer hardware and programming environment

The document provides an overview of computer hardware, software, and data, explaining the components of a computer system including the input unit, CPU, memory unit, and output unit. It details the functions of each component and the architecture of a motherboard, including various ports and expansion slots. Additionally, it covers basic programming concepts in C, including algorithms, flowcharts, and the compilation and execution of programs.

Uploaded by

Rohan Nayaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

1. Familiarization with computer hardware and programming


environment, concept of naming the program files, storing,
compilation, execution and debugging. Taking any simple C- code.
What is computer?

A Computer is device that can automatically performs a set of instructions. The computer
takes as input these instructions as a single unit, uses them to manipulate the data, and outputs
the results in user-specified ways. The processing is fast, accurate and consistent, and is
generally achieved without significant human intervention.

What is Software?

Software is a collection of code that drives a computer to perform a related group of tasks. It
comprises one or more programs, supported by libraries and configuration files that
programs needed to access.

What is Hardware?

The hardware devices are the physical components of a computer system such as electronic,
magnetic and mechanical devices, which we can touch and feel.

What is Data?

It is a collection of raw facts that may be organized or unorganized having implicit meaning
which can be recorded and processed into information.

Architecture of a Computer

Dept. of CSE, Canara Engineering College Page 1


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

The components of Computer


1. Input Unit.
2. Central Processing Unit.

i. Control unit (CU).


ii. Arithmetic and Logic Unit (ALU).
iii. Registers.
3. Memory Unit.
i. Primary Memory
a. Random Access Memory (RAM)
b. Read Only Memory (ROM)
ii. Secondary Memory
4. Output Unit.

Input Unit
Input unit of a computer accepts the data and instructions required to solve a problem from
the outside world or user. The input unit may consist of one or more input devices such as
keyboard and mouse. Input unit converts the accepted data into binary form and sends it for
processing.

Example: Keyboard, Mouse, Scanner, Camera etc..

Central Processing Unit (CPU)


The CPU is known as the brain of the computer. The CPU interprets the instructions in the
program and executes them one by one and produces the desired result.

CPU has following three major parts

1. Control Unit.
2. Arithmetic and Logic Unit.

3. Registers
Control Unit (CU)

 It controls and directs the transfer of data and program instructions between
various units.
 It maintains order and directs the operations of entire system.
 It performs four basic operations, they are:

 Fetches an Instruction.
 Decodes the instruction.

 Executes the instruction.

Dept. of CSE, Canara Engineering College Page 2


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

 Stores the result.

Arithmetic and Logic Unit (ALU)


ALU performs arithmetic operations like addition, subtraction and logical operations like
AND, OR and Relational operations like <,>,>= and also controls the speed of these
operations.

Registers
They are high speed temporary storage units of CPU used to store instructions and
intermediate data or results temporarily during processing.

Memory Unit
Memory unit is the only storage area in a computer. Memory unit stores data, instructions,
intermediate results and final output generated. Secondary storage devices are additional
memory used to store data permanently ex: pen drives, Floppy disk etc.

Memory is divided into two types

1. Primary Memory
2. Secondary Memory

Primary Memory

The primary memory is also called as main memory or volatile memory.

It is also divided into two types

1. Random Access Memory (RAM): Used to speed up the file accessing between
Secondary memory and Processor and it is volatile in nature.
2. Read Only Memory (ROM): used to hold BIOS.

Secondary Memory

The secondary memory is also called as permanent memory. This is huge in size. This has
magnetic, Optical and semiconductor memory devices.

Output Unit:
The output unit displays the results, which are stored in memory. It converts the
results which are in binary form into user understandable form and then displays the result to
the user or outer world.

Example monitor, printers, Projector, Speaker etc.

Dept. of CSE, Canara Engineering College Page 3


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Specification of computer hardware components


Motherboard

A motherboard is the central printed circuit board (PCB) of the computer, that holds many
of the crucial components of the system, such as cpu, memory, expansion slots etc. while
providing connectors for other peripherals, The motherboard is sometimes alternatively
known as the main board or system board

Motherboard Chipset

Motherboard chipset controls all the data that flows through channels of the motherboard. Its
primary function is to direct the data to correct areas of the motherboard.

Components of a MOTHERBOARD

 Bus

 I-O ports
 Expansion slots

 Input device ports


 RAM memory slots
 Hard disk controller

 Floppy controller
 processor socket or slot

 Cache memory
 BIOS Chip

 CMOS
Bus

 The various components of a computer are connected with the help of physical
connections or group of wires called buses.
 A BUS is a Circuit that provides a communication path between two or more devices
of a digital Computer system.
 Internal bus: The bus that connects the internal components like CPU, System
memory and all other components on the mother board is called internal bus. It also
referred to as system bus.
 External Bus: The bus that connects the different external devices, peripherals,
expansion slots, I-O ports and drive connections to the rest of the computer is called
External Bus.

Dept. of CSE, Canara Engineering College Page 4


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Communication Ports or I-O ports


Port is a socket used to connect external devices to the computer.
There are two types of ports

1. Serial Port
2. Parallel Port

Serial port
The serial port is an Asynchronous port which transmits data serially one bit at a time. It is
also known as RS-232-C port or COM port. It is used to attach mouse, modem and other
small serial devices to the computer.

Parallel Port

Most printers use a special connector called a parallel port. Parallel port carries 8 bits of data
at a time on parallel paths, hence it is faster way for computer to communicate with input and
output device. Parallel ports use a 25-pin female DB connector. Parallel port is also known as
printer port.

SCSI ( Small Computer System Interface) Port

These connectors are costlier as they provide faster access at very high speed. They
need dedicated adapters to function. These are typically 25 & 50 pin connectors. High
performance hard disks and scanners use SCSI interface.

USB (Universal Serial Bus)

USB is a Plug and Play interface between computer and add-on devices. USB
provides hot plug and unplug feature. It supports a data speed of 12 Mbps, supporting 127
physical devices.

Dept. of CSE, Canara Engineering College Page 5


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Motherboard slot or expansion slot

Expansion slot is the area in the motherboard into which expansion boars are inserted,
connecting them to pc’s bus. Expansion slots are used for adding functionality to the
computer.

ISA slot: (Industry Standard Architecture)

It is the standard architecture of the Expansion bus. It is a 16-bit slot. ISA cards are Non plug
and play cards.

PCI slot: Intel introduced the Peripheral component interconnect bus protocol.

The PCI bus is used to connect I/O devices such as NIC or RAID controllers to the main
logic of the computer. PCI is a 32 bit slot and can perform twice the amount of data transfer
for a device than ISA. PCI bus has replaced the ISA bus.

AGP slot

Modern motherboards have a single connector that looks like a PCI slot, but is slightly
shorter and usually brown and also probably have a video card inserted into this slot. This is
an Advanced Graphics Port (AGP) slot.

RAM Slots

Random-Access Memory (RAM) stores programs and data currently being used by the CPU.
RAM is measured in units called bytes.

There are typically two types of sockets to install memory:

• SIMM-Single Inline Memory Module.


• DIMM- Dual Inline Memory Module consists of 168 pins.
Cache Memory

Cache memory increases the performance of the system by storing frequently used program
code or data. It is faster than RAM and hence system can store information accessed from
RAM in Cache Memory. There are two types of cache L1 (level1) cache: Integrated within
the processor and L2 (level2) cache: Located outside the processor.

CMOS Battery: The CMOS (complementary metal oxide semiconductor) is a listing of


system components, such as hard disk size, resources used by serial and parallel ports etc. To
provide power for CMOS when the computer is turned off all motherboards have a battery
known as CMOS Battery.

PRINTERS: Printer is an hard copy output device that produces text and graphics on a
physical medium like paper.

Printers are classified as follows

Dept. of CSE, Canara Engineering College Page 6


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Types of hard disks:


• SCSI HDD: These drives are of higher speed and are costlier. Used for sever
systems.
• IDE HDD: The IDE or ATA is commonly used standard in PC’s and it uses same
connection like CD or DVD drive.
• Serial ATA(SATA): These drives have large capacity, huge buffer and faster data
transfer rates
• External HDD: these drives are connected to the computer through USB and have
large storage capacity, normally used for Backup.

SMPS(SWITCHED MODE POWER SUPPLY)


• It supplies power to different parts of the computer.
• It converts 230 volts of AC to 5 to 12 DC volts.
• Wattage of SMPS is around 180 to 300 watts.

Programming Environment

Program to print a simple message

Algorithm

Step by step procedure to solve the given Problem written in natural language.

Example:
Step 1: Start
Step 2: Print the simple message
Step 3: Stop

Dept. of CSE, Canara Engineering College Page 7


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Flow chart

Example:

Start

Display Greeting message

Stop

Dept. of CSE, Canara Engineering College Page 8


C Programming Laboratory (17CPL 13/23) Santhosh Kumar D K

Compilation of Program

gcc –o outfile programfile.c

example:

gcc –o prog prog.c

Excution of program:

./outfile

Example

./prog

Dept. of CSE, Canara Engineering College Page 9

You might also like