0% found this document useful (0 votes)
14 views8 pages

Computer Hardware and Software Basics

Uploaded by

danerebeiro0007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Computer Hardware and Software Basics

Uploaded by

danerebeiro0007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module I

Basic of Computer Hardware and Softwares

Computer is an advanced electronic device that takes raw data as input from the user and processes
these data under the control of set of instructions (called program) 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
Processor Unit (CPU), mass storage device and memory.

Central Processor Unit (CPU)

It 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 unit. This unit
consists of two major components that are arithmetic logic unit (ALU) and control unit (CU).

• Arithmetic Logic Unit (ALU)

Here 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. It also controls all devices
such as memory, input/output devices connected to the CPU.
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 display on the output
medium.

Eg: Mouse, Keyboard, Printer, Monitor, etc.

Memory Unit

Computer memory is any physical device capable of storing information temporarily,


like RAM (random access memory), or permanently, like ROM (read-only memory).
Memories can be classified into two categories
• Primary Memory
• Secondary Memory
Primary memory is computer memory that is accessed directly by the CPU. There are two types
of primary memory.
• Read Only Memory (ROM)
• Random Access Memory (RAM)

The content of ROM cannot be changed and can be used only by CPU. It is needed to store Basic
Input Output System (BIOS), which is responsible for booting. This memory is permanent in
storage (non volatile) and is very small in size.
The RAM is a volatile memory i.e. its contents get destroyed as soon as the computers is switched
off. All kinds of processing of CPU are done in this memory.
Secondary Memory

Primary memory has limited storage capacity and is volatile. Secondary memory overcome this
limitation by providing permanent storage of data and in bulk quantity. Secondary memory is also
termed as external memory and refers to the various storage media on which a computer can store
data and programs. The Secondary storage media can be fixed or removable. Fixed Storage media
is an internal storage medium like hard disk that is fixed inside the computer. Storage medium that
are portable and can be taken outside the computer are termed as removable storage media.
eg: Hard disk, Magnetic Tapes, Pen drive

Memory Hierarchy (Out of Scope)


In the Computer System Design, Memory Hierarchy is an enhancement to organize the memory
such that it can minimize the access time. The Memory Hierarchy was developed based on a
program behavior known as locality of references. The figure below clearly demonstrates the
different levels of memory hierarchy:

System Software and Application Software

System Software:
System Software is the type of software which is the interface between application software
and system. Low level languages are used to write the system software. System Software maintain
the system resources and give the path for application software to run. An important thing is that
without system software, system cannot run. It is a general purpose software.
Application Software:
Application Software is the type of software which runs as per user request. It runs on the
platform which is provide by system software. High level languages are used to write the
application software. It is a specific purpose software.

The main difference between System Software and Application Software is that without system
software, system cannot run on the other hand without application software, system always runs.

[Link] SYSTEM SOFTWARE APPLICATION SOFTWARE


System Software maintain the system
Application software is built for
1. resources and give the path for application
specific tasks.
software to run.

Low level languages are used to write the High level languages are used to
2.
system software. write the application software.

3 Machine Dependent Machine independent

4 It is a general-purpose software. It is a specific purpose software.

Without system software, system can’t Without application software


5.
run. system always runs.

System software runs when system is


While application software runs
6 turned on and stop when system is turned
as per the user’s request.
off.

Photoshop, Microsoft Office,


7 Compiler, Operating System, Interpreter
VLC

Types of Languages
Computer programs can be written in high and low level languages, depending on the task and the
hardware being used.

High Level Language

High level languages are written in a form that is close to human language, enabling to
programmer to just focus on the problem being solved.

Advantages

• Easier to modify as it uses English like statements


• Easier/faster to write code as it uses English like statements
• Easier to debug during development due to English like statements
• Portable code – not designed to run on just one type of machine

Example: C, C++, Java, python

Low Level Language


Low level languages are used to write programs that relate to the specific architecture and
hardware of a particular type of computer.

They are closer to the native language of a computer (binary), making them harder for
programmers to understand.

Example: Machine Code

Assembly Language

