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

Lecture 1

psuc material muj

Uploaded by

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

Lecture 1

psuc material muj

Uploaded by

rishitgupta2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Problem Solving Using Computers

Syllabus
TEXTBOOKS
E. Balagurusamy, Programming in ANSI C, 8th Edition,
McGraw Hill Publication, 2019.

Y. P. Kanetkar, Let us C, 19th Edition, BPB Publication, 2022.

REFERENCE BOOKS
B. W. Kernighan, D. M. Ritchie, The C Programing Language,
2nd Edition, Prentice Hall of India, 2014.

B. Gottfired, Schaums Outline Series: Programming with C, 4th


Edition, McGraw Hill Publication, 2018.
Evaluation Scheme
Why PSUC is so Important?
• It is fundamental to begin in Computer Science
discipline & in each examination (Private or Govt.
Job)
• PSUC lets you know how exactly Information is
executed at the micro level. The Algorithms,
flowcharts, Analysis and timing analysis can be
analysed at all higher level of course.
• Real life example: Computer System with digital
communication world with many applications like
banking, ATM, Face- book, Corporate Sector,
Defence etc.
Digital computer
• A digital computer is a digital system that performs various
computational tasks and represented by variables with the
limited number of discrete values.

• The discrete values are internally processed with limited number


of discrete states. The decimal digits 0,1,2,…,9 provide 10
discrete values.

• Where the first electronic digital computers developed in 1940.


From here the term digital computer emerged because of many
restrictions with other discrete values.
Functional Units of Computer System

It is divided in two modules in general:


• Hardware: A hardware of the computer system consists of all electronic
components such as electronic circuits, display units, storage media (magnetic
and optical (a class of data storage systems that use light to read
or write data to an underlying optical media-CD, DVD)),
electromechanical devices and communication facilities.

• Software: It consists of the instructions and data that the computer


manipulates to perform various data-processing tasks. Where sequence of
instruction is called a program.
Von Neumann Architecture
• Von-Neumann computer architecture design was proposed in
1945. It was later known as Von-Neumann architecture.

• Historically there have been 2 types of Computers:

1. Fixed Program Computers – Their function is very specific


and they couldn’t be reprogrammed, e.g. Calculators.

2. Stored Program Computers – These can be programmed to


carry out many different tasks, applications are stored on them,
hence the name is.
Von Neumann architecture… Cont’d
• Modern computers are based on a
stored-program concept introduced
by John Von Neumann.

• In this stored-program concept,


programs and data are stored in a
separate storage unit called
memories and are treated the same.

• This novel idea meant that a


computer built with this architecture
would be much easier to
reprogram.
Von Neumann architecture is also known as ISA (Instruction set
architecture) computer and is having three basic units: Central
Processing Unit (CPU), Main Memory Unit and Input/Output Unit.

1. Central Processing Unit-


The central processing unit is defined as an electric circuit used
for the executing the instruction of computer program. It has
following major components:
1.Control Unit(CU)
2.Arithmetic and Logic Unit(ALU)
3.variety of Registers

• Control Unit – A control unit (CU) handles all processor control


signals. It directs all input and output flow, fetches code for
instructions, and controls how data moves around the system.
• Arithmetic and Logic Unit (ALU) – The arithmetic logic unit is
that part of the CPU that handles all the calculations the CPU
may need, e.g. Addition, Subtraction, Comparisons. It performs
Logical Operations, Bit Shifting Operations, and Arithmetic
operations.
Basic CPU structure, illustrating ALU
Input and Output Unit

• Input: Computer accept coded information through input unit.


The most common device is Keyboard. Whenever key is
pressed, the corresponding letter or digit is automatically
translated into its corresponding binary code and transmitted
over a cable to either memory or the processor.

• Output: The output unit is the counterpart of the input unit. Its
function is to send processed results to the outside world. The
most familiar device is a printer. Some units, such as graphical
displays, provide both an input and output function.
Memory
• The function of the memory unit is to store programs and data. There are two
classes of storage, called as Primary and Secondary.

• Primary storage is a fast memory. The memory contains large number of


semiconductor storage cells, each cell capable of one bit of information. These
cells are rarely used as an individual cell instead are processed in group of
fixed size, called words.

• To provide an easy access of any word in memory, a distinguished address is


associated with each word location. Addresses are numbers that identify
successive locations. The typical word lengths range from 16 to 64 bits.

