0% found this document useful (0 votes)
28 views14 pages

Fundamentals of Computer

The document discusses the fundamentals of computer architecture, focusing on the Von Neumann architecture, which stores both programs and data in the same memory unit, allowing for easier reprogramming. It outlines the advantages and disadvantages of this architecture, as well as the hierarchy of memory types, including cache, primary, and secondary memory, along with their characteristics. Additionally, it covers programming languages, algorithms, and flowcharts, highlighting the differences between high-level and low-level languages, and the roles of algorithms and flowcharts in problem-solving.

Uploaded by

disha
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)
28 views14 pages

Fundamentals of Computer

The document discusses the fundamentals of computer architecture, focusing on the Von Neumann architecture, which stores both programs and data in the same memory unit, allowing for easier reprogramming. It outlines the advantages and disadvantages of this architecture, as well as the hierarchy of memory types, including cache, primary, and secondary memory, along with their characteristics. Additionally, it covers programming languages, algorithms, and flowcharts, highlighting the differences between high-level and low-level languages, and the roles of algorithms and flowcharts in problem-solving.

Uploaded by

disha
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
You are on page 1/ 14

Fundamentals of Computer

By
Jay Prakash Singh
Assistant Professor (Department of CSE)
Manipal University Jaipur, Jaipur, Rajasthan, India
E-mail- [email protected]

 Stored Program Architecture


The 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 was first published by John von Neumann 1945.

His computer architecture design consists of a Control Unit, Arithmetic and Logic
Unit (ALU), Memory Unit, Registers and Inputs/Outputs.

Von Neumann architecture is based on the stored-program computer concept, where


instruction data and program data are stored in the same memory. This design is still
used in most computers produced today.

The Von Neumann architecture is also known as the Princeton architecture.

Von Neumann architecture is the design upon which many general purpose
computers are based. The key elements of von Neumann architecture are:

 data and instructions are both stored as binary digits


 data and instructions are both stored in primary storage
 instructions are fetched from memory one at a time and in order (serially)
 the processor decodes and executes an instruction, before cycling around to fetch
the next instruction
 the cycle continues until no more instructions are available

1
 A processor based on von Neumann architecture has five
special registers which it uses for processing:

 the program counter (PC) holds the memory address of the next instruction to be
fetched from primary storage
 the memory address register (MAR) holds the address of the current instruction that
is to be fetched from memory, or the address in memory to which data is to be
transferred
 the memory data register (MDR) holds the contents found at the address held in the
MAR, or data which is to be transferred to primary storage
 the current instruction register (CIR) holds the instruction that is currently being
decoded and executed
 The accumulator (ACC) is a special purpose register and is used by the arithmetic
logic unit (ALU) to hold the data being processed and the results of calculations.
 Advantages of Von Neumann Architecture
Here are some advantages of the Von Neumann architecture:

 Control Unit retrieves data and instruction in the same manner from one memory.
Design and development of the Control Unit is simplified, cheaper and faster.
 Data from input / output devices and from memory are retrieved in the same
manner.
 Organization of memory is done by programmers which allow them to utilize the
memory’s whole capacity.

2
 Disadvantages of Von Neumann Architecture
Here are some disadvantages of the Von Neumann architecture:

 Parallel implementation of program is not allowed due to sequential instruction


processing.

 Von Neumann bottleneck – Instructions can only be carried out one at a time
and sequentially.
 Risk of an instruction being rewritten due to an error in the program.

 Memory Hierarchy in Computer Architecture


A memory unit is the collection of storage units or devices together. The memory unit
stores the binary information in the form of bits. Generally, memory/storage is classified
into 2 categories:

 Volatile Memory: This loses its data, when power is switched off.

 Non-Volatile Memory: This is a permanent storage and does not lose any data
when power is switched off.

In any computer systems, storage of information is always organized in a hierarchy as


shown here as a triangle. This has many layers representing different type of storage.

3
Memory is primarily of three types −

 Cache Memory

 Primary Memory/Main Memory

 Secondary Memory

Cache Memory

Cache memory is a very high speed semiconductor memory which can speed up the
CPU. It acts as a buffer between the CPU and the main memory. It is used to hold those
parts of data and program which are most frequently used by the CPU. The parts of
data and programs are transferred from the disk to cache memory by the operating
system, from where the CPU can access them.

Advantages

 The advantages of cache memory are as follows −

 Cache memory is faster than main memory.

 It consumes less access time as compared to main memory.

 It stores the program that can be executed within a short period of time.

 It stores data for temporary use.

4
Disadvantages

 The disadvantages of cache memory are as follows −

 Cache memory has limited capacity.

 It is very expensive.

Primary Memory (Main Memory)

Primary memory holds only those data and instructions on which the computer is
currently working. It has a limited capacity and data is lost when power is switched off. It
is generally made up of semiconductor device. These memories are not as fast as
registers. The data and instruction required to be processed resides in the main
memory. It is divided into two subcategories RAM and ROM.

