SlideShare a Scribd company logo
1 of 110
A computer is an electronic device which accepts information and processes the
information according to the program and produces the output.
-- used for information processing.
A computer has four functions:
1. Accepts data Input ---- The Information Processing Cycle
2. Processes data --------- Processing
3. Produces output ------ Output
4. Stores results ----------- Storage
List of instructions are called programs & internal storage is called computer
memory
INTRODUCTION
What is a computer?
Basic terms:
 Computer architecture
» The functional operation of the individual H/W units in a computer
system & the flow of information & controlling.
» The structure & behavior of the computer as seen by the user
» Include instruction formats, instruction set, addressing etc.
 Computer organization
» Describes the function & design of the various units of computer that
store & process information. It also deals with the interface & external
devices.
» The way the H/W components operate & connected together to form a
computer system.
INTRODUCTION
Some Beginning Terms
Hardware : The hardware includes devices such as keyboard, monitor,
mouse etc.
Software : The software tells the computer what to do in the form of
instructions.
Data : Data is the raw facts given to the computer. Individual facts like
first name, price, quantity ordered etc.
Information : Data which has been messaged into a useful form.
INTRODUCTION
TYPES OF THE COMPUTER
TYPES OF THE COMPUTER
TYPES OF THE COMPUTER
Personal computer (Desk Top PC):
This is the most common type found in homes, schools, Business
offices etc
Desk Top PC
Work stations:
3. Note Book Computers (Laptop PC)
These are compact and portable versions of PC.
4. Tablet PC
Advantages and Disadvantages of Tablet PC
5. Handheld PCs (PDAs)
The most popular hand-held computers are those that are specifically
designed to provide PIM (personal information manager) functions, such as
a calendar and address book.
6. Smart Phones:
Can send and receive SMS, MMS
Uses s/w like personal organizers,
Equipped with cameras and music players
Can access Web, send and receive E-mails.
TYPES OF THE COMPUTER
1. Network Servers:
A network server is a computer that manages network traffic.
Network Servers
2. Mainframe Computers:
 Large computer system, occupies a large area.
 Connected to desktop computers and mini comps near by.
 32 bit or 64 bit computers.
 can handle up to 64 to 100 terminals.
 CPU speed 100MIPS.
IBM-370/168,IBM-3033/3090,UNIVAC1100/60, VAX-8000
MAINFRAME ENVIRONMENT:
Terminals:
1. Dumb terminals.
-does not store or process
-an i/p or o/p device.
2. Intelligent terminals
- Can process, no storage.
- smart terminals.
Mainframe Computers:
A minicomputer, is a computer of a size intermediate between a microcomputer
and a mainframe.
 a multi user system
 CPU speed 10-30 MIPS
 16-96 Main memory capacity.
 Disk size 40-80 GB.
Typically, minicomputers have been stand-alone computers (computer systems
with attached terminals and other devices)
Used in small and mid-size business applications and to large enterprises for
department-level operations.
3. Minicomputer:
In recent years, the minicomputer has evolved into the "mid-range server"
and is part of a network. IBM's as/400e is a good example.
 A supercomputer generates large amounts of heat and must be cooled.
 In modern supercomputers built of many conventional CPUs running in
parallel.
4. Supercomputers
 Supercomputers consume and produce massive amounts of data
in a very short period of time .
 The fastest type of computer.
 Supercomputers are very expensive and are employed for specialized
applications that require immense amounts of mathematical calculations.
For example, weather forecasting requires a supercomputer. Other uses of
supercomputers include animated graphics, fluid dynamic calculations,
nuclear energy research, and petroleum exploration
Supercomputers
Programming:
A computer program is just a collection of the instructions necessary to solve
a specific problem .
The approach or method that we use to solve the problem is called an
algorithm
High level languages like Pascal, Fortran, Cobol , C, C++ and so on.
Assembly language
Programming:
Three types of programming languages are;
1. Machine languages :
» Strings of numbers giving machine specific instructions
» Example:
1001010101
1. Assembly languages
» English-like abbreviations representing elementary computer
operations (translated via assemblers)
» Example:
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
Programming Languages:
3. High-level languages
» Codes similar to everyday English
» Use mathematical notations (translated via compilers)
» Example:
gross Pay = base Pay + overtime Pay
Introduction
A computer consists of five functionally independent main parts:
1. Input Unit 2. Memory Unit
3. Arithmetic & Logic unit (ALU) 4. Output Unit
5. Control unit.
Fig: Basic functional units of a computer
Basic Functional unit
Input Unit
Everything we tell the computer is Input.
Types of Input:
Data is the raw facts given to the computer.
Programs are the sets of instructions that direct the computer.
Commands are special codes or key words .
--a menu of commands like "Open" on the File menu.
User response is the user's answer to the computer's question,
-- OK, YES, or NO
-- or by typing in text, for example the name of a file.
Input Device
Pen
What is Output?
Output is data that has been processed into useful form, now called Information.
Types of Output :
Hard copy:
printed on paper or other permanent media
Soft copy:
displayed on screen or by other non-permanent means
Output Unit
Categories of Output
Text documents including
Reports ,letters, etc.
Multimedia
Combination of text,
Graphics, video, audio
Graphics
Charts ,graphs, pictures
Output Device such as CRT Monitor
Arithmetic & Logic unit (ALU)
Performs basic arithmetic such as addition, subtraction,
division and multiplication operations.
Also logical operations are performed here under the
supervision of control unit.
Functions of control unit:
Fetching data and instructions from the memory.
Interpreting the instructions.
Controlling the transfer of data and instructions to and
from memory.
Controlling the input and output devices.
The overall supervision of a computer
Control unit
Memory Unit:
 CPU Registers.
