0% found this document useful (0 votes)
9 views

Chapter 1

Uploaded by

patel.ved98795
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Chapter 1

Uploaded by

patel.ved98795
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

CHARUTAR VIDYA MANDAL UNIVERSITY

A D PATEL I NSTITUTE O F T ECHNOLOGY

Introduction to Computers & Programming

P REPARED BY:
P ROF. A XIT K ACHHIA
CP D EPARTMENT
Outline
✓Introduction to computer : Basic Block Diagram

✓Functions of various components of computer

✓ Concepts of Hardware and Software, Types of Software

✓Computer Languages and Programming : Concepts of Machine level,


Assembly level and high level languages, Compiler and interpreter

✓Flow chart and Algorithm

2
Introduction to Computer
➢A computer is an electronic device that manipulates information, or data.
It has the ability to store, retrieve, and process data.
➢You may already know that you can use a computer to type documents,
send email, play games, and browse the Web.
➢Taking in information is called input, storing information is better known
as memory (or storage), chewing information is also known as processing,
and spitting out results is called output.

3
Basic Block Diagram of Computer
• Control (control unit or CU) and arithmetic & logic unit (ALU) combined
called Central Processing Unit (CPU).

4
Central Processing Unit (CPU)
➢It is the brain of the computer system.
➢A central processing unit (CPU), also called a central processor, main
processor or just processor, is the electronic circuitry that
executes instructions comprising a computer program.
➢All major calculations 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, which are the arithmetic logic
unit (ALU) and control unit (CU).

5
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.
➢ALU is a subsystem of the CPU that performs arithmetic and logical
operations. In brief, ALU is a subpart of the CPU.

6
Control Unit
➢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.
➢CU fetches instructions from memory, decodes the instruction, interprets
the instruction to know what the task is to be performed and sends suitable
control signals to the other components to perform for the necessary steps
to executes the instruction.

7
➢Input/Output Unit:
The input/output unit consists of devices used to transmit information
between the external world and computer memory.
➢Disk Storage Unit :
Data and instruction enter into a computer system through input device have
to stored inside the computer before actual processing start.
There are Two Types of Storage:
1) Primary Storage 2) Secondary Storage

8
Continue…
➢Primary memory has a direct link with the input unit and output unit. It
stores the input data, calculation results.
➢The primary storage is not able to store data permanently for future use.
➢So some other types of storage technology are required to store the data
permanently for a long time, it is called secondary or auxiliary storage.

9
Hardware & Software
➢For a computer to function properly, it must consist of both hardware and
software, because the hardware and software are interdependent.
➢This means that the one will not function without the other.
➢Hardware consists of the physical components of a computer, also
referred to as the equipment of a computer. Hardware devices can be
categorized according to their functionality on the computing device.

10
Hardware
➢The common physical components of a computer system that are input
(keyboard, mouse), storage (hard drive), memory (RAM), processing (CPU),
output (monitor, printer) and communication (Network Interface Card, NIC).
➢Input devices are any hardware devices that allows you to input data into a
computer or interact with a computer.

11
Hardware
➢A storage device is a hardware device that allows you to store data for later
use. There are many different storage devices, with each device having
advantages and disadvantages. Some of the most popular storage devices
include hard disk drives (HDDs) and solid-state drives (SSDs).

12
Hardware
➢Random-access memory (RAM) refers to a fast, temporary form of storage.
All data and instructions that is currently being executed is stored in RAM.
RAM is volatile, that is, all data is erased from your RAM when your
computer is turned off. RAM is also referred to as memory.

13
Hardware
Processing devices receive the data from the RAM, perform sets of
instructions, and returns the processed data to the RAM. The two most
important processing devices in modern computers are:
The Central Processing Unit (CPU) is responsible for processing general
instructions. Every application makes use of the CPU to collect, decode and
execute instructions as required by the application.
The Graphics Processing Unit (GPU) is responsible
for processing the instructions that create the pictures
on your screen, for example, three-dimensional games
rely heavily on the GPU to create their images.
14
Hardware
➢Output devices are devices that return the computer’s instructions, as
results, to the user. Popular output devices include monitors / screens and
printers.