Characteristics of Main Memory

 These are semiconductor memories.

 It is known as the main memory.

 Usually volatile memory.

 Data is lost in case power is switched off.

 It is the working memory of the computer.

 Faster than secondary memories.

 A computer cannot run without the primary memory.

5
Secondary Memory

This type of memory is also known as external memory or non-volatile. It is slower than
the main memory. These are used for storing data/information permanently. CPU
directly does not access these memories; instead they are accessed via input-output
routines. The contents of secondary memories are first transferred to the main memory,
and then the CPU can access it. For example, disk, CD-ROM, DVD, etc.

Characteristics of Secondary Memory

 These are magnetic and optical memories.

 It is known as the backup memory.

 It is a non-volatile memory.

 Data is permanently stored even if power is switched off.

 It is used for storage of data in a computer.

 Computer may run without the secondary memory.

 Slower than primary memories.

Some of the key differences between RAM and ROM are as follows:

RAM ROM

It is a temporary memory of the It is the permanent memory of the computer.


computer.

It is a read-write memory. The data can It is a read only memory. The data can only be
be written and read. read.

It is a volatile memory as it temporarily It is a non-volatile memory as it permanently

6
stores the files as long as the computer stores the files even when the power is turned
is on and working. off, such as game cartridge and BIOS program
stored in the memory of a computer, etc.

The storage capacity ranges from 1 to Its storage capacity ranges from 4 to 8 MB.
256 GB.

It is large in size than ROM. It comes in Its size ranges from less than an inch in length
two different sizes for use in desktop to multiple inches in length and width based
computers and laptops. A desktop ram on their use. It has less capacity than RAM.
is around 5.5 inches in length and 1
inch in width. Whereas, the Laptop RAM
is around half the length of desktop
RAM.

Data stored in RAM can be retrieved We can only read the data stored in ROM. It
and altered. cannot be altered.

It is faster than ROM as it is a high- It is slower than the RAM.


speed memory.

The data stored in RAM is used by the The data stored in ROM is used by CPU only
CPU in real-time to run the computer. when it is transferred to RAM.

It temporarily stores the files and data It stores the BIOS program on the
that the CPU needs to process the motherboard of a computer, which is needed
current instructions or work. to bootstrap the computer.

Examples: It is used as CPU Cache, Examples: It is used as Firmware by micro-


Primary Memory in a computer. controllers.

The stored data is easy to access. The stored data is not as easy to access as it is
in ROM.

It is costlier than ROM. It is cheaper than RAM.

Types: DRAM (Dynamic Random Access Types: PROM (programmable read-only


Memory), SRAM (Static Random Access memory), EPROM (erasable programmable
Memory). read-only memory), EEPROM( electrically
erasable programmable ROM), Mask ROM.

7
 Memory Access Methods
Each memory is a collection of various memory locations. Accessing the memory
means finding and reaching the desired location and then reading information from
that memory location.

Information from memory location can be accessed in the following ways :


1. Sequential Access method.
2. Random Access method.
3. Direct Access method.

Sequential Access Method

In this method, the memory is accessed in a specific linear sequential manner, like
accessing in a single linked list. The access time depends on the data. The time to
access data in this type of method depends on the location of the data. For access we
traverse through all locations starting from the current location to desired location,
passing and rejecting all the intermediate records until target record is not found.
Magnetic tape is the example where sequential access method is used. In Simple
Data Structure, Linked List is the example of Sequential access. Tapes are sequential
access media.

Random Access Method

In random access method, data from any location of the memory can be accessed
randomly. The access to any location is not related with its physical location and is
independent of other locations. There is a separate access mechanism for each
location. Random Access is transferring information to or from memory in which every
memory location can be accessed directly rather than being accessed in a fixed
sequence. In Random Access Each record or addressable location in memory has a
unique address. So any location can be selected at random and directly accessed and
addressed.

Example: Main Memory and Cache Systems.

8
Both types of files have advantages and disadvantages. If you are always accessing
information in the same order, a sequential-access file is faster. If you tend to access
information randomly, random access is better.

Direct Access Method

Direct access method can be seen as combination of sequential access method and
random access method. Magnetic hard disks contain many rotating storage tracks. Here
each track has its own read or write head and the tracks can be accessed randomly.
But access within each track is sequential. In this method, individual blocks or records
have a unique address based on physical location. access is accomplished by direct
access to reach a general vicinity plus sequential searching, counting or waiting to
reach the final destination. This method is a combination of above two access methods.
The access time depends on both the memory organization and characteristics
of storage technology. The access is semi-random or direct.
Example- Memory devices such as magnetic hard disks, Optical Disks etc.

 Concepts of High-level, Assembly and Low level Languages


High-level programming languages are so-called third-generation languages, whereas
low-level languages can be described as first-generation (machine code) and second-
generation (assembly language) languages. This is because high-level programming
languages were invented after machine code and assembly language.

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.