The memory unit can be either primary (RAM) or secondary memory
Memory unit takes the data from input device and stores it until the
computer is ready to process it.
 Main memory (temporary): RAM is a volatile memory.
 Secondary memory (permanent): The data or results be stored
permanently using secondary storage devices such as hard disc drive
or CD-ROM etc.
 Cache memory: In-built to the processor or outside the processor,
speed increases.
A memory address holds 1 byte of data where
1 bit =0 or 1, on or off
1 byte = 8 bits
1 kilobyte (K or KB) =1024 bytes
1 megabyte (MB) =1024 kilobytes
Why 1024 instead of 1000 bytes per kilobyte.
That is because computers don't count by tens like people.
Computers count by twos and powers of 2.
1024 is 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 that is 2 times itself ten
times.
MIPS (million instructions per second), is one way to measure
computer speeds
Stored program concept is used in memory
 To perform a given task an appropriate program consisting of a list of
instructions is stored in the memory.
 Individual instructions are brought from the memory into the processor, which
executes the specified operations.
 Data to be stored are also stored in the memory.
Examples: - Add LOCA, R0
This instruction requires the performance of several steps,
 First the instruction is fetched from the memory into the processor.
 The operand at LOCA is fetched and added to the contents of R0
 Finally the resulting sum is stored in the register R0
Basic Operational Concepts
Example 2:
Load LOCA, R1
Add R1, R0
 Transfers between the memory and the processor are started by sending the
address of the memory location to be accessed to the memory unit and
issuing the appropriate control signals.
 The data are then transferred to or from the memory.
Figure 1.2. Connections between the processor and the memory.
Processor
Memory
PC
IR
MDR
Control
ALU
Rn 1
-
R1
R0
MAR
n general purpose
registers
IR – Instruction Register; PC – Program Counter;
MAR – Memory Address Register; MDR – Memory Data Register
The instruction register (IR):- Holds the instructions that is currently being
executed. Its output is available for the control circuits which generates the
timing signals that control the various processing elements in one execution of
instruction.
The program counter PC:-
This is another specialized register that keeps track of execution of a program. It
contains the memory address of the next instruction to be fetched and executed.
Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
The other two registers which facilitate communication with memory are: -
• MAR – (Memory Address Register):- It holds the address of the location to be
accessed.
• MDR – (Memory Data Register):- It contains the data to be written into or
read out of the address location.
Operating steps are:
 Programs reside in the memory & usually get these through the I/P unit.
 Execution of the program starts when the PC is set to point at the first instruction
of the program.
 Contents of PC are transferred to MAR and a Read Control Signal is sent to the
memory.
 After the time required to access the memory elapses, the address word is read
out of the memory and loaded into the MDR.
 Now contents of MDR are transferred to the IR & now the instruction is ready to
be decoded and executed.
 If the instruction involves an operation by the ALU, it is necessary to obtain the
required operands.
 An operand in the memory is fetched by sending its address to MAR &
Initiating a read cycle.
 When the operand has been read from the memory to the MDR, it is
transferred from MDR to the ALU.
 After one or two such repeated cycles, the ALU can perform the desired
operation.
 If the result of this operation is to be stored in the memory, the result is sent
to MDR.
 Address of location where the result is stored is sent to MAR & a write cycle
is initiated.
 The contents of PC are incremented so that PC points to the next instruction
that is to be executed.
A group of lines that serve as a connecting path for several devices is called a bus.
 The simplest and most common way of interconnecting various parts of the
computer.
 To achieve a reasonable speed of operation, a computer must be organized so
that all its units can handle one full word of data at a given time.
 In addition to the lines that carry the data, the bus must have lines for address
and control purpose.
Bus structure
Fig: Single bus structure
Input Output Memory Processor
• Receiving and interpreting user commands
• Entering and editing application programs and storing them as files in secondary
storage devices
• Managing the storage and retrieval of files in secondary storage devices
• Running standard application programs (e.g. word processors, games or user’s
applications) with data supplied by the user
• Controlling I/O units to receive input information and produce output results
• Translating programs from source form prepared by the user into object form
consisting of machine instructions
• Linking and running user-written application programs with existing standard
library routines, such as numerical computation packages
Software
Processor
Cache
memory
Figure 1.5. The processor cache.
Main Memory
1. High processing speed.
The immense speed of the computer enables it to do millions of such steps in
a second. (MIPS)
2. Accuracy.
3. Reliability (Consistent results)
Failures are usually due to human error, -Gives consistent results.
4. Versatility (wide area of applications)
5. Storage capacity
A computer can keep huge amounts of data.
6. Diligence (unrest)
Characteristics of a computer:
Processor Clock
A clock – a timing signal that controls processor circuits
A clock cycle – a regular time interval during which the
processor performs a single basic step
Each instruction to be performed by the processor is
divided into a sequence of basic steps
P – the length of one clock cycle
R=1/P (clock rate)
Basic Performance Equation
N S
T
R