An assembly language is a low-level programming language designed for a specific type


of processor.

Example: 8085 programing

System Translator
A translator is a programming language processor that converts a computer program from one
language to another. It takes a program written in source code and converts it into machine
code. It discovers and identifies the error during translation. There are 3 different types of
translators as follows:
1) Compiler

A compiler is a translator used to convert high-level programming language to low-level


programming language.
Eg: gcc, javac, g++
2) Interpreter
Just like a compiler, is a translator used to convert high-level programming language to low-level
programming language.
Example: Python, jvm
3) Assembler
An assembler is a translator used to translate assembly language to machine language.
Example: Fortran Assembly Program (FAP), Macro Assembly Program (MAP)
BASIS FOR
COMPILER INTERPRETER
COMPARISON

Input It takes an entire program at a time. It takes a single line of code or


instruction at a time.

Output It generates intermediate object It does not produce any


code. intermediate object code.

Working The compilation is done before Compilation and execution take


mechanism execution. place simultaneously.

Speed Comparatively faster Slower

Errors Display all errors after compilation, Displays error of each line one by
all at the same time. one.

Error detection Difficult Easier comparatively

Example Gcc, g++, javac Python, jvm

Structured Approach to Programming


Structured Programming Approach can be defined as a programming approach in which the
program is made as a single structure. It means that the code will execute the instruction by
instruction one after the other. It doesn’t support the possibility of jumping from one instruction
to some other with the help of any statement like GOTO, etc. Therefore, the instructions in this
approach will be executed in a serial and structured manner. The languages that support Structured
programming approach are:
• C
• C++
• java
Advantages of Structured Programming Approach:
1. Easier to read and understand
2. Easier to Maintain
3. Easier to Debug
4. Machine-Independent, mostly.
Disadvantages of Structured Programming Approach:
1. Since it is Machine-Independent, so it takes time to convert into machine code.
2. The converted machine code is not the same as for assembly language.

Flowchart, Algorithm and Pseudo Code

Algorithm
It is a complete step by step representation of the solution of the problem, represented in English
like Languages. An algorithm can be abstract or quite detailed. A detailed algorithm consists of
every step, equivalent to one instruction of a programming language.
Example: Algorithm to find area of circle

1. Read the value of the radius


2. Calculate the area of circle
3. Print the area of circle.

Pseudo Code
It is a more formal representation than the algorithm. Here, we represent every stp in a formal
way which is very close to the actual programming language representation. In pseudocode, each
of the steps will be written via operator and statements equivalent to some programming
language instructions. The only difference will be that the exact syntax of the programming
language will not be followed. All pseudocodes will start with the keyword “START” and
complete with keyword “STOP” or “END”.

Example: Pseudocode to find area of circle


1. START
2. Read radius
3. area = 3.14 * radius * radius
4. print sum
5. STOP
Flowchart
Very popular method to represent the steps of the solution is the flowchart, which uses many
graphical symbols and thus, is more understandable. The symbol used for various different types
of statements are as shown

Start, Stop

Read, Print

Processing Statements

Condition Check

Direction of flow

Connectors (for longer flow chart)

Example: Flowchart for finding area of circle

Common questions

Powered by AI

High-level languages offer several advantages over low-level languages in software development. They use syntax that is closer to human language, making code easier to write, modify, and debug . This readability allows developers to quickly grasp and implement solutions to problems, maintaining a focus on the algorithmic aspects without worrying about intricate hardware details. Additionally, high-level languages are portable, allowing the same program to run on different types of hardware without modification. In contrast, low-level languages are hardware-specific, making them less accessible and adaptable, though they can offer performance optimizations not possible in high-level languages .

A compiler is a translator that converts a program written in a high-level language into machine code (object code), which the computer can understand and execute . It is essential in programming as it allows developers to write code in human-readable syntax while ensuring the machine can perform the specified tasks. Compilers work by converting the entire program into machine code before execution, offering speed advantages and optimization opportunities over interpreted programs, which translate code one instruction at a time. This compilation process also allows for all program errors to be detected and reported simultaneously, aiding developers in debugging .

