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

Lecture 2

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)
12 views

Lecture 2

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/ 23

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. Mostly all discrete values are available in the form of
American Standard Code for Information Interchange (ASCII)

• 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
Registers
1.Registers – Registers refer to high-speed storage areas in the CPU. The data processed by
the CPU are fetched from the registers. There are different types of registers used in
architecture :-Accumulator: Stores the results of calculations made by ALU. It holds the
intermediate of arithmetic and logical operatoins.it act as a temporary storage location or
device.
2.Program Counter (PC): Keeps track of the memory location of the next instructions to
be dealt with. The PC then passes this next address to the Memory Address Register
(MAR).
3.Memory Address Register (MAR): It stores the memory locations of instructions that
need to be fetched from memory or stored in memory.
4.Memory Data Register (MDR): It stores data fetched from memory or any data that is to
be transferred to, and stored in, memory.
5.Current Instruction Register (CIR): It stores the most recently fetched instructions
while it is waiting to be coded and executed.
6.Instruction Buffer Register (IBR): The instruction that is not to be executed
immediately is placed in the instruction buffer register IBR.
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). CPU is known as
RAM because CPU can access any locations at any point of time.
Memory Con’d

• The smaller and fasted unit is called Cache. The largest and slowest unit
is referred to as main memory.

• 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
12
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

13
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

14
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

15
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

16
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.

It needs compiler or interpreter for


8. It needs assembler for translation.
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 program
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
architecture to add assembler?

You might also like