N is the actual number of instruction executions
S is the average number of basic steps needed to
execute one machine instruction
R is the clock rate
T is the processor time required to execute a program
that has been prepared in some high-level language
Historical Overview
• “The 1st Generation”: vacuum tube technology (1945-1955)
A few milliseconds per arithmetic operation
• “The 2nd Generation”: transistor technology (1955-1965)
High-level languages, compilers, separate I/O processors
• “The 3rd Generation”: Integrated-circuit technology(1965-1975)
Operating systems, Microprogramming, multiprogramming,
pipelining, cache memories, IC, MSI, LSI.
Electronic Computers
Historical Overview
• “The 4th Generation”: VLSI (Very Large Scale Integration) (1975- present)
Microprocessors, virtual memories, concurrency, networks,
high resolution graphics, Personal Computer (Apple,
Microsoft, etc.), Internet
• Beyond the 4th Generation: artificial intelligence, massively
parallel machines, extensively distributed systems
Electronic Computers
• Numbers, arithmetic operations, characters.
• Addition of unsigned numbers
• Subtraction of unsigned numbers
• Addition of positive numbers
• Subtraction of positive numbers
• Addition/subtraction of signed numbers
• Overflow of arithmetic operation.
• Carry of arithmetic operation
Machine instructions and programming
• Sign-And-Magnitude
• 1’s Complement
• 2’s Complement
•Memory locations
•Size of one locations
Lower byte addresses are used for the
more significant bytes (left most)
Lower byte addresses are used for the
least significant bytes (right most)
Big-endian and Little-endian memory organization
Byte Ordering
Perform –10 add –13
-10 decimal = 10110
-13 decimal = 10011
sum = 1 ) 01001
Actually 101001 is –23, but uses 6 bits
Result range is 5 bits !!
So considered as overflow
-14 decimal
01110 is + 14 decimal
10001 + 1 is 2’s complement of +14
10010 is –14 decimal
perform -14 add 11
10010
+ 01011
= 11101 is –3 decimal
Exercises
Address in Hex Data stored (binary)
2000 0011 1000
2001 0011 0100
2002 0011 0010
2003 0011 1001
Interpret the storage
1) Big-endian storage of 2 hex words of 4-digits each
2) Big-endian storage of 2 BCD words of 4-digits each
3) Little-endian storage, in ASCII, of a4-digit signed hex word
4) Little-endian storage, in ASCII, of a 4-digit BCD word
1) 3834 H and 3239 H ; convert it to decimal (14388 & 12857)
2) 3834 & 3239 decimal
3) 9248 hexa signed. - 28088 Decimal
4) 9248 decimal.
Single address example
Load A
Add B
Store C
C [A] +[B]
Two address example
Move A, R1
Add B, R1
Move R1, C
C [A] +[B]
•Word alignment
•Even address boundary !!??
•Word address, character address
•Memory access: load (Read or Fetch ) / store instructions
Instructions and instruction sequencing
• Program consists of sequence of instructions
• data transfers between the memory and processor registers
• Arithmetic and logic operations on data
• Program sequencing and control
• I/O transfers
Instructions and instruction sequencing
Register transfer notation
R1 [LOC]
R3 [R1] +[R2]
Assembly language notations
assembly language ?
MOV LOC, R1
ADD R1, R2, R3
Instructions and instruction sequencing
Basic instruction types
C = A + B ; high level notation
ADD A, B, C ; i.e. C [A] + [B]
Generally,
operation source1, source2, destination
One address instructions
Two address instructions
Three address instructions
One address instructions
ADD A
LOAD A
STORE A
ADD B
STORE C etc
Two address instructions
MOVE B, C
ADD A, C ; C [A] + [C]
Three address instructions
ADD A, B, C etc
Instruction execution and straight line sequencing
C [A] +[B]
Load A
Add B
Store C
Load A, Ri
Store Ri, A
Add A, Ri
Instruction execution and straight line sequencing
ADD Ri, Rj
ADD Ri, Rj, Rk
MOVE A, Ri
LOAD A, Ri
MOVE Ri, A
MOVE A, Ri
MOV B, Rj
ADD Ri, Rj
MOVE Rj, C
MOVE A, Ri
ADD B, Ri
MOVE Ri, C
Instruction
Execution and
Straight-Line
Sequencing
A straight line
program for adding
‘n’ numbers
Using a loop to add
‘n’ numbers
Condition Codes
N – Negative
Z – Zero
V – Overflow
C - Carry
Generating Memory Addresses
Addressing Modes
Different ways in which the location of an operand is specified in an instruction.
1. Immediate
2. Register
3. Absolute (Direct)
4. Indirect
5. Index
6. Base with index
7. Base with index and offset
8. Relative
9. Auto-increment
10. Auto-decrement
# Value Operand =Value
Ri EA = Ri
LOC EA = LOC
(Ri) EA = [Ri]
(LOC) EA = [LOC]
X(Ri) EA = [Ri] + X
(Ri,Rj) EA = [Ri] +[Rj]
X(Ri, Rj) EA = [Ri] +[Rj] + X
X(PC) EA = [PC] + X
(Ri) + EA = [Ri] ; Increment Ri
-(Ri) Decrement Ri ; EA = [Ri]
EA is
Effective Address
Generating Memory Addresses
Addressing Modes
Register Mode
The operand is the contents of a processor register.
The name of the register is given in the register.
MOVE R1, R2
Absolute (Direct) Mode
The operand is in a memory location; the address of this
location is given explicitly in the instruction.
MOVE LOC, R2
ADD R2, COUNT
Generating Memory Addresses
Addressing Modes
Immediate Mode
The operand is given explicitly in the instruction
MOVE 200, R0 ; 200 is immediate data
MOVE #200, R0
MOVE B, R1
ADD #6, R1 ; A = B + 6
MOVE R1, A
Generating Memory Addresses
Addressing Modes
Indirection and Pointers
Indirect Mode
The Effective Address of the operand is the contents
of a register or memory location whose address
appears in the instruction.
ADD (R1), R0 ; Register Indirect
ADD (A), R0 ; Memory Indirect
Fig 2.11 page 50 Fig 2.12 :Program –sorting ‘n’ words
Indexing and Arrays
Add 20(R1), R2
.
.
.
.
.
.
Operand
1000
1020
20 = offset
1000 R1
Offset is given as a constant
Adding a constant to the register.
Case 1
Indexing and Arrays
Add 1000(R1), R2
.
.
.
.
.
.
Operand
1000
1020
20 = offset
20 R1
Offset is given as a constant
Adding a constant to the register.
Case 2
n
Student ID
Test 1
Test2
Test3
Student ID
Test1
Test2
Test3
.
.
.
N
LIST
LIST+4
LIST+8
LIST+12
LIST+16
Student 1
Student 2
An example of indexing: add the test scores
Move #LIST, R0
Clear R1
Clear R2
Clear R3
Move N, R4
LOOP Add 4(R0), R1
Add 8(R0), R2
Add 12(R0), R3
Add #16, R0
Decrement R4
Branch>0 LOOP
Move R1, SUM1
Move R2, SUM2
Move R3, SUM3
Relative Addressing
0FF4 Move N, R1
0FF8 Move #NUM1, R2
0FFC Clear R0
1000 LOOP Add (R2), R0
1004 Add #4, R2
1008 Decrement R1
100C Branch >0 LOOP
100F Move R0, SUM
The relative address is –16
-16(PC)
Auto Increment Mode
0FF4 Move N, R1
0FFB Move #NUM1, R2
0FFC Clear R0
1000 LOOP Add (R2) +, R0
1004 Decrement R1
1008 Branch >0 LOOP
1012 Move R0, SUM
An example …
Post increment !
Auto decrement Mode
Pre decrement !
Used in stack implementation
Assembly Language
Mnemonics (acronyms of the operation to be performed)
Assembly language: (complete set of symbolic names and rules for
their use constitute a programming language )
Syntax : (set of rules for using the mnemonics in the specification
of complete instructions and program )
Assembler:
Source program:
Object program:
Opcode:
Assembler Directives
How to interpret the names
Where to place the instructions in the memory
Where to place the data operands in the memory
Instruction format
Label Operation Operand(s) Comments
Assembler Directives
SUM EQU 200
ORIGIN 204
N DATAWORD 100
NUM1 RESERVE 400
ORIGIN 100
START MOVE N, R1
MOVE #NUM1, R2
CLR R0
LOOP ADD (R2), R0
ADD #4, R2
DEC R1
BGTZ LOOP
MOVE R0, SUM
RETURN
END START
100 Move N, R1
104 Move #NUM1, R2
108 Clear R0
LOOP 112 Add (R2), R0
116 Add #4, R2
120 Dec R1
124 Branch>0 LOOP
128 Move R0, SUM
132 ….
….
….
SUM 200
N 204 100
NUM1 208
NUM2 212
….
….
NUMn 604
Number notation
#Value #98 decimal
#%Value #%00111001 binary
#$Value #$5D hexadecimal
COA-Unit-1-Basics.ppt