9
High-level language

 It can be easily interpreted as well as compiled in comparison to low-level


language.
 It can be considered as a programmer-friendly language.
 It is easy to understand.
 It is easy to debug.
 It is simple in terms of maintenance.
 It requires a compiler/interpreter to be translated into machine code.
 It can be run on different platforms.
 It can be ported from one location to another.
 It is less memory efficient, i.e it consumes more memory in comparison to low-
level languages.
 Examples of high level languages include C, C++, Java, Python.
 It is used widely in today's times.
Low-level language

 It is also known as machine level language.


 It can be understood easily by the machine.
 It is considered as a machine-friendly language.
 It is difficult to understand.
 It is difficult to debug.
 Its maintenance is also complex.
 It is not portable.
 It depends on the machine; hence it can't be run on different platforms.
 It requires an assembler that would translate instructions.
 It is not used widely in today's times.

Difference between high level and low level languages:

Sl.No.High Level Language Low Level Language


It is programmer friendly
1. language. It is a machine friendly language.

High level language is less Low level language is high


2. memory efficient. memory efficient.

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

It is complex to debug
4. It is simple to debug. comparatively.

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

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

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

It needs compiler or
8. interpreter for translation. There is no need of compiler.

It is used widely for It is not commonly used now-a-


9. programming. days in programming.

 Algorithm and Flowchart


Algorithm-

According to the Merriam-Webster dictionary, an algorithm can be defined as “a


procedure for solving a mathematical problem in a finite number of steps that frequently
involves repetition of an operation.”

Input --> follow instructions --> output

Likewise in mathematics and computer science, an algorithm refers to a set of rules or


instructions that has to be executed step-by-step in order to solve a mathematical
problem. We follow a certain algorithm to carry out all tasks in our daily life.

An algorithm is a procedure or set of rules that defines how a program is to be


executed. Or we can say that it is a set of instructions for solving a well-defined
computational problem.

11
Flowchart-

A flowchart is a graphical representation of an algorithm. Programmers often use it as a


program-planning tool to solve a problem. It makes use of symbols which are connected
among them to indicate the flow of information and processing.
The process of drawing a flowchart for an algorithm is known as “flowcharting”. With
algorithms, we can easily understand a program. The main purpose of using a flowchart
is to analyze different methods. Several standard symbols are applied in a flowchart.

With the help of the flowchart, the designer can efficiently segregate the various
elements of the process. Also, it facilitates the analysis by giving step-by-step
instructions on the problem.

Difference between Algorithm and Flowchart

Parameters Flowchart Algorithm

Description A flowchart is a graphical representation of the steps a An algorithm is a procedure or set of rules that defines
program takes to process data. In this, we can use several how a program is to be executed. Or we can say that it
geometric patterns to illustrate the numerous actions the is a set of instructions for solving a well-defined
program carries out. computational problem.

Complexity It is easy to design and also very user friendly. It is comparatively difficult to create and also a bit
challenging to be understood by a layman.

Geometrical It utilizes different types of geometrical shapes, symbols, An algorithm does not include any sort of geometrical
diagrams and patterns. pattern.

Scope of Usage A flowchart can be used in different disciplines to describe Algorithms are used in the domain of mathematics and
a process. computer science.

Use A flowchart is used in documenting, designing, and An algorithm is used to represent the concept of
analyzing a program in different disciplines. decidability.

Users A Flowchart doesn’t demand the knowledge of a computer An algorithm demands the knowledge of a computer
programming language. programming language.

Debugging It is easy to debug the errors in flowcharts. It is difficult to debug the errors in algorithms.

Implementation In flowcharts, no rules are used. In algorithms, predefined rules are used.

Branching and Simple to display branching and looping. Hard to display branching and looping.
Looping

Solution In a flowchart, the solution is represented in a graphical In an algorithm, the solution is presented in non non-
format. computer language.

12
Flow-Chart Symbols

The following table illustrates the symbols along with their names (used in a flow-chart)

Name Symbol Name Symbol

Flow Line Magnetic Disk

Terminal Communication Link

Processing Offline Storage

Decision Annotation

Connector Flow line

Document Off-Page Connector

13
Example – Here is an example of a flowchart that describes the process of finding the
average of three numbers.

 Pseudo Code

It is a simpler version of a programming code in plain English which uses short phrases
to write code for a program before it is implemented in a specific programming
language. A pseudo code, pseudo meaning half, will be a representation that almost
looks like a code written in a programming language. However, it should be noted that
a good pseudo code should be language independent .

Pseudo code Example : Add Two Numbers.(Simple Pseudo code)

1
2 BEGIN
3 NUMBER s1, s2, sum
4 OUTPUT("Input number1:")
5 INPUT s1
6 OUTPUT("Input number2:")
7 INPUT s2
8 sum=s1+s2
9 OUTPUT sum
10 END
11

14

You might also like