• Memory in which any location can be accessed in short and fixed amount of
time after specifying address is called Random Access Memory (RAM).
Memory Con’d

• Although primary storage is essentials and expensive. But in


addition to the same cheaper memory is available as a
secondary memory storage, where large amount of data and
many programs may be stored.

• A wide range of secondary storage are available in the form of


magnetic disks, tapes and opticals disks (CD-ROMS).
Memory unit
 The computer memory is measured in terms of bits, bytes
and words.
 A bit is a binary digit either 0 or 1.

 A byte is unit of memory and is defined as sequence of 8 bits.

 The word can be defined as a sequence of 16/32/64 bits or


2/4/8 bytes respectively depending on the machine
architecture

15
Primary storage: RAM & ROM
• RAM stands for Random Access Memory
 Read and write memory
 Information typed by the user are stored in this memory
 Any memory location can be accessed directly without
scanning it sequentially (random access memory)
 During power failure the information stored in it will be
erased  volatile memory
• ROM stands for Read Only Memory
 Permanent memory and non - volatile
 Contents in locations in ROM can not be changed
 Stores mainly stored program and basic input output
system programs
16
Secondary memory

 Main memory is volatile and limited


 Hence it is essential for other types of storage
devices where programs and data can be stored
when they are no longer being processed

 Installed within the computer at the factory or


added later as needed
17
Secondary memory
 Non-volatile memory

 Made up of magnetic material

 Stores large amount of information for long time

 Low speed

 Holds programs not currently being executed

18
Cache memory
High speed memory placed between CPU and main
memory
Stores data and instructions currently to be executed
More costlier but less capacity than main memory
Users can not access this memory

19
Buses – Data is transmitted from one part of a computer to
another, connecting all major internal components to the
CPU and memory.

Types:
• Data Bus: It carries data among the memory
unit, the I/O devices, and the processor.

• Address Bus: It carries the address of data


(not the actual data) between memory and
processor.

• Control Bus: It carries control commands


from the CPU (and status signals from other
devices) in order to control and coordinate all
the activities within the computer.
High level Programming Languages

 In computer science, a high-level programming


language is a programming language with strong
abstraction from the details of the computer.

 In contrast to low-level programming languages, it may


use natural language elements, be easier to use, or may
automate (or even hide entirely) significant areas of
computing systems (e.g. memory management), making
the process of developing a program simpler and more
understandable than when using a lower-level language.

 The amount of abstraction defines how "high-level" a


programming language is provided.
Difference between High Level and
Low Level languages

• Both High level language and low level


language are the programming languages’s types.
• The main difference between high level
language and low level language is that
programmers can easily understand or interpret or
compile the high level language in comparison of
machine.
• On the other hand, Machine can easily understand
the low level language in comparison of human
beings. Examples of high level languages are C, C+
+, Java, Python, etc.
Difference between High Level and
Low-level language
High Level Language Low-level language
1. It is programmer friendly language. It is a machine friendly language.

2. High level language is less memory efficient. Low level language is high memory efficient.

3. It is easy to understand. It is tough to understand.

4. Debugging is easy. Debugging is complex comparatively.

5. It is simple to maintain. It is complex to maintain comparatively.

6. It is portable. It is non-portable.

7. It can run on any platform. It is machine-dependent.

8. It needs compiler or interpreter for translation. It needs assembler for translation.

9. It is used widely for programming. It is not commonly used now-a-days in programming.


Compiler
• A Translator (compiler) is a program that reads a program
written in one language, the source language, - and
translate it into an equivalent program in another
language, the target language.

• In computing, a compiler is a computer program that


translates computer code written in one
programming language (the source language) into another
language (the target language).

• The name "compiler" is primarily used for programs that


translate source code from a
high-level programming language to a
low-level programming language (e.g. assembly language
, object code, or machine code) to create an executable
Assembly Language
Assembly Language is a low-level programming language. It helps in
understanding the programming language of machine code.

• Machine code is a series of instructions that provide


the necessary information to a user’s CPU to carry out
a particular task (add, subtract, compare values, etc.).

• In computers, there is an assembler that helps in


converting the assembly code into machine code
executable.

• It establishes with the help of compiling high-level


language source code like C and C++.

• It mainly depends on the system architecture,


whether it is an operating system or computer

You might also like