More Related Content

Similar to COA-Unit-1-Basics.ppt

CS304PC:Computer Organization and Architecture UNIT I.pdf
CS304PC:Computer Organization and Architecture UNIT I.pdfCS304PC:Computer Organization and Architecture UNIT I.pdf
CS304PC:Computer Organization and Architecture UNIT I.pdfAsst.prof M.Gokilavani
 
What is computer 1
What is computer 1What is computer 1
What is computer 1Shuja Qais
 
INSTRUCTION TYPES
INSTRUCTION TYPESINSTRUCTION TYPES
INSTRUCTION TYPESdevi195058
 
comp. org Chapter 1
comp. org Chapter 1comp. org Chapter 1
comp. org Chapter 1Rajat Sharma
 
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptx
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptxCO--MODULE-1 (a) - Basic-Structure-of-Computers.pptx
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptxddscraft123
 
Computer organisation Module 1.ppt
Computer organisation Module 1.pptComputer organisation Module 1.ppt
Computer organisation Module 1.pptSoulReaper21
 
computer funda.pptx
computer funda.pptxcomputer funda.pptx
computer funda.pptxMurthy86
 
Lesson 1 anatomy of a digital computer (230 kb)
Lesson 1  anatomy of a digital computer (230 kb)Lesson 1  anatomy of a digital computer (230 kb)
Lesson 1 anatomy of a digital computer (230 kb)IMRAN KHAN
 
Computer basics and i.o devices
Computer basics and i.o devicesComputer basics and i.o devices
Computer basics and i.o deviceskitturashmikittu
 
computer fundamentals
computer fundamentalscomputer fundamentals
computer fundamentalsPANKHURI JAIN
 
janvichauhan110cs.pptx
janvichauhan110cs.pptxjanvichauhan110cs.pptx
janvichauhan110cs.pptxSANKETKOTAK5
 
diploma basic of computers.ppt
diploma basic of computers.pptdiploma basic of computers.ppt
diploma basic of computers.pptLathaSrinivas5
 

Similar to COA-Unit-1-Basics.ppt (20)

CS304PC:Computer Organization and Architecture UNIT I.pdf
CS304PC:Computer Organization and Architecture UNIT I.pdfCS304PC:Computer Organization and Architecture UNIT I.pdf
CS304PC:Computer Organization and Architecture UNIT I.pdf
 
Pankaj kumar
Pankaj kumar Pankaj kumar
Pankaj kumar
 
What is computer 1
What is computer 1What is computer 1
What is computer 1
 
Intro to cao &store program
Intro to cao &store programIntro to cao &store program
Intro to cao &store program
 
INSTRUCTION TYPES
INSTRUCTION TYPESINSTRUCTION TYPES
INSTRUCTION TYPES
 
Computer Fundamentals
Computer FundamentalsComputer Fundamentals
Computer Fundamentals
 
Csc 2313 (lecture 1)
Csc 2313 (lecture 1)Csc 2313 (lecture 1)
Csc 2313 (lecture 1)
 
Csc 2313 (lecture 1)
Csc 2313 (lecture 1)Csc 2313 (lecture 1)
Csc 2313 (lecture 1)
 
