2nd Sem CA Notes
2nd Sem CA Notes
2nd Sem CA Notes
Non-Weighted Codes
In this type of binary codes, the positional weights are not
assigned. The examples of non-weighted codes are Excess-3
code and Gray code.
Excess-3 code
The Excess-3 code is also called as XS-3 code.
The Excess-3 code words are derived from the 8421 BCD code words adding
(0011)2 or (3)10 to each code word in 8421.
BCD is a way to express each of the decimal digits with a binary code.
In the BCD, with four bits we can represent sixteen numbers (0000 to 1111).
But in BCD code only first ten of these are used (0000 to 1001). The remaining six code
combinations i.e. 1010 to 1111 are invalid in BCD.
Advantages of BCD Codes
• It is very similar to decimal system.
• We need to remember binary equivalent of decimal numbers 0 to 9 only.
Note:
List of instructions are called programs & internal storage is called computer
memory.
Types of computer
The different types of computers are:
1. Personal computers: - This is the most common type found in homes, schools, Business
offices etc., It is the most common type of desk top computers with processing and storage
units along with various input and output devices.
2. Note book computers: - These are compact and portable versions of PC
3. Work stations: - These have high resolution input/output (I/O) graphics capability, but
with same dimensions as that of desktop computer. These are used in engineering
applications of interactive design work.
4. Enterprise systems: - These are used for business data processing in medium to large
corporations that require much more computing power and storage capacity than work
stations. Internet associated with servers have become a dominant worldwide source of all
types of information.
5. Super computers: - These are used for large scale numerical calculations required in
the applications like weather forecasting etc.,
Functional units
A computer consists of five functionally independent main parts input, memory,
arithmetic logic unit (ALU), output and control unit.
Input Unit
Input device accepts the coded information as source program i.e. high level
language.
This is either stored in the memory or immediately used by the processor to
perform the desired operations.
The source program/high level language program/coded information/simply
data is fed to a computer through input devices keyboard is a most common
type.
Whenever a key is pressed, one corresponding word or number is translated
into its equivalent binary code over a cable & fed either to memory or
processor.
EX: Joysticks, trackballs, mouse, scanners etc
Memory unit:
Its function is to store programs and data.
1. Primary memory
Examples: RAM, ROM
2. Secondary memory
Examples: - Magnetic disks & tapes, optical disks (ie CD-ROM’s),
floppies etc.,
Primary Memory
Is the one exclusively associated with the processor and operates at the
electronics speeds.
programs must be stored in this memory while they are being executed.
The memory contains a large number of semiconductors storage cells.
Each capable of storing one bit of information.
To provide easy access to a word in memory, a distinct address is associated
with each word location.
Addresses are numbers that identify memory location.
The time required to access one word in called memory access time.
Caches are the small fast RAM units, which are coupled with the processor
and it tends to be expensive.
Secondary memory:
Is used where large amounts of data & programs have to be stored, particularly
information that is accessed in frequently.
Control unit:
It is effectively acts as the nerve center that sends signals to other units and
senses their states.
The actual timing signals that govern the transfer of data between input unit,
processor, memory and output unit are generated by the control unit.
Basic operational concepts
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.
The add instruction combines a memory access operation with an ALU
Operations.
In some other type of computers, these two types of operations are performed by
separate instructions for performance reasons.
Load LOCA, R1
Add R1, R0
Contd…
In addition to the ALU & the control circuitry, the processor contains a
number of registers used for several different purposes.
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.
The other two registers which facilitate communication with memory
are: -
1. MAR – (Memory Address Register):- It holds the address of the
location to be accessed.
2. MDR – (Memory Data Register):- It contains the data to be written
into or read out of the address location.
Computer Organization:
Computer Organization is concerned with the structure and behavior of a
computer system as seen by the user.
Computer Organization tells us how exactly all the units in the system are
arranged and interconnected.
An organization is done on the basis of architecture.
Computer Organization deals with low-level design issues.
Organization involves Physical Components (Circuit design, Adders, Signals,
Peripherals)
Computer Architecture
Computer Architecture is concerned with the way hardware components are
connected together to form a computer system.
It acts as the interface between hardware and software.
Computer Architecture helps us to understand the functionalities of a system.
A programmer can view architecture in terms of instructions, addressing
modes and registers.
Computer Architecture deals with high-level design issues.
While designing a computer system architecture is considered first.
Types of Computer Architecture:
There are two basic types of computer architecture
Von Neumann architecture
Harvard architecture
Historically there have been 2 types of Computers:
Fixed Program Computers – Their function is very specific and they couldn’t
be programmed, e.g. Calculators.
Stored Program Computers – These can be programmed to carry out many
different tasks, applications are stored on them, hence the name.
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
It is having three basic units:
The Central Processing Unit (CPU)
The Main Memory Unit
The Input/Output Device
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.
Buses –
Data is transmitted from one part of a computer to another, connecting all
major internal components to the CPU and memory, by the means of Buses.
Different types of buses are data bus, address bus, system bus.
.
Contd…
Main Memory Unit (Registers) –
Accumulator: Stores the results of calculations made by ALU.
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 Memory
Address Register (MAR).
Memory Address Register (MAR): It stores the memory locations of
instructions that need to be fetched from memory or stored into memory.
Memory Data Register (MDR): It stores instructions fetched from memory or
any data that is to be transferred to, and stored in, memory.
Current Instruction Register (CIR): It stores the most recently fetched
instructions while it is waiting to be coded and executed.
Instruction Buffer Register (IBR): The instruction that is not to be executed
immediately is placed in the instruction buffer register IBR
Contd…
Bus Structures
Bus structures in computer plays important role in connecting the internal
components of the computer.
The bus in the computer is the shared transmission medium.
This means multiple components or devices use the same bus structure to
transmit the information signals to each other.
Contd…
A system bus has typically has fifty to hundreds of distinct lines where each
line is meant for a certain function.
These lines can be categoriez into three functional groups i.e., data lines,
address lines, and control lines.
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 in order to control
and coordinate all the activities within the computer.
Performance of computer
The most important measure of the performance of a computer is how quickly
it can execute programs.
The speed with which a computer executes program is affected by the design of
its hardware.
For best performance, it is necessary to design the compilers, the machine
instruction set, and the hardware in a coordinated way.
The total time required to execute the program is elapsed time is a measure of
the performance of the entire computer system.
It is affected by the speed of the processor, the disk and the printer.
The time needed to execute a instruction is called the processor time.
Just as the elapsed time for the execution of a program depends on all units in
a computer system.
The processor time depends on the hardware involved in the execution of
individual machine instructions.
Multiprocessor & Multicomputer:-
Multiprocessor:
A Multiprocessor is a computer system with two or more central processing
units (CPUs) share full access to a common RAM.
The main objective of using a multiprocessor is to boost the system’s
execution speed, with other objectives being fault tolerance and application
matching.
There are two types of multiprocessors, one is called shared memory
multiprocessor and another is distributed memory multiprocessor.
In shared memory multiprocessors, all the CPUs shares the common memory
but in a distributed memory multiprocessor, every CPU has its own private
memory.
Distributed Computing:
In distributed computing we have multiple autonomous computers which
seems to the user as single system. In distributed systems there is no shared
memory and computers communicate with each other through message
passing. In distributed computing a single task is divided among different
computers.
Combinational Circuits
The combinational logic circuits are the circuits that contain different types
of logic gates. Simply, a circuit in which different types of logic gates are
combined is known as a combinational logic circuit.
The output of the combinational circuit is determined from the present
combination of inputs, regardless of the previous input.
The input variables, logic gates, and output variables are the basic
components of the combinational logic circuit.
There are different types of combinational logic circuits, such as Adder,
Subtractor, Decoder, Encoder, Multiplexer, and De-multiplexer.
Contd…
There are the following characteristics of the combinational logic circuit:
At any instant of time, the output of the combinational circuits depends only
on the present input terminals.
The combinational circuit doesn't have any backup or previous memory. The
present state of the circuit is not affected by the previous state of the input.
The n number of inputs and m number of outputs are possible in
combinational logic circuits.
Half Adder
Half adder is a combinational arithmetic circuit that adds two bits.
It has two inputs, called A and B and produces a sum bit (s) and carry bit (c)
both as output.
It does not take carry from previous sum.
The adder works by combining the operations of basic logic gates, with the
simplest form using only a XOR and an AND gate.
This can also be converted into a circuit that only has AND, OR and NOT gates.
This might result in a bigger circuit since three different chips are used
instead of just one.
Block diagram of half adder is:
Contd…
Truth table is:
From the truth table logical expression can be : S=A B and C=A.B
Half-Adder logical circuit:
Full adder
Full Adder is the adder that adds three inputs and produces two outputs.
The first two inputs are A and B and the third input is an input carry as C-IN.
The output carry is designated as C-OUT and the normal output is designated
as S which is SUM.
A full adder logic is designed in such a manner that can take eight inputs
together to create a byte-wide adder and cascade the carry bit from one
adder to another.
Block diagram:
Contd…
Full adder Truth Table:
Contd…
Logical Expression for SUM:
= A’ B’ C-IN + A’ B C-IN’ + A B’ C-IN’ + A B C-IN
= C-IN (A’ B’ + A B) + C-IN’ (A’ B + A B’)
= C-IN (A XOR B)’ + C – IN’ (A XOR B) (A’B + AB’ = A XOR B , AB + A’B’ = (A XOR B)’
= C-IN XOR (A XOR B)
= C- IN XOR A XOR B
S R Qn Qn+1
0 0 x Indeterminate
0 1 x 1 set
1 0 x 0 reset
1 1 x Qn No change
SR Flipflop
Two types of clocked SR flip – flops are possible: based on NAND and based on NOR.
The circuit of clocked SR flip – flop using NAND gates and truth table is shown below
Clock S R Qn+1
Not Triggered x X Qn
Triggered 0 0 Qn No change
Triggered 0 1 0 reset
Triggered 1 0 1 set
Triggered 1 1 Indeterminate
Contd…
This simple clocked RS flip-flop circuit has a set input (S) and a reset input (R).
Flipflop changes the state only when clock pulse is applied depending on the input.
SR flipflop when S=0 and R=1, it goes to reset state, when S=1 and R=0 it goes to set
sate.
When S=0 and R=0 output will be in previous sate.When both S and R is 1 output is
invalid.
SR flip – flops are very simple circuits but are not widely used in practical circuits
because of their illegal state, where both S and R are high (S = R = 1).
But they are used in switching circuits as they provide simple switching function.
JK Flipflop
To overcome these two fundamental design problems with the SR flip-flop design,
the JK flip Flop was developed.
This simple JK flip Flop is the most widely used of all the flip-flop designs and is
considered to be a universal flip-flop circuit.
The two inputs labelled “J” and “K” autonomous letters chosen by its inventor Jack
Kilby.
The JK flip flop is basically a gated SR flip-flop with the addition of a clock input
circuitry that prevents the illegal or invalid output condition that can occur when both
inputs S and R are equal to logic level “1”.
Truth table of JK flipflop
D Flipflop
The D flip-flop is a clocked flip-flop with a single digital input ‘D’.
Each time a D flip-flop is clocked, its output follows the state of ‘D’.
The D Flip Flop has only two inputs D and CP.
The D inputs go precisely to the S input and its complement is used to the R input.
The logic symbol for the D flip-flop is shown in the figure.
Contd…
In SR flip flop, when both the inputs are 0, that state is no longer possible. It is
an ambiguity that is removed by the complement in D-flip flop.
In D flip flop, the single input "D" is referred to as the "Data" input.
When the clock input is set to 1, the "set" and "reset" inputs of the flip-flop are
both set to 1.
So it will not change the state and store the data present on its output before
the clock transition occurred.
In simple words, the output is "latched" at either 0 or 1.
Contd…
Truth table of D flip flop:
T Flipflop
In T flip flop, "T" defines the term "Toggle".
we can construct the "T Flip Flop" by making changes in the "JK Flip Flop".
The "T Flip Flop" has only one input, which is constructed by connecting the
input of JK flipflop.
This single input is called T. In simple words, we can construct the "T Flip Flop"
by converting a "JK Flip Flop".
Sometimes the "T Flip Flop" is referred to as single input "JK Flip Flop".
Block diagram of T flip flop:
Contd…
Circuit diagram of T flip flop:
The above circuit is an example of shift right register, taking the serial data input
from the left side of the flip flop
The circuit consists of four D flip-flops which are connected in a serial manner.
All these flip-flops are synchronous with each other since the same clock signal is
applied to each flip flop.
Serial-In Parallel-Out shift Register (SIPO) –
The shift register, which allows serial input and produces a parallel output is known
as Serial-In Parallel-Out shift register.
The logic circuit given below shows a serial-in-parallel-out shift register.
Integrated Circuits
An integrated circuit (IC) is manufactured using silicon material and mounted in a ceramic
or plastic container (known as Chip).
The basic components of an IC consist of electronic circuits for the digital gates.
The various gates are interconnected inside an IC to form the required circuit.
00:13/05:29
Multiplexer(Mux)
Multiplexer is a combinational circuit that has maximum of 2n data inputs, ‘n’
selection lines and single output line.
One of these data inputs will be connected to the output based on the values of
selection lines.
Multiplexer is also called as Mux.
4x1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 & s0 and
one output Y.
The block diagram of 4x1 Multiplexer is shown in the following figure.
Contd…
One of these 4 inputs will be connected to the output based on the
combination of inputs present at these two selection lines.
Truth table of 4x1 Multiplexer is shown below.
From Truth table, we can directly write the Boolean function for output, Y as
Y=S’1S’0I0+S’1S0I1+S1S’0I2+S1S0I3
Contd…
The circuit diagram of 4x1 multiplexer is shown in the following figure.
De-multiplexer(Demux)
A De-multiplexer is a combinational circuit that has only 1 input line and
2N output lines. Simply, the multiplexer is a single-input and multi-output
combinational circuit.
De-multiplexer is opposite to the multiplexer.
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y0, and Y1, 1
selection lines, i.e., S0, and single input.
On the basis of the selection value, the input will be connected to one of the
outputs. The block diagram and the truth table of the 1×2 multiplexer are given
below.
Above is the block diagram of Instruction format. There are three parts of the
Instruction Format.
Contd…
Addressing Modes
Instructions that define the address of a definite memory location are known as memory
reference instructions.
The method in which a target address or effective address is recognized within the
instruction is known as addressing mode.
The address field for instruction can be represented in two different ways are as follows:
Direct Addressing − It uses the address of the operand.
Indirect Addressing − It facilitates the address as a pointer to the operand.
Opcodes
An opcode is a collection of bits that represents the basic operations including add,
subtract, multiply, complement, and shift.
The total number of operations provided through the computer determines the number of
bits needed for the opcode.
The minimum bits accessible to the opcode should be n for 2n operations.
Contd…
Direct Addressing Mode:
In this addressing mode,
The address field of the instruction contains the effective address of the operand.
Only one reference to memory is required to fetch the operand.
It is also called as absolute addressing mode.
EX: ADD X will increment the value stored in the accumulator by the value stored at
memory location X. AC ← AC + [X]
Contd…
Indirect Addressing Mode-
The address field of the instruction specifies the address of memory location that contains
the effective address of the operand.
Two references to memory are required to fetch the operand.
EX: ADD X will increment the value stored in the accumulator by the value stored at memory
location specified by X.
AC ← AC + [[X]]
Computer Instructions and instruction cycle
A program consisting of the memory unit of the computer includes a series of
instructions.
The program is implemented on the computer by going through a cycle for each
instruction.
In the basic computer, each instruction cycle includes the following procedures −
It can fetch instruction from memory.
It is used to decode the instruction.
It can read the effective address from memory if the instruction has an
indirect address.
It can execute the instruction.
After the following four procedures are done, the control switches back to the
first step and repeats the similar process for the next instruction.
Therefore, the cycle continues until a Halt condition is met
Contd…
The figure shows the phases contained in the instruction cycle.
Contd…
Fetch Cycle: The address instruction to be implemented is held at the program
counter. The processor fetches the instruction from the memory that is pointed by
the PC.
Execute Cycle: The data transfer for implementation takes place in two methods are
as follows:
Processor-memory − The data sent from the processor to memory or from
memory to processor.
Processor-Input/Output − The data can be transferred to or from a peripheral
device by the transfer between a processor and an I/O device.
Timing and Control
CPU is partitioned into Arithmetic Logic Unit (ALU) and Control Unit (CU).
The function of control unit is to generate relevant timing and control signals to all
operations in the computer.
It controls the flow of data between the processor and memory and peripherals.
The control unit must communicate with both the arithmetic logic unit (ALU) and
main memory.
The control unit co-ordinates the activities of all peripherals and auxiliary storage
devices linked to the computer.
Timing of all register in computer is controlled by master clock generator.
Design of control unit
To execute an instruction, the control unit of the CPU must generate the required
control signal in the proper sequence.
There are two approaches used for generating the control signals in proper sequence
as Hardwired Control unit and the Micro-programmed control unit.
Hardwired control
Micro-programmed control.
Cntd…
HARDWIRED CONTROL UNIT:
Disadvantages:
Programmed I/O has disadvantages like CPU has to wait for longer time to receive
data. To overcome this we go for Interrupt controlled I/O.
Interrupt controlled I/O
Since in the above case we saw the CPU is kept busy unnecessarily.
This situation can very well be avoided by using an interrupt driven method for data transfer.
By using interrupt facility and special commands to inform the interface to issue an interrupt request
signal whenever data is available from any device.
In the meantime the CPU can proceed for any other program execution.
Whenever it is determined that the device is ready for data transfer it initiates an interrupt request
signal to the computer.
Upon detection of an external interrupt signal the CPU stops momentarily the task that it was
already performing, branches to the service program to process the I/O transfer, and then return to
the task it was originally performing.
Stack organization
Stack is also known as the Last In First Out (LIFO) list.
It is the most important feature in the CPU.
It saves data such that the element stored last is retrieved first.
A stack is a memory unit with an address register.
This register influence the address for the stack, which is known as Stack Pointer (SP).
The stack pointer continually influences the address of the element that is located at the top of the
stack.
It can insert an element into or delete an element from the stack.
The insertion operation is known as push operation and the deletion operation is known as pop
operation.
In a computer stack, these operations are simulated by incrementing or decrementing the SP register.
Contd…
Register Stack:
The stack can be arranged as a set of memory words or registers.
Consider a 64-word register stack arranged as displayed in the figure.
The stack pointer register includes a binary number, which is the address of the element
present at the top of the stack.
The three-element A, B, and C are located in the stack
Contd…
The element C is at the top of the stack and the stack pointer holds the address of C that is
3.
The top element is popped from the stack through reading memory word at address 3 and
decrementing the stack pointer by 1.
Then, B is at the top of the stack and the SP holds the address of B that is 2.
It can insert a new word, the stack is pushed by incrementing the stack pointer by 1 and
inserting a word in that incremented location.
Data transfer and Manipulation
Data transfer instructions cause transfer of data from one location to another
without changing the binary information.
The most common transfer between
Memory and Processor Register
Processor register and input output devices
Contd…
Data Manipulation Instruction
Data Manipulation instruction perform operations on data and provide the
capabilities for the computer. These instructions perform arithmetic, logic and
shift operation.
Contd…
RISC and CISC Processor
RISC is abbreviated as Reduced Instruction Set Computer.
It is designed to reduce the execution time by simplifying
instruction set of computer.
Each instruction require only one clock cycle(fetch, decode,
execute).
The main idea behind this is to make hardware simpler by using an
instruction set composed of a few basic steps for loading,
evaluating, and storing operations.
It uses highly optimized set of instructions and used in portable
devices like Apple ipod, smart phone, tablets etc.
Contd…
Characteristics of RISC:
It consist of simple instructions.
It supports various data type formats.
It utilises simple addressing mode.
It consist of one cycle execution time.
LOAD and STORE instructions are used to access memory location.
It consist of large number of registers.
Contd…
Architecture of RISC:
CISC
CISC is abbreviated as Complex Instruction Set Computer.
CISC approach minimize the number of instructions per program by
ignoring number of clock cycles per instruction.
It is used in mostly desktop or laptop computers.
Characteristics
Variety of addressing modes will be available.
Large number of instructions will be present.
Several cycle may be required to execute one instructions
Instruction decoding logic is complex.
Contd…
CISC Architecture:
Difference between RISC and CISC
RISC CISC
It is Reduced Set Instruction Computer It is a Complex Instruction Set Computer.
It emphasizes on software to optimize the instruction set. It emphasizes on hardware to optimize the instruction set.
It is a hard wired unit of programming in the RISC
Processor. Microprogramming unit in CISC Processor.
It requires multiple register sets to store the instruction. It requires multiple register sets to store the instruction.
RISC has simple decoding of instruction. CISC has complex decoding of instruction.
Uses of the pipeline are simple in RISC. Uses of the pipeline are difficult in CISC.
It uses a limited number of instruction that requires less It uses a large number of instruction that requires more
time to execute the instructions. time to execute the instructions.
It uses LOAD and STORE that are independent instructions It uses LOAD and STORE instruction in the memory-to-
in the register-to-register a program's interaction. memory interaction of a program.
The execution time of RISC is very short. The execution time of CISC is longer.
RISC architecture can be used with high-end applications
CISC architecture can be used with low-end applications
like telecommunication, image processing, video processing,
like home automation, security system, etc.
etc.
It has fixed format instruction. It has variable format instruction.
The program written for RISC architecture needs to take Program written for CISC architecture tends to take less
more space in memory. space in memory
UNIT - III
Register Transfer
and
Micro Operations
REGISTER TRANSFER LANGUAGE(RTL)
Insymbolic notation, it is used to describe the micro-operations transfer among
registers.
Itis a kind of intermediate representation (IR) that is very close to assembly
language, such as that which is used in a compiler.
The term “Register Transfer” can perform micro-operations and transfer the result
of operation to the same or other register.
The information transformed from one register to another register is represented
in symbolic form by replacement operator is called Register Transfer.
CONTD…
MEMORY SYSTEM
Memory Hierarchy
• Memory hierarchy design
CONTD…
• The Computer memory hierarchy looks like a pyramid structure which is used to describe the
differences among memory types.
• In Memory Hierarchy the cost of memory, capacity is inversely proportional to speed.
• Here the devices are arranged in a manner Fast to slow, that is form register to Tertiary memory.
• Let us discuss in detail.
CONTD…
• Level-0 − Registers: The registers are present inside the CPU. As they are present inside the CPU,
they have least access time. Registers are most expensive and smallest in size generally in
kilobytes. They are implemented by using Flip-Flops.
• Level-1 − Cache: Cache memory is used to store the segments of a program that are frequently
accessed by the processor. It is expensive and smaller in size generally in Megabytes and is
implemented by using static RAM.
• Level-2 − Primary or Main Memory: It directly communicates with the CPU and with auxiliary
memory devices through an I/O processor. Main memory is less expensive than cache memory
and larger in size generally in Gigabytes. This memory is implemented by using dynamic RAM.
CONTD …
• Level-3 − Secondary storage: Secondary storage devices like Magnetic Disk are present at level 3.
They are used as backup storage. They are cheaper than main memory and larger in size
generally in a few TB.
• Level-4 − Tertiary storage: Tertiary storage devices like magnetic tape are present at level 4.
They are used to store removable files and are the cheapest and largest in size (1-20 TB).
SEMICONDUCTOR MEMORIES
• Semiconductor memory is a type of semiconductor device used for storing digital data.
• There are two electronic data storage mediums that we can utilize, magnetic or optical.
• Magnetic storage stores the data in magnetic form, has high storage capacity.
• Optical storage stores data optically and uses laser, has less storage capacity.
• A memory location is a group of storage devices that will hold one data word.
• A data word length of 8-bits is called a byte.
• Each memory location can store a different data word and has a unique address.
• Memory can hold one or more bits of information to store the Data, Instruction, and Addresses.
CONTD…
Memory can be classified into the following three groups.
Registers:
• Registers are memories located within the Central Processing Unit (CPU).
• Various types of registers are available within CPU. Registers are small but CPU can access it quickly.
• Some of the registers available in the system are: Instruction Register, ALU I/O registers, Status Register, Stack pointer
register, Program counter, etc.
Primary Memory: It is classified into two types, namely RAM and ROM.
Secondary Memory:
• Disk memory is used to hold programs and data over the longer term.
• The contents of a disk are NOT lost if the power is turned off.
• Disks are much slower than Register.
RANDOM ACCESS MEMORY(RAM)
• The time taken to transfer information to or from any desired location is always same hence it is
called Random Access Memory (RAM).
• Memory size = 2n × m, where n: address line, m: data
• RAM can be classified into two types, namely Static RAM and Dynamic RAM.
CONTD…
Static RAM (SRAM):
In this type of RAM, data is retained as long as there is the power supply.
• Data is stored in flip flop like structure.
• It is Faster.
• Dissipates more power.
• The memory capacity of Static RAM is less.
• It can be used as Cache memory.
• No refreshing required.
• Circuit diagram od SRAM is given below.
CONTD…
Dynamic RAM (DRAM):
• In this type of RAM, data is stored on capacitors and requires a periodic refreshment.
• Dissipate less power.
• The memory capacity of Dynamic RAM is more.
• It can be used as Main memory.
•
CONTD…
CONTD…
Cache Memory Mapping:
• Direct mapped cache has each block mapped to exactly one cache memory location.
• Fully associative cache mapping is similar to direct mapping in structure but allows a memory
block to be mapped to any cache location rather than to a prespecified cache memory location
• Set associative cache mapping can be viewed as a compromise between direct mapping and
fully associative mapping in which each block is mapped to a subset of cache locations.
CACHE PERFORMANCE:
• When the processor needs to read or write a location in main memory, it first checks for a
corresponding entry in the cache.
• If the processor finds that the memory location is in the cache, a cache hit has occurred and data
is read from cache
• If the processor does not find the memory location in the cache, a cache miss has occurred.
• The performance of cache memory is frequently measured in terms of a quantity called Hit ratio.
• Hit ratio = hit / (hit + miss) = no. of hits/total accesses
• We can improve Cache performance using higher cache block size, higher associativity, reduce
miss rate, reduce miss penalty, and reduce the time to hit in the cache.
VIRTUAL MEMORY
• Virtual Memory is a storage scheme that provides user an illusion of having a very big main
memory.
• This is done by treating a part of secondary memory as the main memory.
• suppose, user load the bigger size processes than the available main memory with an illusion that
memory is available to load the process.
• Instead of loading one big process in the main memory, the Operating System loads the different
parts of more than one process in the main memory.
CONTD…
• whenever some pages needs to be loaded in the main memory for the execution and the memory
is not available for those many pages, then in that case, instead of stopping the pages from
entering in the main memory, the OS search for the RAM area that are least used in the recent
times to make the space for the new pages in the main memory.
• Since all this procedure happens automatically, therefore it makes the computer feel like it is
having the unlimited RAM.
• Demand Paging is a popular method of virtual memory management. In demand paging, the pages
of a process which are least used, get stored in the secondary memory.
• A page is copied to the main memory when its demand is made or page fault occurs. There are
various page replacement algorithms which are used to determine the pages which will be
replaced.
CONTD…
• Advantages of Virtual Memory
1. The degree of Multiprogramming will be increased.
2. User can run large application with less real RAM.
3.There is no need to buy more memory RAMs.
• Disadvantages of Paging
• Paging may encounter a problem called page break.
• When the number of pages in virtual memory is quite large, maintaining page table become hectic.
CONTD…
SECONDARY STORAGE
• Secondary memory is also termed external memory and refers to the various storage media on
which a computer can store data and programs.
• The Secondary storage media can be fixed or removable.
• Fixed Storage media is an internal storage medium like a hard disk that is fixed inside the
computer.
• A storage medium that is portable and can be taken outside the computer is termed removable
storage media.
CONTD…
Fixed Storage:
• Fixed storage devices are literally not fixed, obviously, these can be removed from the system for
repairing work, maintenance purposes, and also for an upgrade, etc
• Technically, almost all of the data i.e. being processed on a computer system is stored on some
type of a built-in fixed storage device.
• Types of fixed storage:
• Internal flash memory (rare)
• SSD (solid-state disk) units
• Hard disk drives (HDD)
CONTD…
Removable Storage:
• Removable storage is any type of storage device that can be removed/ejected from a computer system while the
system is running.
• In storage factors, the main benefit of removable disks is that they can provide the fast data transfer rates
associated with storage area networks (SANs)
Types of Removable Storage:
• Optical discs (CDs, DVDs, Blu-ray discs)
• Memory cards
• Floppy disks
• Magnetic tapes
• Disk packs
• Paper storage (punched tapes, punched cards)
RAID(REDUNDANT ARRAY OF INDEPENDENT DISKS)
• RAID is a setup consisting of multiple disks for data storage.
• They are linked together to prevent data loss and/or speed up performance.
• Having multiple disks allows the employment of various techniques like disk striping, disk
mirroring, and parity.
• RAID levels are grouped into the following categories:
• Standard RAID levels
• Non-standard RAID levels
• Nested/hybrid RAID levels
CONTD…
The following list explains the standard RAID levels (0, 1, 2, 3, 4, 5, 6)
RAID 0: Striping
• This process is called disk striping and involves splitting data into blocks and writing it simultaneously/sequentially on multiple disks.
• Therefore, RAID 0 is generally implemented to improve speed and efficiency.
• But Doesn't provide fault tolerance or redundancy.
CONTD…
RAID 1: Mirroring
• Unlike with RAID 0, where the focus is solely on speed and performance, the primary goal of RAID 1 is to provide
redundancy.
• But it s more expensive (needs twice as many drivers).
• It is suitable for smaller servers with only two disks, as well as if you are searching for a simple configuration you can
easily set up (even at home).
CONTD…
• RAID 5 is considered the most secure and most common RAID implementation.
• This RAID level consists of at least three hard drives.
• Data is divided into data strips and distributed across different disks in the array.
• 2. Crossbar Switch : A point is reached at which there is a separate path available for each memory
module, if the number of buses in common bus system is increased. Crossbar Switch (for
multiprocessors) provides separate path fro each module.
CONTD…
• 3. Multiport Memory : In Multiport Memory system, the control, switching & priority arbitration
logic are distributed throughout the crossbar switch matrix which is distributed at the interfaces
to the memory modules.