Unit 1.
Unit 1.
Subject: COA
Branch – Computer Science & Information Technology
Semester- IV
Faculty Name : Prof. Vivek Rawat,
Dept of CSIT, Sagar Institute of Research & Technology
Faculty Name : Prof. Vivek Rawat,
Dept of CSIT, Sagar Institute of Research & Technology
Course outcomes
CO Blooms
No. Course Out Come Skills
Level
The desktop computers are the computers which are usually found on a
home or office desk. They consist of processing unit, storage unit, visual
display and audio as output units, and keyboard and mouse as input units.
Usually storage unit of such computer consists of hard disks, CD-ROMs, and
diskettes. Desktop computers are basically digital computers. They consist of
five functionally independent units: input, memory, arithmetic and logic,
output and control units. Memory unit is also known as storage unit, and
arithmetic and logic unit (ALU) and control unit are combine as processing
unit. Fig. shows these five functional
Input Unit - The input unit accepts the digital information from user with the
help of input devices such as keyboard, mouse, microphone etc. The
information received from the input unit is either stored in the memory for
later use or immediately used by the arithmetic and logic unit to perform
the desired operations.
Memory Unit - The memory unit is used to store programs and data.
Usually, two types of memory devices are used to form a memory unit:
primary storage memory device and secondary storage memory device.
Arithmetic and Logic Unit - The Arithmetic and Logic Unit (ALU) is
responsible for performing arithmetic operations such as add, subtract,
division and multiplication and logical operations such as ANDing, ORing,
Inverting etc.
Output Unit - The output unit sends the processed results to the user using
output devices such as video monitor, printer, plotter, etc.
Control Unit - The control unit co—ordinates and controls the- activities
amongst the functional. The basic function, of control unit is to fetch the
instructions stored in the main memory, identify .
Central Processing Unit (CPU)
The MAR holds the address of the main memory to or from which data is to be
transferred. The MDR sometimes also called MBR (Memory Buffer Register)
contains the data to be written into or read from the addressed word of the main
memory.
Organization-Memory Register
General purpose registers - These are used to hold the operands for arithmetic and logic
operations and/or used to store the result of the operation. Since the access time of
these registers is lowest, these are used to store frequently used data.
Arithmetic logic unit uses CPU registers to accept data for processing. After processing
data ALU Stores result again in the CPU register. A'LU also stores the status of the result
in. the CPU register.
• Memory Address Register (MAR):- Connected to the address lines of the system
bus. It specifies the address of memory location from which data or instruction is
to be accessed (for read operation) or to which the data is to be stored (for
write operation).
• Memory Data Register (MDR):- Connected to the data lines of the system bus. It
specifies which data is to be accessed (for read operation) or to which data is to be
stored (for write operation).
• Program Counter (PC):- Holds address of next instruction to be fetched, after the
execution of an on-going instruction.
• Instruction Register (IR):- Here the instructions are loaded before their execution
or holds last instruction fetched.
General bus organization for CPU registers.
Data flow between CPU, memory and I/O devices
Data Path
Control Signals
Auxilliary Storage
(Backing Storage)
To Supplement main storage
Memory
Output
Input
Unit
Unit
Registers
Processor
Control Word/Unit
• It is responsible for directing and coordinating most of the
computer system activities.
• It does not execute instructions by itself. It tells other parts of
the computer system what to do.
• It determines the movement of electronic signals between the
main memory and arithmetic logic unit as well as the control
signals between the CPU and input/output devices.
Control Unit
The control unit initiates a series of sequential steps of micro
operation During any given time, certain microoperations are to be
initiated, while others remain idle.
The control variables at any given time can be represented by a
string of 1's and O's called a control word.
As such, control words can be programmed to perform various
operations on the components of the system control unit whose
binary control variables are stored in memory is called
microprogrammed control unit
Each word in control memory contains within a microinstruction.
The microinstruction specifies one or more micro-operat for the
system.
Control Unit(Condt…)
• To complete an event i.e. processing, control unit repeats a set
of four basic operations:
• Fetching is the process of obtaining a program instruction or
data item from the memory
• Decoding is the process of translating the instruction into
commands the computer can execute.
• Executing is the process of carrying out the commands.
• Storing is the process of writing the result to memory.
Control Unit
• The internal communication inside a computer that transforms raw
data into useful information is called processing.
• To perform this transformation, the computer uses two
components- processor and memory
• The program is fed into the computer through the input unit and
stored in the memory
• To execute the program, the instructions have to be fetched from
memory one by one which is done by control unit
• Then the control unit decodes the instruction.
Control Unit
• According to instruction, control unit issues signals to other
units.
• After instruction is executed, the result of the instruction is
stored in memory or stored temporarily in the registry, so that
this can be used by the next instruction.
• The results of a program are taken out of the computer
through the output unit.
Stack Organization,
A useful feature that is included in the CPU of most computers is a stack or last-in,
first-out (LIFO) list. A stack is a storage device that stores information in such a
manner that the item stored last is the first item retrieved.
The operation of a stack can be compared to a stack of trays The last tray placed
on top of the stack is the first to be taken off The stack in digital computers is
essentially a memory unit with an address register that can count only (after an
initial value is loaded into it)
The register that holds the address for the stack is called a stack pointer (SP)
because its value always points at the top item in the stack. Contrary to a stack of
trays where the tray itself may be taken out or inserted, the physical registers of a
stack are always available for reading or writing. It is the content of the word that
is inserted or deleted.
Stack Organization,
The operation of insertion is called push (or push down) because it can be
thought of as the result of pushing a new item on top.
The operation of deletion is called pop (or pop-up) because it can be thought
of as the result of removing one item so that the stack pops up However,
nothing is pushed or popped in a computer stack' These operations are
simulated by incrementing or decrementing the stack pointer register
Stack Organization,
Register Stack
Memory Stack
A stack can exist as a stand-alone unit as
it can be implemented in a random-
access memory attached to a CPU. The
implementation of a stack in the CPU is
done by assigning a portion of memory
to a stack operation and using a
processor register as a stack pointer.
Figure 8-4 shows a portion of computer
memory partitioned into three segments:
program, data, and stack. The program
counter PC points at the address of the
next instruction in the program.
Interconnection Of Units
• A computer program consists of both instructions and data.
• The program is fed into the computer through the input unit
and stored in the memory.
• In order to execute the program, the instructions have to be
fetched from memory one by one and store it into registers
(working memory) for processing.
• This fetching of instructions is done by the control unit.
Instruction cycle
A program residing in the memory unit of the computer consists of a
sequence of instructions. The program is executed in the computer by going
through a cycle for each instruction.
Each instruction cycle in turn is subdivided into a sequence of subcycles or
phases.
The bits of the instruction are divided into groups called fields.
Input and
Memory
CPU Output(I/O)
Unit
Units
Data Bus
Address Bus
Control Bus
System
Bus
Interconnection of Computers Units via Bus
Read/Write
memory Factory User Erasable PROM
Programmed Programmable
PROM
SRAM DRAM
Permanent
non-erasable (Non-erasable)
UVEPROM EEPROM
Cache Memory
• High speed memory kept in between processor and
RAM to increase the data execution speed.
• Kept near to the processor.
• Major reason for incorporating cache in the system
is that the CPU is much faster than the DRAM and
needs a place to store information that can be
accessed quickly.
• Cache fetches the frequently used data from the
DRAM and buffers (stores) it for further processor
usage.
Cache Memory
Different Levels of Cache
• L1-cache is the fastest cache and it usually comes within
the processor chip itself. L1 cache typically ranges in size
from 8KB to 64KB and uses the high-speed SRAM
instead of the slower and cheaper DRAM used for main
memory.
• L2 cache comes between L1 and RAM and is bigger than
the primary cache.
• L3 cache is not found nowadays as its function is
replaced by L2 cache. L3 caches are found on the
motherboard rather than the processor. It is kept
between RAM and L2 cache.
Faculty Name : Prof. Vivek Rawat,
Dept of CSIT, Sagar Institute of Research & Technology
Processor Speed
• Speed of a computer system is determined by several
factors, clock speed of the processor and the speed and
size of the data bus.
• Clock speed is the rate at which the processor processes
information and this is measured in millions of cycles per
second(Megahertz)
• The more the number of hertz, the faster is the
processing speed
• The larger the bus width and the faster the bus speed,
the greater the amount of data can travel on it in a given
amount of time.
Faculty Name : Prof. Vivek Rawat,
Dept of CSIT, Sagar Institute of Research & Technology
Input Devices
• Any peripheral used to provide data and
control signals to an information processing
system such as a computer or other
information appliance.
• Common input devices: Keyboard, Mouse
• Other devices: microphone, digital camera,
scanner.
The digital system can be constructed with flip flops and gates using
sequential logic design.
Registers and their functions: The total number of registers in the system and
their functions includes all its counterparts such as shift registers, counters
and memory unit. Counter is register, which increments the information
stored in it
A memory unit is a set of storage registers where information can be stored.
Control function: The control functions that activate operations and central the
sequence of operations. They consists of timing signals that sequence the
operations one at a time the control function is basically a binary variable, when
it is logic 1 it initiates the operation otherwise it inhibits the operation.
Register Transfer Language-Bus and Memory Transfer,
Examples of micro operation are lead, store, clear, shift, and count and so on.
Sequences of micro- operations are performed to perform one complete
operation.
For example, to add two numbers following micro operation sequence has to be
performed. 1. Load first number in register 1
2. Load second number in register 2.
3. Perform add micro-operation.
4. Store the result in the destination register
1.Arithmetic Micro-operations
These micro-operations perform some basic arithmetic operations on the numeric data
stored in the registers. These basic operations may be addition, subtraction,
incrementing a number, decrementing a number and arithmetic shift operation. An ‘add’
micro-operation can be specified as: R3 R1+R2
It implies: add the contents of registers R1 and R2 and store the sum in register R3.
Subtraction –
In subtraction micro-operation, the contents of register R2 are subtracted from
contents of the register R1, and then the result is transferred into R3.
R3 R1 - R2
There is another way of doing the subtraction. In this, 2’s
complement of R2 is added to R1, which is equivalent to R1 – R2,
and then the result is transferred into register R3.
•Increment –
In Increment micro-operation, the value inside the R1 register
is increased by 1.
•R3 R1 + 1
Decrement –
In Decrement micro-operation, the value inside the R1 register is
decreased by 1.
R3 R1 - 1
•1’s Complement –
In this micro-operation, the complement of the value inside
the register R1 is taken.
2’s Complement –
In this micro-operation, the complement of the value inside the
register R2 is taken and then 1 is added to the value and then
the final result is transferred into the register R2. This process is
also called Negation. It is equivalent to -R2.
Logic operations
these are binary micro-operations implemented on the bits saved in the registers.
These operations treated each bit independently and create them as binary
variables.
For example, the exclusive-OR micro-operation with the contents of two registers
R1 and R2 is denoted by the statement
P: R1←R1⊕R2
There are some situations where we need to change the memory address
dynamically.
For example program of array, to add the data and get the total sum of all
array elements. In this we have to repeat the add instruction number of times
equal to the array elements and each time we have to add a number from a
new successive memory location.
The operation to be performed is specified by the operation field of the
instruction. The execution of the operation is performed on some data
stored in computer registers or memory words and the
way the operands are chosen during program.
Selection of operands during program execution depends on the addressing
mode of the instruction. The purpose of using address mode techniques by
the computer is to accommodate one or both of the following provisions:
• Implied Mode: This mode specify the operands implicitly in the definition of the
instruction. For example, the instruction ‘‘complement accumulator’’ is an implied
mode instruction because the operand in the accumulator register is implied in the
definition of the instruction. In fact, all register references instructions that use an
accumulator are implied mode instructions. Zero-address introductions are implied
mode instructions.
•
• Immediate Mode: The operand is specified in the instruction itself in this mode i.e. the
immediate mode instruction has an operand field rather than an address field. The
actual operand to be used in conjunction with the operation specified in the
instruction is contained in the operand field.
• Example : MOVE A, #20
•
• Register Mode: In this mode the operands are in registers that reside within the CPU.
The register required is chosen from a register field in the instruction. Example:
MOV R1, R2
Register LD R1 AC<-R1