comp. org Chapter 1
comp. org Chapter 1comp. org Chapter 1
comp. org Chapter 1
 
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptx
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptxCO--MODULE-1 (a) - Basic-Structure-of-Computers.pptx
CO--MODULE-1 (a) - Basic-Structure-of-Computers.pptx
 
Itc lecture
Itc lectureItc lecture
Itc lecture
 
Computer organisation Module 1.ppt
Computer organisation Module 1.pptComputer organisation Module 1.ppt
Computer organisation Module 1.ppt
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
computer funda.pptx
computer funda.pptxcomputer funda.pptx
computer funda.pptx
 
Lesson 1 anatomy of a digital computer (230 kb)
Lesson 1  anatomy of a digital computer (230 kb)Lesson 1  anatomy of a digital computer (230 kb)
Lesson 1 anatomy of a digital computer (230 kb)
 
Computer basics and i.o devices
Computer basics and i.o devicesComputer basics and i.o devices
Computer basics and i.o devices
 
computer fundamentals
computer fundamentalscomputer fundamentals
computer fundamentals
 
janvichauhan110cs.pptx
janvichauhan110cs.pptxjanvichauhan110cs.pptx
janvichauhan110cs.pptx
 
Unit2fit
Unit2fitUnit2fit
Unit2fit
 
diploma basic of computers.ppt
diploma basic of computers.pptdiploma basic of computers.ppt
diploma basic of computers.ppt
 

More from Ruhul Amin

COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxRuhul Amin
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxRuhul Amin
 
COA-Unit3-ppt.pptx
COA-Unit3-ppt.pptxCOA-Unit3-ppt.pptx
COA-Unit3-ppt.pptxRuhul Amin
 
COA-Unit4-PPT.pptx
COA-Unit4-PPT.pptxCOA-Unit4-PPT.pptx
COA-Unit4-PPT.pptxRuhul Amin
 
COA-Unit2-flynns.pptx
COA-Unit2-flynns.pptxCOA-Unit2-flynns.pptx
COA-Unit2-flynns.pptxRuhul Amin
 
COA-unit-2-Arithmetic.ppt
COA-unit-2-Arithmetic.pptCOA-unit-2-Arithmetic.ppt
COA-unit-2-Arithmetic.pptRuhul Amin
 
risc_and_cisc.ppt
risc_and_cisc.pptrisc_and_cisc.ppt
risc_and_cisc.pptRuhul Amin
 

More from Ruhul Amin (7)

COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptx
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptx
 
COA-Unit3-ppt.pptx
COA-Unit3-ppt.pptxCOA-Unit3-ppt.pptx
COA-Unit3-ppt.pptx
 
COA-Unit4-PPT.pptx
COA-Unit4-PPT.pptxCOA-Unit4-PPT.pptx
COA-Unit4-PPT.pptx
 
COA-Unit2-flynns.pptx
COA-Unit2-flynns.pptxCOA-Unit2-flynns.pptx
COA-Unit2-flynns.pptx
 
COA-unit-2-Arithmetic.ppt
COA-unit-2-Arithmetic.pptCOA-unit-2-Arithmetic.ppt
COA-unit-2-Arithmetic.ppt
 
risc_and_cisc.ppt
risc_and_cisc.pptrisc_and_cisc.ppt
risc_and_cisc.ppt
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 

