You are on page 1of 21

MODULE 1

Basics of Computer Hardware and Software

Computer: A computer is a combination of hardware and software resources which integrate


together and provides various functionalities to the user. Hardware are the physical components of a
computer like the processor, memory devices, monitor, keyboard etc. while software is the set of programs
or instructions that are required by the hardware resources to function properly.
There are a few basic components that aids the working-cycle of a computer i.e. the Input- Process- Output
Cycle and these are called as the functional components of a computer. It needs certain input, processes
that input and produces the desired output. The input unit takes the input, the central processing unit does
the processing of data and the output unit produces the output. The memory unit holds the data and
instructions during the processing.

 Input Unit :The input unit consists of input devices that are attached to the computer.
These devices take input and convert it into binary language that the computer understands.
Some of the common input devices are keyboard, mouse, joystick, scanner etc.
 Central Processing Unit (CPU) : Once the information is entered into the computer by
the input device, the processor processes it. The CPU is called the brain of the computer
because it is the control center of the computer. It first fetches instructions from memory
and then interprets them so as to know what is to be done. If required, data is fetched from
memory or input device. Thereafter CPU executes or performs the required computation
and then either stores the output or displays on the output device. The CPU has three main
components which are responsible for different functions – Arithmetic Logic Unit (ALU),
Control Unit (CU) and Memory registers
 Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests performs
mathematical calculations and takes logical decisions. Arithmetic calculations include
addition, subtraction, multiplication and division. Logical decisions involve comparison of
two data items to see which one is larger or smaller or equal.
 Control Unit : The Control unit coordinates and controls the data flow in and out of CPU
and also controls all the operations of ALU, memory registers and also input/output units.
It is also responsible for carrying out all the instructions stored in the program. It decodes
the fetched instruction, interprets it and sends control signals to input/output devices until
the required operation is done properly by ALU and memory.
 Memory Registers : A register is a temporary unit of memory in the CPU. These are used
to store the data which is directly used by the processor. Registers can be of different
sizes(16 bit, 32 bit, 64 bit and so on) and each register inside the CPU has a specific
function like storing data, storing an instruction, storing address of a location in memory
etc. The user registers can be used by an assembly language programmer for storing
operands, intermediate results etc. Accumulator (ACC) is the main register in the ALU and
contains one of the operands of an operation to be performed in the ALU.
 Memory : Memory attached to the CPU is used for storage of data and instructions and is
called internal memory The internal memory is divided into many storage locations, each
of which can store data or instructions. Each memory location is of the same size and has
an address. With the help of the address, the computer can read any memory location easily
without having to search the entire memory. when a program is executed, it’s data is copied
to the internal memory and is stored in the memory till the end of the execution. The
internal memory is also called the Primary memory or Main memory. This memory is also
called as RAM, i.e. Random Access Memory. The time of access of data is independent of
its location in memory, therefore this memory is also called Random Access memory
(RAM).
 Output Unit : The output unit consists of output devices that are attached with the
computer. It converts the binary data coming from CPU to human understandable form.
The common output devices are monitor, printer, plotter etc.
Random Access Memory (RAM) and Read Only Memory (ROM)

Random Access Memory (RAM) –

 It is also called read-write memory or the main memory or the primary memory.
 The programs and data that the CPU requires during the execution of a program are stored in this
memory.
 It is a volatile memory as the data is lost when the power is turned off.
 RAM is further classified into two types- SRAM (Static Random Access Memory) and DRAM
(Dynamic Random Access Memory).
Difference between DRAM and SRAM

Read-Only Memory (ROM)

 Stores crucial information essential to operate the system, like the program essential to boot the
computer.
 It is not volatile.
 Always retains its data.
 Used in embedded systems or where the programming needs no change.
 Used in calculators and peripheral devices.
 ROM is further classified into four types- MROM, PROM, EPROM, and EEPROM.

Types of Read-Only Memory (ROM)

 PROM (Programmable read-only memory) – It can be programmed by the user. Once