15
Software
➢Software refers to the set of instructions a computer uses to complete any
instructed task. Software is the program that is operated by the hardware.
Hardware cannot do anything without software because it depends on the
processed instructions to provide input, while software cannot function
without hardware to process the user’s instructions.

16
Software
➢The two most important types of software are
1. system software (including the operating system)
2. application software

➢SYSTEM SOFTWARE: System software is the specific type of software that


manages the flow of data and the information contained on the computer.
The operating system (OS) is the most important type of system software.
Examples of operating systems include Microsoft Windows, Linux, MacOS,
iOS and Android.

17
Software
➢APPLICATION SOFTWARE: Application software is a program that is built for
a specific purpose, like sending a message, browsing the internet, or typing a
document.
➢Application software requires system software in order to function.
➢Examples include Microsoft Office, Google Chrome, Mozilla Firefox and
Skype. Games and mobile applications such as Spotify and Uber, are also
considered application software.

18
Levels of Programming Languages
There are two main levels of programming languages:
Low-Level Languages: Machine Code and Assembly Language.
High-Level Languages: Java, Python, PHP, Perl, C#, JavaScript, etc.

19
Low Levels of Programming Languages
➢Low-Level code is more easily read by computers and is faster at runtime.
This code runs more efficiently, it’s not efficient for developers to write.
Machine language or machine code is the only language that computers can
understand and receive instructions. These machine languages are often
either binary or hexadecimal code.

20
High Levels of Programming Languages
A high-level language has a higher level of abstraction from the computer,
and focuses more on the programming logic.
A high-level language is any programming language that enables
development of a program in a much more user-friendly programming
context and is generally independent of the computer's hardware
architecture.
Example: java, python, PHP, SQL,C++,C# etc.

21
Compiler & Interpreter
➢Compiler:
➢The compiler is software that converts a program written in a high-level
language (Source Language) to a low-level language (Object/Target/Machine
Language/0’s, 1’s).
➢A compiler is a program that translates source code into object code to be
understood by a specific CPU. The act of translating source code into object
code is known as compilation.
➢In computing, a compiler is a computer program that translates computer
code written in one programming language into another language.

22
Continue…

23
Continue…
➢Interpreter:
➢An interpreter is a type of computer program used to convert high-level
program statements into machine code. Both interpreters and compilers
convert the high-level programs to a machine code;
➢However, interpreters convert the code when the program is run, while
compilers convert the code before the program it is run.
➢An interpreter translates code into machine code, instruction by
instruction - the CPU executes each instruction before the interpreter moves
on to translate the next instruction. Interpreted code will show an error as
soon as it hits a problem, so it is easier to debug than compiled code.

24
Continue…

25
Difference
➢Compiler code runs significantly faster than the interpreted code. This is
because the compiler transforms the programming language into machine
code at once before the program runs.
➢An interpreter converts each program statement, one by one, into the
machine as the program runs.
➢Compilers can take an entire program, whereas interpreters can only take a
single line of code.

26
Flowchart & Algorithm
➢A flowchart is the graphical or pictorial representation of an algorithm with
the help of different symbols, shapes, and arrows to demonstrate a process
or a program.
➢A flowchart is a type of diagram that represents a workflow or process.
➢A flowchart can also be defined as a diagrammatic representation of an
algorithm, a step-by-step approach to solving a task.
➢The flowchart shows the steps as boxes of various kinds, and their order by
connecting the boxes with arrows.

27
Continue…

28
Continue…
➢An Algorithm is a step of a step by step instructions that describe how to
perform a task.
➢An algorithm is a procedure used for solving a problem or performing a
computation.
➢A logical step-by-step method to solve the problem is called the algorithm
an algorithm is a procedure for solving problems.
➢An algorithm includes calculations, reasoning, and data processing.
Algorithms can be presented by natural languages, pseudocode, and
flowcharts, etc.

29
Continue…

30
Difference between Both

31
Example…
➢Write an algorithm and draw a flowchart to finding a given number is odd
or even.

32

You might also like