COA-Unit-1-Basics.ppt

  • 1. A computer is an electronic device which accepts information and processes the information according to the program and produces the output. -- used for information processing. A computer has four functions: 1. Accepts data Input ---- The Information Processing Cycle 2. Processes data --------- Processing 3. Produces output ------ Output 4. Stores results ----------- Storage List of instructions are called programs & internal storage is called computer memory INTRODUCTION What is a computer?
  • 2. Basic terms:  Computer architecture » The functional operation of the individual H/W units in a computer system & the flow of information & controlling. » The structure & behavior of the computer as seen by the user » Include instruction formats, instruction set, addressing etc.  Computer organization » Describes the function & design of the various units of computer that store & process information. It also deals with the interface & external devices. » The way the H/W components operate & connected together to form a computer system. INTRODUCTION
  • 3. Some Beginning Terms Hardware : The hardware includes devices such as keyboard, monitor, mouse etc. Software : The software tells the computer what to do in the form of instructions. Data : Data is the raw facts given to the computer. Individual facts like first name, price, quantity ordered etc. Information : Data which has been messaged into a useful form.
  • 5. TYPES OF THE COMPUTER
  • 6. TYPES OF THE COMPUTER
  • 7. TYPES OF THE COMPUTER
  • 8. Personal computer (Desk Top PC): This is the most common type found in homes, schools, Business offices etc
  • 11. 3. Note Book Computers (Laptop PC) These are compact and portable versions of PC.
  • 14. 5. Handheld PCs (PDAs) The most popular hand-held computers are those that are specifically designed to provide PIM (personal information manager) functions, such as a calendar and address book.
  • 15. 6. Smart Phones: Can send and receive SMS, MMS Uses s/w like personal organizers, Equipped with cameras and music players Can access Web, send and receive E-mails.
  • 16. TYPES OF THE COMPUTER
  • 17. 1. Network Servers: A network server is a computer that manages network traffic.
  • 19. 2. Mainframe Computers:  Large computer system, occupies a large area.  Connected to desktop computers and mini comps near by.  32 bit or 64 bit computers.  can handle up to 64 to 100 terminals.  CPU speed 100MIPS. IBM-370/168,IBM-3033/3090,UNIVAC1100/60, VAX-8000 MAINFRAME ENVIRONMENT: Terminals: 1. Dumb terminals. -does not store or process -an i/p or o/p device. 2. Intelligent terminals - Can process, no storage. - smart terminals.
  • 20.
  • 22. A minicomputer, is a computer of a size intermediate between a microcomputer and a mainframe.  a multi user system  CPU speed 10-30 MIPS  16-96 Main memory capacity.  Disk size 40-80 GB. Typically, minicomputers have been stand-alone computers (computer systems with attached terminals and other devices) Used in small and mid-size business applications and to large enterprises for department-level operations. 3. Minicomputer: In recent years, the minicomputer has evolved into the "mid-range server" and is part of a network. IBM's as/400e is a good example.
  • 23.  A supercomputer generates large amounts of heat and must be cooled.  In modern supercomputers built of many conventional CPUs running in parallel. 4. Supercomputers  Supercomputers consume and produce massive amounts of data in a very short period of time .  The fastest type of computer.  Supercomputers are very expensive and are employed for specialized applications that require immense amounts of mathematical calculations. For example, weather forecasting requires a supercomputer. Other uses of supercomputers include animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum exploration
  • 24.
  • 25.
  • 27. Programming: A computer program is just a collection of the instructions necessary to solve a specific problem . The approach or method that we use to solve the problem is called an algorithm High level languages like Pascal, Fortran, Cobol , C, C++ and so on. Assembly language
  • 29. Three types of programming languages are; 1. Machine languages : » Strings of numbers giving machine specific instructions » Example: 1001010101 1. Assembly languages » English-like abbreviations representing elementary computer operations (translated via assemblers) » Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY Programming Languages:
  • 30. 3. High-level languages » Codes similar to everyday English » Use mathematical notations (translated via compilers) » Example: gross Pay = base Pay + overtime Pay
  • 32.
  • 33. A computer consists of five functionally independent main parts: 1. Input Unit 2. Memory Unit 3. Arithmetic & Logic unit (ALU) 4. Output Unit 5. Control unit. Fig: Basic functional units of a computer Basic Functional unit
  • 34. Input Unit Everything we tell the computer is Input. Types of Input: Data is the raw facts given to the computer. Programs are the sets of instructions that direct the computer. Commands are special codes or key words . --a menu of commands like "Open" on the File menu. User response is the user's answer to the computer's question, -- OK, YES, or NO -- or by typing in text, for example the name of a file.
  • 36.
  • 37.
  • 38.
  • 39. Pen
  • 40.
  • 41.
  • 42.
  • 43. What is Output? Output is data that has been processed into useful form, now called Information. Types of Output : Hard copy: printed on paper or other permanent media Soft copy: displayed on screen or by other non-permanent means Output Unit
  • 44. Categories of Output Text documents including Reports ,letters, etc. Multimedia Combination of text, Graphics, video, audio Graphics Charts ,graphs, pictures
  • 45. Output Device such as CRT Monitor
  • 46. Arithmetic & Logic unit (ALU) Performs basic arithmetic such as addition, subtraction, division and multiplication operations. Also logical operations are performed here under the supervision of control unit.
  • 47. Functions of control unit: Fetching data and instructions from the memory. Interpreting the instructions. Controlling the transfer of data and instructions to and from memory. Controlling the input and output devices. The overall supervision of a computer Control unit
  • 48. Memory Unit:  CPU Registers. The memory unit can be either primary (RAM) or secondary memory Memory unit takes the data from input device and stores it until the computer is ready to process it.  Main memory (temporary): RAM is a volatile memory.  Secondary memory (permanent): The data or results be stored permanently using secondary storage devices such as hard disc drive or CD-ROM etc.  Cache memory: In-built to the processor or outside the processor, speed increases.
  • 49. A memory address holds 1 byte of data where 1 bit =0 or 1, on or off 1 byte = 8 bits 1 kilobyte (K or KB) =1024 bytes 1 megabyte (MB) =1024 kilobytes Why 1024 instead of 1000 bytes per kilobyte. That is because computers don't count by tens like people. Computers count by twos and powers of 2. 1024 is 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 that is 2 times itself ten times. MIPS (million instructions per second), is one way to measure computer speeds
  • 50. Stored program concept is used in memory
  • 51.
  • 52.
  • 53.  To perform a given task an appropriate program consisting of a list of instructions is stored in the memory.  Individual instructions are brought from the memory into the processor, which executes the specified operations.  Data to be stored are also stored in the memory. Examples: - Add LOCA, R0 This instruction requires the performance of several steps,  First the instruction is fetched from the memory into the processor.  The operand at LOCA is fetched and added to the contents of R0  Finally the resulting sum is stored in the register R0 Basic Operational Concepts
  • 54. Example 2: Load LOCA, R1 Add R1, R0  Transfers between the memory and the processor are started by sending the address of the memory location to be accessed to the memory unit and issuing the appropriate control signals.  The data are then transferred to or from the memory.
  • 55. Figure 1.2. Connections between the processor and the memory. Processor Memory PC IR MDR Control ALU Rn 1 - R1 R0 MAR n general purpose registers IR – Instruction Register; PC – Program Counter; MAR – Memory Address Register; MDR – Memory Data Register
  • 56. The instruction register (IR):- Holds the instructions that is currently being executed. Its output is available for the control circuits which generates the timing signals that control the various processing elements in one execution of instruction. The program counter PC:- This is another specialized register that keeps track of execution of a program. It contains the memory address of the next instruction to be fetched and executed. Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
  • 57. The other two registers which facilitate communication with memory are: - • MAR – (Memory Address Register):- It holds the address of the location to be accessed. • MDR – (Memory Data Register):- It contains the data to be written into or read out of the address location.
  • 58. Operating steps are:  Programs reside in the memory & usually get these through the I/P unit.  Execution of the program starts when the PC is set to point at the first instruction of the program.  Contents of PC are transferred to MAR and a Read Control Signal is sent to the memory.  After the time required to access the memory elapses, the address word is read out of the memory and loaded into the MDR.  Now contents of MDR are transferred to the IR & now the instruction is ready to be decoded and executed.  If the instruction involves an operation by the ALU, it is necessary to obtain the required operands.
  • 59.  An operand in the memory is fetched by sending its address to MAR & Initiating a read cycle.  When the operand has been read from the memory to the MDR, it is transferred from MDR to the ALU.  After one or two such repeated cycles, the ALU can perform the desired operation.  If the result of this operation is to be stored in the memory, the result is sent to MDR.  Address of location where the result is stored is sent to MAR & a write cycle is initiated.  The contents of PC are incremented so that PC points to the next instruction that is to be executed.
  • 60. A group of lines that serve as a connecting path for several devices is called a bus.  The simplest and most common way of interconnecting various parts of the computer.  To achieve a reasonable speed of operation, a computer must be organized so that all its units can handle one full word of data at a given time.  In addition to the lines that carry the data, the bus must have lines for address and control purpose. Bus structure
  • 61. Fig: Single bus structure Input Output Memory Processor
  • 62. • Receiving and interpreting user commands • Entering and editing application programs and storing them as files in secondary storage devices • Managing the storage and retrieval of files in secondary storage devices • Running standard application programs (e.g. word processors, games or user’s applications) with data supplied by the user • Controlling I/O units to receive input information and produce output results • Translating programs from source form prepared by the user into object form consisting of machine instructions • Linking and running user-written application programs with existing standard library routines, such as numerical computation packages Software
  • 63. Processor Cache memory Figure 1.5. The processor cache. Main Memory
  • 64. 1. High processing speed. The immense speed of the computer enables it to do millions of such steps in a second. (MIPS) 2. Accuracy. 3. Reliability (Consistent results) Failures are usually due to human error, -Gives consistent results. 4. Versatility (wide area of applications) 5. Storage capacity A computer can keep huge amounts of data. 6. Diligence (unrest) Characteristics of a computer:
  • 65. Processor Clock A clock – a timing signal that controls processor circuits A clock cycle – a regular time interval during which the processor performs a single basic step Each instruction to be performed by the processor is divided into a sequence of basic steps P – the length of one clock cycle R=1/P (clock rate)
  • 66. Basic Performance Equation N S T R   N is the actual number of instruction executions S is the average number of basic steps needed to execute one machine instruction R is the clock rate T is the processor time required to execute a program that has been prepared in some high-level language
  • 67. Historical Overview • “The 1st Generation”: vacuum tube technology (1945-1955) A few milliseconds per arithmetic operation • “The 2nd Generation”: transistor technology (1955-1965) High-level languages, compilers, separate I/O processors • “The 3rd Generation”: Integrated-circuit technology(1965-1975) Operating systems, Microprogramming, multiprogramming, pipelining, cache memories, IC, MSI, LSI. Electronic Computers
  • 68. Historical Overview • “The 4th Generation”: VLSI (Very Large Scale Integration) (1975- present) Microprocessors, virtual memories, concurrency, networks, high resolution graphics, Personal Computer (Apple, Microsoft, etc.), Internet • Beyond the 4th Generation: artificial intelligence, massively parallel machines, extensively distributed systems Electronic Computers
  • 69. • Numbers, arithmetic operations, characters. • Addition of unsigned numbers • Subtraction of unsigned numbers • Addition of positive numbers • Subtraction of positive numbers • Addition/subtraction of signed numbers • Overflow of arithmetic operation. • Carry of arithmetic operation Machine instructions and programming • Sign-And-Magnitude • 1’s Complement • 2’s Complement
  • 70.
  • 71.
  • 72.
  • 73.
  • 75. Lower byte addresses are used for the more significant bytes (left most) Lower byte addresses are used for the least significant bytes (right most) Big-endian and Little-endian memory organization
  • 77.
  • 78.
  • 79. Perform –10 add –13 -10 decimal = 10110 -13 decimal = 10011 sum = 1 ) 01001 Actually 101001 is –23, but uses 6 bits Result range is 5 bits !! So considered as overflow
  • 80. -14 decimal 01110 is + 14 decimal 10001 + 1 is 2’s complement of +14 10010 is –14 decimal perform -14 add 11 10010 + 01011 = 11101 is –3 decimal
  • 81. Exercises Address in Hex Data stored (binary) 2000 0011 1000 2001 0011 0100 2002 0011 0010 2003 0011 1001 Interpret the storage 1) Big-endian storage of 2 hex words of 4-digits each 2) Big-endian storage of 2 BCD words of 4-digits each 3) Little-endian storage, in ASCII, of a4-digit signed hex word 4) Little-endian storage, in ASCII, of a 4-digit BCD word
  • 82. 1) 3834 H and 3239 H ; convert it to decimal (14388 & 12857) 2) 3834 & 3239 decimal 3) 9248 hexa signed. - 28088 Decimal 4) 9248 decimal.
  • 83. Single address example Load A Add B Store C C [A] +[B] Two address example Move A, R1 Add B, R1 Move R1, C C [A] +[B]
  • 84. •Word alignment •Even address boundary !!?? •Word address, character address •Memory access: load (Read or Fetch ) / store instructions
  • 85. Instructions and instruction sequencing • Program consists of sequence of instructions • data transfers between the memory and processor registers • Arithmetic and logic operations on data • Program sequencing and control • I/O transfers
  • 86. Instructions and instruction sequencing Register transfer notation R1 [LOC] R3 [R1] +[R2] Assembly language notations assembly language ? MOV LOC, R1 ADD R1, R2, R3
  • 87. Instructions and instruction sequencing Basic instruction types C = A + B ; high level notation ADD A, B, C ; i.e. C [A] + [B] Generally, operation source1, source2, destination One address instructions Two address instructions Three address instructions
  • 88. One address instructions ADD A LOAD A STORE A ADD B STORE C etc Two address instructions MOVE B, C ADD A, C ; C [A] + [C] Three address instructions ADD A, B, C etc
  • 89. Instruction execution and straight line sequencing C [A] +[B] Load A Add B Store C Load A, Ri Store Ri, A Add A, Ri
  • 90. Instruction execution and straight line sequencing ADD Ri, Rj ADD Ri, Rj, Rk MOVE A, Ri LOAD A, Ri MOVE Ri, A MOVE A, Ri MOV B, Rj ADD Ri, Rj MOVE Rj, C MOVE A, Ri ADD B, Ri MOVE Ri, C
  • 92. A straight line program for adding ‘n’ numbers
  • 93. Using a loop to add ‘n’ numbers
  • 94.
  • 95. Condition Codes N – Negative Z – Zero V – Overflow C - Carry
  • 96. Generating Memory Addresses Addressing Modes Different ways in which the location of an operand is specified in an instruction. 1. Immediate 2. Register 3. Absolute (Direct) 4. Indirect 5. Index 6. Base with index 7. Base with index and offset 8. Relative 9. Auto-increment 10. Auto-decrement # Value Operand =Value Ri EA = Ri LOC EA = LOC (Ri) EA = [Ri] (LOC) EA = [LOC] X(Ri) EA = [Ri] + X (Ri,Rj) EA = [Ri] +[Rj] X(Ri, Rj) EA = [Ri] +[Rj] + X X(PC) EA = [PC] + X (Ri) + EA = [Ri] ; Increment Ri -(Ri) Decrement Ri ; EA = [Ri] EA is Effective Address
  • 97. Generating Memory Addresses Addressing Modes Register Mode The operand is the contents of a processor register. The name of the register is given in the register. MOVE R1, R2 Absolute (Direct) Mode The operand is in a memory location; the address of this location is given explicitly in the instruction. MOVE LOC, R2 ADD R2, COUNT
  • 98. Generating Memory Addresses Addressing Modes Immediate Mode The operand is given explicitly in the instruction MOVE 200, R0 ; 200 is immediate data MOVE #200, R0 MOVE B, R1 ADD #6, R1 ; A = B + 6 MOVE R1, A
  • 99. Generating Memory Addresses Addressing Modes Indirection and Pointers Indirect Mode The Effective Address of the operand is the contents of a register or memory location whose address appears in the instruction. ADD (R1), R0 ; Register Indirect ADD (A), R0 ; Memory Indirect Fig 2.11 page 50 Fig 2.12 :Program –sorting ‘n’ words
  • 100. Indexing and Arrays Add 20(R1), R2 . . . . . . Operand 1000 1020 20 = offset 1000 R1 Offset is given as a constant Adding a constant to the register. Case 1
  • 101. Indexing and Arrays Add 1000(R1), R2 . . . . . . Operand 1000 1020 20 = offset 20 R1 Offset is given as a constant Adding a constant to the register. Case 2
  • 102. n Student ID Test 1 Test2 Test3 Student ID Test1 Test2 Test3 . . . N LIST LIST+4 LIST+8 LIST+12 LIST+16 Student 1 Student 2 An example of indexing: add the test scores Move #LIST, R0 Clear R1 Clear R2 Clear R3 Move N, R4 LOOP Add 4(R0), R1 Add 8(R0), R2 Add 12(R0), R3 Add #16, R0 Decrement R4 Branch>0 LOOP Move R1, SUM1 Move R2, SUM2 Move R3, SUM3
  • 103. Relative Addressing 0FF4 Move N, R1 0FF8 Move #NUM1, R2 0FFC Clear R0 1000 LOOP Add (R2), R0 1004 Add #4, R2 1008 Decrement R1 100C Branch >0 LOOP 100F Move R0, SUM The relative address is –16 -16(PC)
  • 104. Auto Increment Mode 0FF4 Move N, R1 0FFB Move #NUM1, R2 0FFC Clear R0 1000 LOOP Add (R2) +, R0 1004 Decrement R1 1008 Branch >0 LOOP 1012 Move R0, SUM An example … Post increment !
  • 105. Auto decrement Mode Pre decrement ! Used in stack implementation
  • 106. Assembly Language Mnemonics (acronyms of the operation to be performed) Assembly language: (complete set of symbolic names and rules for their use constitute a programming language ) Syntax : (set of rules for using the mnemonics in the specification of complete instructions and program ) Assembler: Source program: Object program: Opcode:
  • 107. Assembler Directives How to interpret the names Where to place the instructions in the memory Where to place the data operands in the memory Instruction format Label Operation Operand(s) Comments
  • 108. Assembler Directives SUM EQU 200 ORIGIN 204 N DATAWORD 100 NUM1 RESERVE 400 ORIGIN 100 START MOVE N, R1 MOVE #NUM1, R2 CLR R0 LOOP ADD (R2), R0 ADD #4, R2 DEC R1 BGTZ LOOP MOVE R0, SUM RETURN END START 100 Move N, R1 104 Move #NUM1, R2 108 Clear R0 LOOP 112 Add (R2), R0 116 Add #4, R2 120 Dec R1 124 Branch>0 LOOP 128 Move R0, SUM 132 …. …. …. SUM 200 N 204 100 NUM1 208 NUM2 212 …. …. NUMn 604
  • 109. Number notation #Value #98 decimal #%Value #%00111001 binary #$Value #$5D hexadecimal