EST102 Programming in C
Module I
Basics of Computer Hardware and Software, Basics of Computer Architecture: processor, Memory, Input& Output
devices. Application Software & System software: Compilers, interpreters, High level and low level languages
Introduction to structured approach to programming, Flow chart , Algorithms, Pseudo code (bubble sort, linear
search - algorithms and pseudocode)
BASICS OF COMPUTER HARDWARE AND SOFTWARE
Computer is an advanced electronic device that takes raw data as input from the user
and processes these data under the control of a set of instructions (called program stored in
memory) and gives the result (output) and saves output for the future use.
Computer Architecture
The basic components of a modern digital computer are: Input Device, Output Device, Central
Processing Unit (CPU), and memory.
Central Processing Unit (CPU)
CPU is the brain of the computer system. All major calculation and comparisons are made
inside the CPU and it is also responsible for activation and controlling the operation of other
units. This unit consists of two major components that are arithmetic logic unit (ALU) and
control unit (CU).
Arithmetic Logic Unit (ALU)
Arithmetic logic unit performs all arithmetic operations such as addition, subtraction,
multiplication and division. It also uses logic operation for comparison.
Control Unit (CU)
The control unit of a CPU controls the entire operation of the computer.
IIPE 1
, EST102 Programming in C
It also controls all devices such as memory, input/output devices connected to the CPU.
Additionally, CPU also has a set of registers for temporary storage of data, instructions,
addresses and intermediate results of calculation
When the ALU, CU and the registers are all integrated on a single chip, it is called a
microprocessor thereby capturing the entire CPU on a single chip
Input /Output Unit
The input/output unit consists of devices used to transmit information between the
external world and computer memory. The information fed through the input unit is stored
in computer's memory for processing and the final result stored in memory can be
recorded or displayed on the output medium.
Examples for input devices: Mouse, Keyboard, Scanner, Joy Stick, Microphone,
OCR (Optical Character Reader), MICR (Magnetic Ink Character Reader)
Examples for output devices: Printer (Dot Matrix, Ink Jet, Laser, Line), Monitor
Memory Unit
The Memory unit refers to the area where instructions and data are stored in a
computer. The processor reads instructions and data from the memory, executes them and
writes the result back to it. Different forms of memory are used in a computer system.
They vary in their size, speed and location. Anything and everything in a computer is
stored in the form of bits known as binary language or machine language. 8 bits make up a
byte. The total number of bytes that a memory chip can hold at a time is termed as its size
or capacity. Information is stored and processed as a group of bytes, called computer word.
The word length is specific for each processor.
The Registers - Since the group of registers is in-built within the processor chip, they
are the fastest accessible units of memory by the processor. They are highly expensive
and hence are limited in number. Some registers are used to store data while some are
reserved to store address. There are some general purpose registers as well. Size of the
registers depends on the processor. Accumulator is a register found on all processors,
which is mainly used to store the operand of an arithmetic operation. Program
IIPE 2
, EST102 Programming in C
counter (PC) always stores the address of the next instruction to be executed by the
processor.
The Cache Memory: - It is a small piece of high speed volatile memory located closer
to the processor for fast processing. Cache memory is made of high speed SRAMs. It
acts as a buffer between the CPU and the RAM. It holds frequently accessed data and
instructions so that they can be easily supplied to the CPU when requested again. Cache
memory is used to reduce the average time to access data from the Main memory.
Primary Memory: - The memory chips that the processor can directly access are
referred to as primary memory. The three types of primary memory are RAM, ROM and
CMOS. RAM is volatile whereas ROM as CMOS are non-volatile memories. They are
metal oxide semiconductor memory cells built on silicon based ICs.
Random Access Memory (RAM): RAM is a volatile memory and loses its contents
when the power is turned off. The circuit is so designed that any random location can
be directly accessed without the need to scroll up or down the memory. The program to
be executed is loaded into RAM from the non-volatile backup memory. The processor
reads instructions and data from the RAM, executes them and writes data back to the
RAM. Hence RAM is also known as the main memory of the computer. Everything from
the RAM is copied to the non-volatile backup memory before the computer is turned
off. The two main types of RAM are Dynamic Ram (DRAM) and static RAM (SRAM).
Each memory cell in a DRAM is made of one transistor and one MOS capacitor, which
store one bit of data. However, this cell starts losing its charge and hence data can be
retained for less than thousandth of a second. So it needs to be refreshed thousand times a
second, which takes up processor time. However, due to small size of each cell, one DRAM
can have large number of cells. Primary memory of most of the personal computers is
made of DRAM.
Each cell in SRAM is made of several transistors in a cross coupled flip flop
configuration that stores one bit. It retains its bit till the power supply is on and doesn’t
need to be refreshed like DRAM. It also has shorter read-write cycles as compared to
DRAM. SRAM is used in specialized applications.
IIPE 3
Module I
Basics of Computer Hardware and Software, Basics of Computer Architecture: processor, Memory, Input& Output
devices. Application Software & System software: Compilers, interpreters, High level and low level languages
Introduction to structured approach to programming, Flow chart , Algorithms, Pseudo code (bubble sort, linear
search - algorithms and pseudocode)
BASICS OF COMPUTER HARDWARE AND SOFTWARE
Computer is an advanced electronic device that takes raw data as input from the user
and processes these data under the control of a set of instructions (called program stored in
memory) and gives the result (output) and saves output for the future use.
Computer Architecture
The basic components of a modern digital computer are: Input Device, Output Device, Central
Processing Unit (CPU), and memory.
Central Processing Unit (CPU)
CPU is the brain of the computer system. All major calculation and comparisons are made
inside the CPU and it is also responsible for activation and controlling the operation of other
units. This unit consists of two major components that are arithmetic logic unit (ALU) and
control unit (CU).
Arithmetic Logic Unit (ALU)
Arithmetic logic unit performs all arithmetic operations such as addition, subtraction,
multiplication and division. It also uses logic operation for comparison.
Control Unit (CU)
The control unit of a CPU controls the entire operation of the computer.
IIPE 1
, EST102 Programming in C
It also controls all devices such as memory, input/output devices connected to the CPU.
Additionally, CPU also has a set of registers for temporary storage of data, instructions,
addresses and intermediate results of calculation
When the ALU, CU and the registers are all integrated on a single chip, it is called a
microprocessor thereby capturing the entire CPU on a single chip
Input /Output Unit
The input/output unit consists of devices used to transmit information between the
external world and computer memory. The information fed through the input unit is stored
in computer's memory for processing and the final result stored in memory can be
recorded or displayed on the output medium.
Examples for input devices: Mouse, Keyboard, Scanner, Joy Stick, Microphone,
OCR (Optical Character Reader), MICR (Magnetic Ink Character Reader)
Examples for output devices: Printer (Dot Matrix, Ink Jet, Laser, Line), Monitor
Memory Unit
The Memory unit refers to the area where instructions and data are stored in a
computer. The processor reads instructions and data from the memory, executes them and
writes the result back to it. Different forms of memory are used in a computer system.
They vary in their size, speed and location. Anything and everything in a computer is
stored in the form of bits known as binary language or machine language. 8 bits make up a
byte. The total number of bytes that a memory chip can hold at a time is termed as its size
or capacity. Information is stored and processed as a group of bytes, called computer word.
The word length is specific for each processor.
The Registers - Since the group of registers is in-built within the processor chip, they
are the fastest accessible units of memory by the processor. They are highly expensive
and hence are limited in number. Some registers are used to store data while some are
reserved to store address. There are some general purpose registers as well. Size of the
registers depends on the processor. Accumulator is a register found on all processors,
which is mainly used to store the operand of an arithmetic operation. Program
IIPE 2
, EST102 Programming in C
counter (PC) always stores the address of the next instruction to be executed by the
processor.
The Cache Memory: - It is a small piece of high speed volatile memory located closer
to the processor for fast processing. Cache memory is made of high speed SRAMs. It
acts as a buffer between the CPU and the RAM. It holds frequently accessed data and
instructions so that they can be easily supplied to the CPU when requested again. Cache
memory is used to reduce the average time to access data from the Main memory.
Primary Memory: - The memory chips that the processor can directly access are
referred to as primary memory. The three types of primary memory are RAM, ROM and
CMOS. RAM is volatile whereas ROM as CMOS are non-volatile memories. They are
metal oxide semiconductor memory cells built on silicon based ICs.
Random Access Memory (RAM): RAM is a volatile memory and loses its contents
when the power is turned off. The circuit is so designed that any random location can
be directly accessed without the need to scroll up or down the memory. The program to
be executed is loaded into RAM from the non-volatile backup memory. The processor
reads instructions and data from the RAM, executes them and writes data back to the
RAM. Hence RAM is also known as the main memory of the computer. Everything from
the RAM is copied to the non-volatile backup memory before the computer is turned
off. The two main types of RAM are Dynamic Ram (DRAM) and static RAM (SRAM).
Each memory cell in a DRAM is made of one transistor and one MOS capacitor, which
store one bit of data. However, this cell starts losing its charge and hence data can be
retained for less than thousandth of a second. So it needs to be refreshed thousand times a
second, which takes up processor time. However, due to small size of each cell, one DRAM
can have large number of cells. Primary memory of most of the personal computers is
made of DRAM.
Each cell in SRAM is made of several transistors in a cross coupled flip flop
configuration that stores one bit. It retains its bit till the power supply is on and doesn’t
need to be refreshed like DRAM. It also has shorter read-write cycles as compared to
DRAM. SRAM is used in specialized applications.
IIPE 3