programmed, the data and instructions in it cannot be changed.
 EPROM (Erasable Programmable read-only memory) – It can be reprogrammed. To erase data
from it, expose it to ultraviolet light. To reprogram it, erase all the previous data.
 EEPROM (Electrically erasable programmable read-only memory) – The data can be erased
by applying an electric field, with no need for ultraviolet light. We can erase only portions of the
chip.
 MROM(Mask ROM) – Mask ROM is a kind of read-only memory, that is masked off at the time
of production. Like other types of ROM, mask ROM cannot enable the user to change the data
stored in it. If it can, the process would be difficult or slow.
Different Types of RAM (Random Access Memory )

RAM(Random Access Memory) is a part of computer’s Main Memory which is directly accessible
by CPU. RAM is used to Read and Write data into it which is accessed by CPU randomly. RAM
is volatile in nature, it means if the power goes off, the stored information is lost. RAM is used to
store the data that is currently processed by the CPU. Most of the programs and data that are
modifiable are stored in RAM.

Integrated RAM chips are available in two form:

1. SRAM(Static RAM)
2. DRAM(Dynamic RAM)

1.SRAM :
The SRAM memories consist of circuits capable of retaining the stored information as long as
the power is applied. That means this type of memory requires constant power. SRAM
memories are used to build Cache Memory.

SRAM Memory Cell: Static memories(SRAM) are memories that consist of circuits
capable of retaining their state as long as power is on. Thus this type of memory is called
volatile memory.Two transistors T1 and T2 are used for connecting the latch with two-bit
lines. The purpose of these transistors is to act as switches that can be opened or closed
under the control of the word line, which is controlled by the address decoder. When the
word line is at 0-level, the transistors are turned off and the latch remains its information.
For example, the cell is at state 1 if the logic value at point A is 1 and at point, B is 0. This
state is retained as long as the word line is not activated.

For Read operation, the word line is activated by the address input to the address
decoder. The activated word line closes both the transistors (switches) T1 and T2. Then
the bit values at points A and B can transmit to their respective bit lines. The sense/write
circuit at the end of the bit lines sends the output to the processor.
For Write operation, the address provided to the decoder activates the word line to close
both the switches. Then the bit value that is to be written into the cell is provided through
the sense/write circuit and the signals in bit lines are then stored in the cell.

2.DRAM :
DRAM stores the binary information in the form of electric charges applied to capacitors. The
stored information on the capacitors tends to lose over a period of time and thus the capacitors
must be periodically recharged to retain their usage. The main memory is generally made up of
DRAM chips.

DRAM Memory Cell: Though SRAM is very fast, but it is expensive because of its every cell
requires several transistors. Relatively less expensive RAM is DRAM, due to the use of one
transistor and one capacitor in each cell, as shown in the below figure., where C is the capacitor
and T is the transistor. Information is stored in a DRAM cell in the form of a charge on a
capacitor and this charge needs to be periodically recharged.
For storing information in this cell, transistor

For storing information in this cell, transistor T is turned on and an appropriate voltage is
applied to the bit line. This causes a known amount of charge to be stored in the capacitor.
After the transistor is turned off, due to the property of the capacitor, it starts to discharge.
Hence, the information stored in the cell can be read correctly only if it is read before the
charge on the capacitors drops below some threshold value.

Types of DRAM :
There are mainly 5 types of DRAM:

1. Asynchronous DRAM (ADRAM) –


The DRAM described above is the asynchronous type DRAM. The timing of the memory
device is controlled asynchronously. A specialized memory controller circuit generates
the necessary control signals to control the timing. The CPU must take into account the
delay in the response of the memory.

2. Synchronous DRAM (SDRAM) –