Memory hierarchy and locality of reference are design principles that enhance computer performance by organizing memory in levels to minimize access time. Memory hierarchy arranges memory from the fastest, smallest, and most expensive storage at the top (like cache memory) to the slowest, largest, and least expensive at the bottom (like hard drives). The locality of reference principle states that programs tend to access a relatively small portion of memory repeatedly over a short period. By using a hierarchy where frequently accessed data is stored in the faster levels, the system reduces the average time it takes to access data, thereby improving performance . These principles ensure that the most critical data for current processing tasks are quickly accessible.

An algorithm, pseudocode, and flowcharts are interrelated tools used in the program design phase to plan solutions to problems before actual coding begins. An algorithm provides a step-by-step outline of how to solve a problem in natural language, covering all significant actions . Pseudocode takes this further by using a more formalized syntax that closely resembles programming language instructions, without adhering to specific syntax rules . Flowcharts complement these textual representations by offering a graphical depiction of the sequence of steps in the algorithm using standard symbols, aiding visual understanding . Together, these tools help developers conceptualize, organize, and communicate programming solutions effectively.

The Central Processor Unit (CPU) is the brain of the computer system, responsible for executing instructions and processing data. It comprises two main components: the Arithmetic Logic Unit (ALU) and the Control Unit (CU). The ALU performs all arithmetic operations such as addition, subtraction, multiplication, and division, and conducts logical comparisons . The CU manages the entire operation of the computer by controlling the function of its components, such as memory and input/output devices . Together, these components ensure that the CPU makes calculations and controls other units, enabling efficient and accurate functioning of the computer.

Structured programming is defined by its use of a clear, linear flow of control without arbitrary jumps between instructions, such as with the GOTO statement. This approach ensures that programs are organized into logical structures, typically using loops and conditionals, and execute in a predictable order . The advantages of structured programming include improved readability and comprehensibility of code, easier debugging, and simpler maintenance . It promotes code reuse and logical design, making software more robust compared to non-structured programming, which often results in complex and tangled code paths.

Structured programming being machine-independent implies that code written in this paradigm can be executed on different hardware without modification, primarily due to its high-level language nature . This independence enhances portability and usability across various systems. However, this also means that such code must be compiled into machine-specific instructions prior to execution. The compilation process involves an extra step, where a compiler translates the structured, human-readable code into machine code tailored to the architecture it will run on . Consequently, while machine-independence increases flexibility and interoperability, it necessitates advanced compilers to handle the translation efficiently and effectively.

Primary memory, including RAM and ROM, is directly accessed by the CPU. RAM is a volatile memory, meaning its contents are lost when the computer is turned off, while ROM is non-volatile and retains information such as the BIOS necessary for booting . In contrast, secondary memory provides permanent storage for data and programs in bulk, overcoming primary memory's limited capacity. It is also independent of the computer's power state and includes fixed storage media like hard disks and removable media like magnetic tapes and pen drives . Therefore, primary memory is crucial for ongoing processing, whereas secondary memory serves as a long-term data repository.

The three main types of language translators in computer programming are compilers, interpreters, and assemblers. A compiler translates high-level programming code into machine code by processing the entire program as a single unit, generating object code, and optimizing execution . An interpreter, in contrast, translates high-level code line-by-line during execution without generating intermediate object code, which can simplify debugging but slow performance . Lastly, an assembler transforms assembly language, a low-level more human-readable code, into machine language, executing at the hardware level . Each type of translator serves a unique purpose in bridging the gap between human-readable instructions and machine-executable code.

System software serves as an interface between hardware and application software, maintaining system resources and allowing application software to run. It is written in low-level languages, making it machine-dependent and general-purpose; it starts when the system is turned on and stops when it is turned off . Examples include operating systems and compilers. Conversely, application software is designed for specific tasks and relies on the platform provided by system software. Written in high-level languages, it is portable across different systems (machine-independent) and operates upon user request . Examples are Microsoft Office and Photoshop. Thus, while system software underpins the operation of a computer, application software is used for specific user tasks.

You might also like