Вы находитесь на странице: 1из 42

UNIT – 1

Basic of Computer
Prepared By:- Prof. A. A. Raikar
Basic Structure of Computer
• Types of computer
▫ Simple computer
▫ Personal computer
▫ Notebook computer
▫ Enterprise systems/server
▫ Supercomputers
Functional Units
• Input
• Output
• Memory
• ALU
• Control
• Input Unit –
▫ Computer accepts code information through input
units, which read the data.
▫ Inputs like keyboard, joysticks, trackball and
mouse.
• Memory Unit -
▫ Primary storage
 RAM, Cache memory
▫ Secondary storage
 ROM, magnetic disks, tapes, optical disks
• Arithmetic and Logic Unit –
▫ Computer operation are executed in ALU
▫ Addition, Multiplication, Division or Comparison
▫ Operands are stored in Registers
▫ These registers are faster than cache
• Output Unit –
▫ It is the counterpart of the input unit
▫ Function is to send processed result to outside
world
▫ Ink jet streams, printer, monitor
• Control Unit –
▫ The operation of input, output, ALU and Memory
is coordinated by control unit
▫ It is nerve center that sends control signal to other
units and senses their states
▫ Data transfer between memory and processor is
controlled
▫ All the activities inside the machine are directed
by control unit
Basic Operational Concepts
• IR – Instruction Register

• PC – Program Counter

• MAR – Memory Address


Register

• MDR – Memory Data


Register

• R0 – Rn-1 – General
Register
Bus Structures
• The computer must be organized so that all its units can
handle one full word of data at a given time
• The simplest way is to use a Single Bus
• The main virtue of the single bus structure is low cost and
flexibility
• Buffer Register prevent high speed processor from being
locked to a slow I/O devices during a sequence of data transfer
Software
• To enter or run any program application,
computer should have system software.
• System software perform functions like
▫ Receiving and interpreting user commands
▫ Entering and editing application program and
storing it in secondary storage devices
▫ Managing the storage and retrieving files from
secondary storage
▫ Running standard applications
▫ Controlling I/O units
▫ Translating program into machine instructions
▫ Linking and running user written application
program
Basics of operating systems
Performance
• How quickly a computer can execute a program.
• The speed is affected by design of its hardware
and machine language instructions.
• It is also affected by compiler that translates
programs into machine language.
Processor Clock
• Processor circuits are controlled by a timing
signal called a clock.
• The clock defines regular time intervals, called
clock cycles.
• Each basic step requires one clock cycle.
• Clock rate R=1/P, where P is Length of one clock
cycle
• Todays computer are in MHz and GHz.
Basic Performance Equation
• The program execution time is
• T=(N*S)/R
▫ Where N is number of machine language
instructions
▫ S is average number of basic steps
▫ R is Clock rate
• The value of T should be minimum
Pipelining and Superscalar Operation
• Pipelining is the process of accumulating
instruction from the processor through a
pipeline.
• Superscalar describes a microprocessor design
that makes it possible for more than one
instruction at a time to be executed during a
single clock cycle.
Clock Rate
• Two possibilities for increasing clock rate R
▫ Improving IC technology makes logic circuits
faster.
▫ Reducing the amount of processing done in one
basic step
Compiler
• A compiler translates a high level language
program into a sequence of machine
instructions.
• A compiler and processor are designed at the
same time, with much interaction between the
designers to achieve best results.
Performance Measurement
• Computer designers use performance estimates
to evaluate the effectiveness of new features.
• The performance measure is the time it takes a
computer to execute a given benchmark.
• Initially some attempts were made to create
artificial program, but it failed.
• System Performance Evaluation Corporation
(SPEC) evaluates the performance of computer
Machine Instruction and Programs
• Types of instructions
• Instruction sets
• Instruction formats
• Assembly language
• Stacks
• Queues
• Subroutines
Number Representation
• There are three system for representing both
positive and negative numbers
▫ Sign and Magnitude
▫ 1’s Complement
▫ 2’s Complement
ADDITION OF POSITIVE NUMBERS
ADDITION AND SUBTRACTION OF
SIGNED NUMBERS
OVERFLOW IN INTEGER ARITHMETIC
• when using 4-bit signed numbers, if we try to
add the numbers +7 and +4, the output sum
vector, S, is 1011, which is the code for −5, an
incorrect result.
• Overflow can occur only when adding two
numbers that have the same sign.
• The carry-out signal from the sign-bit position is
not a sufficient indicator of overflow when
adding signed numbers.
CHARACTERS
• Computers must be able to handle nonnumeric
text information consisting of characters.
• They are represented by codes that are usually
eight bits long.
• Most widely used such codes is the American
Standards Committee on Information
Interchange (ASCII) code.
INSTRUCTIONS AND INSTRUCTION
SEQUENCING
• A computer must have instructions capable of
performing four types of operations:
▫ Data transfers between the memory and the
processor registers
▫ Arithmetic and logic operations on data
▫ Program sequencing and control
▫ I/O transfers
REGISTER TRANSFER NOTATION
• Transfer of information from one location in the
computer to another.
R1 ← [LOC]
• Contents of memory location LOC are
transferred into processor register R1.
R3 ← [R1] + [R2]
• Adds the contents of registers R1 and R2, and
then places their sum into register R3.
• This type of notation is known as Register
Transfer Notation (RTN).
ASSEMBLY LANGUAGE NOTATION
• Notation to represent machine instructions and
programs. For this, we use an assembly
language format.
Move LOC,R1
• The contents of LOC are unchanged by the
execution of this instruction, but the old
contents of register R1 are overwritten.
Add R1,R2,R3
• Adding two numbers contained in processor
registers R1 and R2 and placing their sum in R3
BASIC INSTRUCTION TYPES
• C=A+B
• Add A,B,C
• Operation Source1,Source2,Destination
• Add A,B
• Operation Source, Destination
ASSEMBLY LANGUAGE
• Machine instructions are represented by
patterns of 0s and 1s.
• Programs written in an assembly language can
be automatically translated into a sequence of
machine instructions by a program called an
assembler.
▫ MOVE R0,SUM
▫ ADD #5,R3
ASSEMBLER DIRECTIVES
SUM EQU 200
• The name SUM is used to represent the value
200.
• It simply informs the assembler that the name
SUM should be replaced by the value 200
wherever it appears in the program.
• Such statements, called assembler directives (or
commands).
ASSEMBLY AND EXECUTION OF
PROGRAMS
• A source program written in an assembly
language must be assembled into a machine
language object program before it can be
executed.
• This is done by the assembler program.
NUMBER NOTATION
• ADD #93,R1 – in decimal

• ADD #%01011101,R1 in binary (8 bit binary)

• ADD #$5D,R1 in Hexadecimal


STACKS AND QUEUES
• A stack is a list of data elements, usually words
or bytes, with the accessing restriction that
elements can be added or removed at one end of
the list only.
• last-in–first-out (LIFO) stack
• In Queues, Data are stored in and retrieved from
a queue on a first-in–first-out (FIFO) basis.
Difference between STACKS AND
QUEUES
• One end of the stack is fixed (the bottom), while
the other end rises and falls as data are pushed
and popped.
• A single pointer is needed to point to the top of
the stack at any given time.
• Both ends of a queue move to higher addresses
as data are added at the back and removed from
the front.
SUBROUTINES
• In a given program, it is often necessary to
perform a particular subtask many times on
different data values. Such a subtask is usually
called a subroutine.
• Call instruction, link register.

Вам также может понравиться