These RAM chips’ access speed is directly synchronized with the CPU’s clock. For this,
the memory chips remain ready for operation when the CPU expects them to be ready.
These memories operate at the CPU-memory bus without imposing wait states. SDRAM
is commercially available as modules incorporating multiple SDRAM chips and forming
the required capacity for the modules.
3. Double-Data-Rate SDRAM (DDR SDRAM) –
This faster version of SDRAM performs its operations on both edges of the clock signal;
whereas a standard SDRAM performs its operations on the rising edge of the clock
signal. Since they transfer data on both edges of the clock, the data transfer rate is
doubled. To access the data at high rate, the memory cells are organized into two groups.
Each group is accessed separately.

4. Rambus DRAM (RDRAM) –


The RDRAM provides a very high data transfer rate over a narrow CPU-memory bus. It
uses various speedup mechanisms, like synchronous memory interface, caching inside the
DRAM chips and very fast signal timing. The Rambus data bus width is 8 or 9 bits.

5. Cache DRAM (CDRAM) –


This memory is a special type DRAM memory with an on-chip cache memory (SRAM)
that acts as a high-speed buffer for the main DRAM.

Difference between SRAM and DRAM :


Below table lists some of the differences between SRAM and DRAM:

Application Software & System software


System Software is the type of software that is the interface between application software and
system. Low-level languages are used to write the system software. System Software maintains
the system resources and gives the path for application software to run. An important thing is that
without system software, the system can not run. It is a general-purpose software.
Application Software is the type of software that runs as per user request. It runs on the platform
which is provided by system software. High-level languages are used to write the application
software. It’s a specific purpose software. The main difference between System Software and
Application Software is that without system software, the system can not run on the other hand
without application software, the Low-level maintains system always runs.

Compiler and Interpreter


We generally write a computer program using a high-level language. A high-level language is one
that is understandable by us, humans. This is called source code.

However, a computer does not understand high-level language. It only understands the program
written in 0's and 1's in binary, called the machine code.

To convert source code into machine code, we use either a compiler or an interpreter.
Both compilers and interpreters are used to convert a program written in a high-level language into
machine code understood by computers. However, there are differences between how an
interpreter and a compiler works.
High level and low level languages
Programming languages define and compile a set of instructions for the CPU (Central Processing Unit) for
performing any specific task. Every programming language has a set of keywords along with syntax- that
it uses for creating instructions. A few of these languages provide less or no abstraction at all, while the
others provide a very high abstraction. On the basis of this level of abstraction, there are two types of
programming languages:

 Low-level language
 High-level language

Most programming languages that you will have heard of are high-level languages. Python and C#
are examples of high-level languages that are widely used in education and in the workplace. A
high-level language is one that is user-oriented in that it has been designed to make it
straightforward for a programmer to convert an algorithm into program code.

A low-level language is machine-oriented. Low-level programs are expressed in terms of the


machine operations that must be performed to carry out a task. This makes writing programs more
difficult, as the algorithm must be specified in terms of the capabilities and specifications of the
processor. Low-level languages are named for the processor (or processor family) that they are
designed for, and are often referred to as assembly language or machine code.
Flow chart Algorithms, Pseudo code

Algorithm

· Set of step-by-step instructions that perform a specific task or operation

· ―Natural‖ language NOT programming language


Pseudocode

· Set of instructions that mimic programming language instructions

Flowchart: A flowchart is a schematic representation of an algorithm or a stepwise


process, showing the steps as boxes of various kinds, and their order by connecting
these with arrows. Flowcharts are used in designing or documenting a process or
program.

A flow chart, or flow diagram, is a graphical representation of a process or system


that details the sequencing of steps required to create output.

· Visual program design tool

· ―Semantic‖ symbols describe operations to be performed


Examples algorithms: pseudo code, flow chart, programming language
Algorithm and flowchart for linear search
for

For example refer C note book and PPT


Algorithm
Flo

Flowchart

Algorithm,flowchart and pseudo code for bubble sort


Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which
each pair of adjacent elements is compared and the elements are swapped if they are not in order.
For example please refer your C note book
Pseudocode

You might also like