Docsity

Computer science Notes, Schemes and Mind Maps of Computer Science

Toggle sidebar
bg1
UNIVERSAL GATE
NAND:gate is a digital circuit
that has two or more inputs
and produces an output, which
is the inversion of logical AND
of all those inputs.
NAND
NOR gate is a digital circuit that
has two or more inputs and
produces an output, which is
the inversion of logical OR of
all those inputs.
NOR
A+B
Element of digital logic
Basic gates
NOT Gate:Perform logic function called inversion,the
purpose of inverter is to change one logic level into
its opposite level ,ie 0 to 1, 1 to 0. NOT
AND:To perform logical multiplicat-
ion more,commonly known as AND Y=A
function high.basic purpose is to
determine which certain conditons
OR:
are simultaniously true
Perform logical addition,mostAND
commonly known as OR function. A.B
can have no.of i/p>1.`
one i/p high=>the o/p will be high.
if a i/ps are low->o/p=low
basic purpose=if one ore more
i/pd are high and to produce high
p/p
Y=(A.B)
Y=A+B)
Special Gates
Ex-OR gate:The full form of
Ex-OR gate is Exclusive-OR gate.
Its function is same as that of
OR gate except for some cases,
when the inputs having evenn
umber of ones.
XOR
XNOR
EX-NOR: gateThe full form
of Ex-NOR gate is Exclusive-
NOR gate. Its function is
sameas that of NOR gate
except for some cases,
when the inputs having even
number of ones.
Combinational Logic circuit:they are m/m less logic circu
it who produce an o/p only based on the currently given
i/p.they are made up of basic logic complicated switchin
g circuits. A
B
C
X
Y
multiple i/p
one or more o/p
there are different types of logic circuit used to perform
arithmetic & logical functions and they are
adders and subtractors
1.Adder:adder circuits are used to perform basic arithm
etic addition purpos.2 types-Half adder&Full adder
HALF ADDER used to perform binary addition by a
logic circuit.it accepts 2 binary digits as i/p and produces
a binary digit as o/p,sumbity carrybit
i/p s sum
carryo/p s
P Q sum Carry
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 0
FULL ADDER
Accepts i/ps and genarate sum o/p & carry o/p.basice
difference b/w half and full adder is in full add,it
accepts and additional i/p that allows for handling i/p
carry P Q CI SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
SUM
CARRY
Substractor
Half substractor: Most Essential combinational logic
circuit which is used in digital electronics.uses binary
no.s for subtract.circuit can be build with 2 logic gate
namely NAND & XOR *UsES:#uses to reduce the force of
audio/radio signal.Used in ALU section of the processor.
can be used in amplifiers to reduce the sound distortion
diff
Borrow
i/p o/p
A B diff borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Full subtractors:-Performs subtraction of 2 bit taking
info account borrow of the prvious adjucent lower
minu end.contain 3 i/ps& 2 o/ps.3 ii/ps A,B,Bin denots,
minu end,subrand&previous borrow
Bout
Ripple Carry adder (inorder to add 'n'bit binaryno's):
Also know as n bit parallel adders.Used for the purpose
of aading 2'n' bit binary no,s and it requires 'n' full
adders in the circuit. .4 bit ripple carry adder=>
S0
S1
S2
S3
Bo
B1
B2
B3 Ao
A1
A2
A3
cout Cin
*Carry out of each full adder is the cary in to the
succeeding next most significant full adder.it is called
ripple carry adder becous each carry bit gets rippled
into the next stage.
Multiplexers[multiple i/p,but
signle o/p]:it is a device that allow
digital information from several sources
to be routed on to a single line for
transmission over that line to a
common destination.
So
S1
Do
D1
D2
D3
Data i/p
MUX
O/p
De-Multiplexers[single i/p,but multiple o/p]:Opposit of
Multiplexers*has single i/p 'n' select lines&maxm of
second o/ps*if there are 'n' selection lines,there will be
seocond possible combinations of Os&1s so each
combination can select only one o/p.it is also
called d-MUX.
Decoders:Basice function of decoder is to detect the
presence of a specific combination of bits on its i/ps
and to indicat that presence by a specified o/p level.
contains 'n' i/p lines and second o/p lines
DEcoder
E
ni/p
lines second
o/p lines Second
O/p
n
o/p
Encoder
Q
Carry Look Ahead adder=>Ripple carry adder carry
propagation time is the major limit*inorder to reduce
the propagation time,one widely used approach is
carry look ahead adder*in ths ,the cary signal is calcula
ted in advance based on the i/p signal.fact that a carry
signal will be genarated in 2 cases.
1.when both bits Ai&Bi are one.
2.when one of the 2 bits is one&the carry in is s
BCD 7 segment decoder
in binary coded decimal(BCD) encoding scheme each
of the decimal no:s (0-9) is represented by its
equivalent binary pattern. Seven segment display is a
electronic device which consists of 7 led s arranged in
some definte pattern. Bcd to 7 segmnet decoder has
4 input lines (A, B, C, D) and seven segment led displays
which displays the decimal number depending up on
inputs
Fig
DMA&DMA CONTROLLER
Direct memmory acces is a method
that allows an i/o device to send or
recieve data directly to orfrom the
main memmory, by passing the
cpu to speed up memmory
operations. The process is managed
by a chip called dma controller.It is
feature of computer system
memorys to acess main system
memmory main memmory(ram), .
DMA in computer
architecture
DISADVANTAGES OF DMA*Dma transfer requires a dma
controller to carry out the operations hence cost of the
system memory increase *) cache coherence problems
truth table
A B C D a b c d e f g
0 0 0 0 1 1 1 1 1 1 0
0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 0 1 1 0 1
0 0 1 1 1 1 1 1 0 0 1
0 1 0 0 0 1 1 0 0 1 1
0 1 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 1 1 1 1 1
0 1 1 1 1 1 1 0 0 0 0
1 0 0 0 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 0 1 1
independent of cpu simply, dma is means of having a
peripharal device control a processors main memory
bus dirctly*) i/o device are connected to system
memmory bus via a special interface circiut known as
"dma controller".dma controller temporarly borrows
the address bus, data bus and cntrl bus from
microprocesseer and transfer the data bytes directly
between and i/o part and series of main memory
locationsAdvantages of DMA*) it allows to peripharal
device to read from or write tomain memory
withoutgoing through the cpu.*) itallows for faster
proccesing since the proceser can be working on
something else while the peripharal can be populating
main memory
VIRTUAL MEMORY:It is a m/m management
scheme that allows execution of partially loaded
programs.
As a conseequence,it is possible for a pgrm to be larger
than the available main m/m.
Virtual m/m may be described as a hierarchy of a m/m
s/ms. One of them is low cost,large capacity, low speed
s/s(eg:disk storage),other is a high cost ,low capacity,
high speed s/m(main m/m). the 2 m/m s/m s/ms are
managed by the os in such a way that it appears to a
user like a single,large,directly addressable and fast
main m/m. various m/m schemes are available for
implementing the virtual m/m. one of them is demand
paging.in demand paging, primary m/m is conceptually
divided into fixed size contigous areas called page
frames and all the user programs residing in the
secondarymemory are divided into pieces of the same
size called pages.
in this pages are brought from secondary m/m to
primary m/m only when
demanded.ADVANTAGES:only a part of the program
needs, to be in m/m execution. so,more programs can
run simultaneouslyat the same time interval.*it can
increase cpu utilization for overall power ofa s/m.*in
this,large programs can be run with real less primary m/
m.DISADVANTAGES:*when a s/m uses virtual m/m,
the application may run very slowly so cpu takes more
time to switch between the applcation.
Registers
Registers is avery fast computer m/m,used to store
data/instruction.A register is a group of flipflop with
each flipflop capable of storing one bit of information
.An 'n' bit register has a group of 'n' fliflop & is capable
of storing binary information of n bits.
a)-General purpose processing register -used to stor
initial data intermediate and also final results.used to
store data taken out from the memory.
b)-It points to the next instruction to be executed-it
goes through a step by step procedure and cause the
computer to read & execute succesive instruction
previously stored in the memory
c)m/m buffer register[MBR]-stores instruction of data
received from the memory and sent from the memory.
d)-holds the address for memory unit.-loaded from the
pc register when an instructn is read from the memory.
e)instruction register[IR]-holds the instruction to be
executed.-as the instruction is stord in IR,the operation
part & the address part are seperated
Asynchronous Parallel data transfer
In asynchronious data transfer,an extra bit is added to
each byte sp,that the receiver is alert about the arrival
of new data,usually 0 is a start bit & 1 is the stop bit
*problem in asychrinous:it is not sure that the data on
the data bus is fresh or not as their no time slot for
sending or receiving data this is solved by 2 mechanism
a)slrobe control
*1st source puts data
on the data bus and
on the slrobe signal
Serial:-* require a single line to communicate & transfer
data*Used for long distance communication*error and
noise are least* slowerParallel:-*Require multiple line,
*Used for shorter distance *Is high * Faster
Difference b/w serial and parallel data type
Addressing Modes
The addressing mode specify a rule for interpreting or
modify the address field on the instruction before the
operand is actually referenced .simply it is the method
to specify the operand of an instruction
*also known asfetch_decode_execute cycle
*basic operation process of a computer
TYPES OF ADDRESSING MODES
1.implied addressing:operands are specified implicitely
in the defenition of the instruction. there will be only a
single operand. wg:compliment accumulator[CMA]
2.immediate addresing:operand value is specified in the
instruction itself ie, the actual data to be used as the
operand is included in the instrctn itself.
3.direct addresing:the address field contains the
effective address of the operand.ie..address of the
operand is specified in the instruction.
4.indirect addressing:The address field of the instruction
gives the address where the effective address is stored.
5.register addressing:it indicates the operand data is
stored in the register itself, so the instruction contains
the address of the register.
It is baically a gated S-R flipflop with the additn of the
clock i/p. when both i/p S&R are equal to 1, then tha
invalid condtm will take place. to prevent
this a clock circuit is introduced.JK ff has 4 possible i/p
combinatn they are 1,0 no chance & toggle.
truthtable
J k Q Q(bar)re-mark
1 0 1 0 set
0 1 0 1 reset
1 1 1 0 toggle
1 1 0 1 reset
1 1 1 0 set
*when both J&K are 1,at the same time clock pulse is
high, the circuit toggle from its set state to reset state
& vice versa.JK has a drawback of timing prblm known
as race. the condtn of race arises if the o/p changes its
state before the timing pulse of the clock i/p going of
state.
it eliminates all the timing problems b using 2 SR ffs
connected together in a series configuration with the
slave having an invertd clock pulse. the outputs from to
from the"slave" ff are febback to the inputs of "master"
with the o/p of the "master"ff
beigmg connected to the 2 inputs of the slave ff.
MASTER-SLAVE JK FLIPFLOP
INSTRUCTION CYCLE:
steps:1.fetch the instruction:instruction fetched from
m/m address that is stored inpc and stored in
instantIR 2.decode the instruction:instruction in the
IR is executed by the decoder.3.read the effective
address:if the instruction has an indirect address the
effective address is read from m/m.otherwise
operands are directly directly rad in case of
immediate operand.
4.executable instruction:control unit passes the info
inform of controll signals to the functionalint of CPU.
the result generated is stored in main m/mor sent to
an o/p device.
STATIC &DYNAMIC RAM
static
*uses transfer to store a single bit of data
* does not need periodic refreshment to maintain data.
* its structure is complex
*expensive compared to dynamic
dynamic
*uses a seperate capacitor to store each bit of data.
*needs periodic refreshment
*simple structure
* less expensive
Increasing order of
access time Ratio
Von neumann architecture
Memory Mapping
:The transformation of data fron main m/m to cache
m/m is called Mapping 3 type of mapping
*associative*direct*Set Asscociative
#Associative Mapping:Associativem/m store both
address&data.the word is bits are used to identiy which
word in the block is needed,but the tag becomes all of
the remaining bits,this enables the placemenr if ant
word at any place in the cashe m/m*mosr fastest &
most Flexible Mapping form.
Direct Mapping
*Simplest Technigue*Maps each block of m/m into only
one possible line*Direct mapping's performance is
directly Propotional to hit ratio
Set-Associative Mapping
*the disadvantages of direct mapping is that words with
same index address can't reside in cache m/m at the
same *this problem can be overcome by
set -Associarive mapping *in this we can store 2 or more
words of m/m under the same index address
INPUT-OUT PUT interfaces
Provides a methed for transfering info b/w internal
and external i/o devices*Typical i/o interface b/w
processor and several perpherals are shwn below
A decoder is a multi i/p,multi o/p logic circuit which
decodes 'n' i/ps into second possible o/p
Encoder:Combinational logic circuit that converts
binary information in the form of a seconf i/p lines
into n o/p lines
Memory hierarchy
Cache Memory
* it is an extremely fast memory type that acts as
a buffer b/w RAM and the CPU. it holds frequently
requested data and instructions so that they are
immediately available for the cpu when needed.
* cache memory is used to reduce the avg time to
access data from the main memory
JK FLIPFLOP
flipflops is a basic building block of sequential logic
circuit.Its is a circuit that has 2 stable states and can
store one bit of state info. it is same as SRFF
with sit and rest i/p.The diff. is that JK doesn't have
the invalid i/p stae of the S-R latch.
[when S=R=1]
*Destination on seeing the on signal of strop,read data
from the data bus*after reading data from the bus
destination strobe gets OFF signal can be seen as:
Problems in strobe are:*the destination has read the
data from the data bus but there is no surety,this
problem is overcome by,2-Handshaking Mechanism
*Source initiated Handshaking-when source initiate the
data transfer process.it conisist of signals.
DATA VALID:it on tells data on the data bus is valid
otherwise invalid.
DATA ACCEPTED:it oN tellls data is accepted otherwise
not accepted
1.Source places data on the data bus & enable data
valid signal 2.Destination accepts data from the bus&
enbale data accepted signal
3.after this,disable data valid signal means data on data
bus is invalid now.4.disable data accepted signal&the
process ends
COUNTERS
Ring counter:It is a typical application of shift register
ring counter is almost same as the shift counter.The
only change is that the o/p of the last flipflop is
connected to the input of the first flipflop is connected
to the input of the first flipflop in case of ring.
*johnson counter:modified ring counter where the
inverted o/p from the last flipflop is connected to the i/
p to the next.advantage:counter is that it only need half
the number of flipflop compared to ring counter.
Edgetriggering:
In edge triggering the circuit becomes active at
negative or positive edge of the clock signal.
Pulse triggering:
pulse-triggered means that data are entered into the
flip-flop on the rising edge of the clock pulse, but the
output does not reflect the input state until the falling
edge of the clock pulse
Handshaking is a I/O control method to synchronize
I/O devices with the microprocessor. As many I/O
devices accepts or release information at a much
slower rate than the microprocessor, this method is
used to control the microprocessor to work with a I/O
device at the I/O devices data transfer rate.
I/O Bus is the pathway used for input and output
devices to communicate with the computer processor.
the I/O Bus is the route used for peripheral devices to
intract with the computer processor. the I/O Bus
includes data lines, address lines and control lines.
MAJOR DIFFERENCES:.Data codes and formats in the
peripherals differ from the word format in the CPU
and memory.The data transfer rate of peripherals is
usually slower than the transfer rate of cpu andcoseq
uently a sychronisation mechanism may be needed
STACK ORGANISATION.
Stack is storage struct stroes the info in such a way the
item stored is the first item retreived
.Based on LIFO
.Stack operation :
Push:insert item on the top of stack pop:delete an item
from top of stack
Implementation of stack
2 ways:1.Register stack 2.Memory
Addressing Modes:
The addressing mode specify a rule for interpreting or
modify the address field on the instruction before the
operand is actually referenced .simply it is the method
to specify the operand of an instruction
Immediate Mode:
In this mode, the operand is specified in the instruction
itself. An immediate mode instruction has an operand
field rather than the address field.
exp: ADD 7, which say Add 7 to contents of
accumulator. 7 is the operand here.
Register Mode:
In this mode the operand is stored in the register and
this register is present in CPU. The instruction has the
address of the Register where the operand is stored.
Advantages:
• Shorter instructions and faster instruction fetch.
• Faster memory access to the operand(s)
Disadvantages:
• Very limited address space
• Using multiple registers helps performance but it
complicates the instructions.
Register Indirect Mode:
In this mode, the instruction specifies the register
whose contents give us the address of operand which is
in memory. Thus, the register contains the address of
operand rather than the operand itself.
Auto Increment/Decrement Mode:
In this the register is incremented or decremented after
or before its value is used.
Direct Addressing Mode:
In this mode, effective address of operand is present in
instruction itself.
• Single memory reference to access data.
• No additional calculations to find the effective
address of the operand.
exp: ADD R1, 4000 - In this the 4000 is effective address
of operand.
Indirect Addressing Mode:
In this, the address field of instruction gives the address
where the effective address is stored in memory. This
slows down the execution, as this includes multiple
memory lookups to find the operand.
Displacement Addressing Mode:
In this the contents of the indexed register is added to
the Address part of the instruction, to obtain the
effective address of operand.
EA = A + (R), In this the address field holds two values,
A(which is the base value) and R(that holds the
displacement), or vice versa.
Relative Addressing Mode:
It is a version of Displacement addressing mode.
In this the contents of PC(Program Counter) is added to
address part of instruction to obtain the effective
address.
EA = A + (PC), where EA is effective address and PC is
program counter.
The operand is A cells away from the current cell(the
one pointed to by PC)
Base Register Addressing Mode:
It is again a version of Displacement addressing mode.
This can be defined as EA = A + (R), where A is
displacement and R holds pointer to base address.
Stack Addressing Mode:
In this mode, operand is at the top of the stack. For
example: ADD, this instruction will POP top two items
from the stack, add them, and will then PUSH the result
to the top of the stack.
SR Flip Flop:
An SR Flip Flop (also referred to as an SR Latch) is the
most simple type of flip flop. It has two inputs S and R
and two outputs Q and Q’ . The state of this latch is
determined by the condition of Q. If Q is 1 the latch is
said to be SET and if Q is 0 the latch is said to be RESET.
This SR Latch or Flip flop can be designed either by two
cross-coupled NAND gates or two-cross coupled NOR
gates.
Johnson Ring Counter:A Johnson counter is a
modifed ring counter, where the inverted output from
the last fipflop is connected to the input to the first.
The register cycles through a sequence of bit
patterns.The MOD of the Johnson counter is 2n if n
fipflops are used.
Advantage of the Johnson counter is that it only
needs half the number of fipflops compared to the
standard ring counter for the same MODIt can be
implemented using D-type fipflops
Cach hit: if the processor finds that the memory
location is in the cache, a cache hit has occurred and
data is read from cache
Cache miss: if the processor does not find the
memory location in the cache, a cache miss has
occurred. for cache miss, the cache allocates a new
entry and copies in data from main memory, then the
request is fulfilled from the contents of the cache.
Hit Ratio: The performance of cache memory is
frequently measured in terms of a quantity called His
Ratio.
* Hit ratio = hit/(hit+miss)=no:of hits/total accesses.
Accumulator is a type of register for short-term,
intermediate storage of arithmetic and logic data in a
computers CPU.
Interrupt is a signal emitted by a device attached to
a computer or from a program within the computer.
it requires the operating system(OS) to stop and
figure out what to do next. an interrupt temporary
stopes or terminates a service or a current process.
Most I/O devices have a bus control line called
Interrupt Service Routine(ISR) for this purpose.
pf2

Partial preview of the text

Download Computer science Notes and more Schemes and Mind Maps Computer Science in PDF only on Docsity!

UNIVERSAL GATE

NAND :gate is a digital circuit that has two or more inputs and produces an output, which is the inversion of logical AND of all those inputs.

NAND

NOR gate is a digital circuit that has two or more inputs and produces an output, which is the inversion of logical OR of all those inputs.

NOR

A+B

Element of digital logic

Basic gates NOT Gate :Perform logic function called inversion,the purpose of inverter is to change one logic level into its opposite level ,ie 0 to 1, 1 to 0. (^) NOT AND :To perform logical multiplicat- ion more,commonly known as AND (^) Y=A function high.basic purpose is to determine which certain conditons

OR:

are simultaniously true commonly known as OR function.Perform logical addition,most AND can have no.of i/p>1.` A.B one i/p high=>the o/p will be high. if a i/ps are low->o/p=low basic purpose=if one ore more i/pd are high and to produce high p/p

Y=(A.B)

Y=A+B)

Special Gates Ex-OR gate:The full form of Ex-OR gate is Exclusive-OR gate. Its function is same as that of OR gate except for some cases, when the inputs having evenn umber of ones.

XOR

XNOR

EX-NOR: gateThe full form of Ex-NOR gate is Exclusive- NOR gate. Its function is sameas that of NOR gate except for some cases, when the inputs having even number of ones. Combinational Logic circuit :they are m/m less logic circu it who produce an o/p only based on the currently given i/p.they are made up of basic logic complicated switchin g circuits. (^) A B C

X

multiple i/p (^) Y one or more o/p

there are different types of logic circuit used to perform arithmetic & logical functions and they are adders and subtractors 1.Adder:adder circuits are used to perform basic arithm etic addition purpos.2 types-Half adder&Full adder

HALF ADDER used to perform binary addition by a

logic circuit.it accepts 2 binary digits as i/p and produces a binary digit as o/p,sumbity carrybit

i/p s

sum carry

o/p s

P Q sum Carry 0 0 0 0 1 0 1 0 0 1 1 0

FULL ADDER 1 1 0 0

Accepts i/ps and genarate sum o/p & carry o/p.basice difference b/w half and full adder is in full add,it accepts and additional i/p that allows for handling i/p carry (^) P Q CI SUM CARRY 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1

SUM

CARRY

Substractor

Half substractor : Most Essential combinational logic circuit which is used in digital electronics.uses binary no.s for subtract.circuit can be build with 2 logic gate namely NAND & XOR * UsES :#uses to reduce the force of audio/radio signal.Used in ALU section of the processor. can be used in amplifiers to reduce the sound distortion

diff

Borrow

i/p o/p A B diff borrow 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 Full subtractors :-Performs subtraction of 2 bit taking info account borrow of the prvious adjucent lower minu end.contain 3 i/ps& 2 o/ps.3 ii/ps A,B,Bin denots, minu end,subrand&previous borrow

Bout

Ripple Carry adder (inorder to add 'n'bit binaryno's):

Also know as n bit parallel adders.Used for the purpose of aading 2'n' bit binary no,s and it requires 'n' full adders in the circuit. .4 bit ripple carry adder=>

S1^ S

S3 S

B1 Bo B3 B A1 Ao A3 A

cout Cin

*Carry out of each full adder is the cary in to the succeeding next most significant full adder.it is called ripple carry adder becous each carry bit gets rippled into the next stage.

Multiplexers [multiple i/p,but

signle o/p]:it is a device that allow digital information from several sources to be routed on to a single line for transmission over that line to a common destination.

So S

Do D D D

Data i/p

MUX

O/p

De-Multiplexers [single i/p,but multiple o/p]:Opposit of Multiplexershas single i/p 'n' select lines&maxm of second o/psif there are 'n' selection lines,there will be seocond possible combinations of Os&1s so each combination can select only one o/p.it is also called d-MUX.

Decoders :Basice function of decoder is to detect the

presence of a specific combination of bits on its i/ps and to indicat that presence by a specified o/p level. contains 'n' i/p lines and second o/p lines

DEcoder

E

ni/p lines second

o/p lines Second O/p

n Encoder o/p

Q

Carry Look Ahead adder =>Ripple carry adder carry

propagation time is the major limitinorder to reduce the propagation time,one widely used approach is carry look ahead adderin ths ,the cary signal is calcula ted in advance based on the i/p signal.fact that a carry signal will be genarated in 2 cases. 1.when both bits Ai&Bi are one. 2.when one of the 2 bits is one&the carry in is s

BCD 7 segment decoder

in binary coded decimal(BCD) encoding scheme each of the decimal no:s (0-9) is represented by its equivalent binary pattern. Seven segment display is a electronic device which consists of 7 led s arranged in some definte pattern. Bcd to 7 segmnet decoder has 4 input lines (A, B, C, D) and seven segment led displays which displays the decimal number depending up on inputs Fig

DMA&DMA CONTROLLER

Direct memmory acces is a method that allows an i/o device to send or recieve data directly to orfrom the main memmory, by passing the cpu to speed up memmory operations. The process is managed by a chip called dma controller.It is feature of computer system memorys to acess main system memmory main memmory(ram),.

DMA in computer

architecture

DISADVANTAGES OF DMA* Dma transfer requires a dma controller to carry out the operations hence cost of the system memory increase *) cache coherence problems

truth table A B C D a b c d e f g 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 independent of cpu simply, dma is means of having a peripharal device control a processors main memory bus dirctly) i/o device are connected to system memmory bus via a special interface circiut known as "dma controller".dma controller temporarly borrows the address bus, data bus and cntrl bus from microprocesseer and transfer the data bytes directly between and i/o part and series of main memory locations Advantages of DMA) it allows to peripharal device to read from or write tomain memory withoutgoing through the cpu.*) itallows for faster proccesing since the proceser can be working on something else while the peripharal can be populating main memory

VIRTUAL MEMORY :It is a m/m management

scheme that allows execution of partially loaded programs. As a conseequence,it is possible for a pgrm to be larger than the available main m/m. Virtual m/m may be described as a hierarchy of a m/m s/ms. One of them is low cost,large capacity, low speed s/s(eg:disk storage),other is a high cost ,low capacity, high speed s/m(main m/m). the 2 m/m s/m s/ms are managed by the os in such a way that it appears to a user like a single,large,directly addressable and fast main m/m. various m/m schemes are available for implementing the virtual m/m. one of them is demand paging.in demand paging, primary m/m is conceptually divided into fixed size contigous areas called page frames and all the user programs residing in the secondarymemory are divided into pieces of the same size called pages. in this pages are brought from secondary m/m to primary m/m only when

demanded. ADVANTAGES: only a part of the program

needs, to be in m/m execution. so,more programs can run simultaneouslyat the same time interval.it can increase cpu utilization for overall power ofa s/m.in this,large programs can be run with real less primary m/

m. DISADVANTAGES: *when a s/m uses virtual m/m,

the application may run very slowly so cpu takes more time to switch between the applcation.

Registers

Registers is avery fast computer m/m,used to store data/instruction.A register is a group of flipflop with each flipflop capable of storing one bit of information .An 'n' bit register has a group of 'n' fliflop & is capable of storing binary information of n bits.

a)-General purpose processing register -used to stor

initial data intermediate and also final results.used to store data taken out from the memory.

b) -It points to the next instruction to be executed-it

goes through a step by step procedure and cause the computer to read & execute succesive instruction previously stored in the memory c)m/m buffer register[MBR] -stores instruction of data received from the memory and sent from the memory.

d) -holds the address for memory unit.-loaded from the

pc register when an instructn is read from the memory.

e)instruction register[IR]- holds the instruction to be

executed.-as the instruction is stord in IR,the operation part & the address part are seperated

Asynchronous Parallel data transfer

In asynchronious data transfer,an extra bit is added to each byte sp,that the receiver is alert about the arrival of new data,usually 0 is a start bit & 1 is the stop bit *problem in asychrinous:it is not sure that the data on the data bus is fresh or not as their no time slot for sending or receiving data this is solved by 2 mechanism a)slrobe control *1st source puts data on the data bus and on the slrobe signal

Serial:- * require a single line to communicate & transfer dataUsed for long distance communicationerror and noise are least* slower Parallel: -*Require multiple line, *Used for shorter distance *Is high * Faster

Difference b/w serial and parallel data type

Addressing Modes

The addressing mode specify a rule for interpreting or modify the address field on the instruction before the operand is actually referenced .simply it is the method to specify the operand of an instruction

*also known asfetch_decode_execute cycle *basic operation process of a computer

TYPES OF ADDRESSING MODES

1.implied addressing:operands are specified implicitely in the defenition of the instruction. there will be only a single operand. wg:compliment accumulator[CMA] 2.immediate addresing:operand value is specified in the instruction itself ie, the actual data to be used as the operand is included in the instrctn itself. 3.direct addresing:the address field contains the effective address of the operand.ie..address of the operand is specified in the instruction. 4.indirect addressing:The address field of the instruction gives the address where the effective address is stored. 5.register addressing:it indicates the operand data is stored in the register itself, so the instruction contains the address of the register.

It is baically a gated S-R flipflop with the additn of the clock i/p. when both i/p S&R are equal to 1, then tha invalid condtm will take place. to prevent this a clock circuit is introduced.JK ff has 4 possible i/p combinatn they are 1,0 no chance & toggle. truthtable J k Q Q(bar)re-mark 1 0 1 0 set 0 1 0 1 reset 1 1 1 0 toggle 1 1 0 1 reset 1 1 1 0 set *when both J&K are 1,at the same time clock pulse is high, the circuit toggle from its set state to reset state & vice versa.JK has a drawback of timing prblm known as race. the condtn of race arises if the o/p changes its state before the timing pulse of the clock i/p going of state.

it eliminates all the timing problems b using 2 SR ffs connected together in a series configuration with the slave having an invertd clock pulse. the outputs from to from the"slave" ff are febback to the inputs of "master" with the o/p of the "master"ff beigmg connected to the 2 inputs of the slave ff.

MASTER-SLAVE JK FLIPFLOP

INSTRUCTION CYCLE:

steps:1.fetch the instruction:instruction fetched from

m/m address that is stored inpc and stored in

instantIR 2.decode the instruction:instruction in the

IR is executed by the decoder.3.read the effective

address:if the instruction has an indirect address the

effective address is read from m/m.otherwise

operands are directly directly rad in case of

immediate operand.

4.executable instruction:control unit passes the info

inform of controll signals to the functionalint of CPU.

the result generated is stored in main m/mor sent to

an o/p device.

STATIC &DYNAMIC RAM

static

*uses transfer to store a single bit of data

  • does not need periodic refreshment to maintain data.
  • its structure is complex *expensive compared to dynamic

dynamic

*uses a seperate capacitor to store each bit of data. *needs periodic refreshment *simple structure

  • less expensive

Increasing order of access time Ratio

Von neumann architecture

Memory Mapping

:The transformation of data fron main m/m to cache m/m is called Mapping 3 type of mapping associativedirectSet Asscociative #Associative Mapping:Associativem/m store both address&data.the word is bits are used to identiy which word in the block is needed,but the tag becomes all of the remaining bits,this enables the placemenr if ant word at any place in the cashe m/mmosr fastest & most Flexible Mapping form.

Direct Mapping

Simplest TechnigueMaps each block of m/m into only one possible line*Direct mapping's performance is directly Propotional to hit ratio

Set-Associative Mapping

*the disadvantages of direct mapping is that words with same index address can't reside in cache m/m at the same *this problem can be overcome by set -Associarive mapping *in this we can store 2 or more words of m/m under the same index address

INPUT-OUT PUT interfaces

Provides a methed for transfering info b/w internal and external i/o devices*Typical i/o interface b/w processor and several perpherals are shwn below

A decoder is a multi i/p,multi o/p logic circuit which

decodes 'n' i/ps into second possible o/p

Encoder: Combinational logic circuit that converts

binary information in the form of a seconf i/p lines into n o/p lines

Memory hierarchy

Cache Memory

  • it is an extremely fast memory type that acts as a buffer b/w RAM and the CPU. it holds frequently requested data and instructions so that they are immediately available for the cpu when needed.
  • cache memory is used to reduce the avg time to access data from the main memory

JK FLIPFLOP

flipflops is a basic building block of sequential logic circuit.Its is a circuit that has 2 stable states and can store one bit of state info. it is same as SRFF with sit and rest i/p.The diff. is that JK doesn't have the invalid i/p stae of the S-R latch. [when S=R=1]

Destination on seeing the on signal of strop,read data from the data busafter reading data from the bus destination strobe gets OFF signal can be seen as: Problems in strobe are:*the destination has read the data from the data bus but there is no surety,this problem is overcome by,2-Handshaking Mechanism *Source initiated Handshaking-when source initiate the data transfer process.it conisist of signals. DATA VALID:it on tells data on the data bus is valid otherwise invalid. DATA ACCEPTED:it oN tellls data is accepted otherwise not accepted 1.Source places data on the data bus & enable data valid signal 2.Destination accepts data from the bus& enbale data accepted signal 3.after this,disable data valid signal means data on data bus is invalid now.4.disable data accepted signal&the process ends

COUNTERS

Ring counter:It is a typical application of shift register ring counter is almost same as the shift counter.The only change is that the o/p of the last flipflop is connected to the input of the first flipflop is connected to the input of the first flipflop in case of ring. *johnson counter:modified ring counter where the inverted o/p from the last flipflop is connected to the i/ p to the next.advantage:counter is that it only need half the number of flipflop compared to ring counter.

Edgetriggering:

In edge triggering the circuit becomes active at negative or positive edge of the clock signal.

Pulse triggering:

pulse-triggered means that data are entered into the flip-flop on the rising edge of the clock pulse, but the output does not reflect the input state until the falling edge of the clock pulse

Handshaking is a I/O control method to synchronize

I/O devices with the microprocessor. As many I/O devices accepts or release information at a much slower rate than the microprocessor, this method is used to control the microprocessor to work with a I/O device at the I/O devices data transfer rate.

I/O Bus is the pathway used for input and output

devices to communicate with the computer processor. the I/O Bus is the route used for peripheral devices to intract with the computer processor. the I/O Bus includes data lines, address lines and control lines.

MAJOR DIFFERENCES :.Data codes and formats in the peripherals differ from the word format in the CPU and memory.The data transfer rate of peripherals is usually slower than the transfer rate of cpu andcoseq uently a sychronisation mechanism may be needed

STACK ORGANISATION.

Stack is storage struct stroes the info in such a way the item stored is the first item retreived .Based on LIFO .Stack operation : Push:insert item on the top of stack pop:delete an item

from top of stack

Implementation of stack

2 ways:1.Register stack 2.Memory

Addressing Modes:

The addressing mode specify a rule for interpreting or modify the address field on the instruction before the operand is actually referenced .simply it is the method to specify the operand of an instruction Immediate Mode: In this mode, the operand is specified in the instruction itself. An immediate mode instruction has an operand field rather than the address field. exp: ADD 7, which say Add 7 to contents of accumulator. 7 is the operand here. Register Mode: In this mode the operand is stored in the register and this register is present in CPU. The instruction has the address of the Register where the operand is stored. Advantages:

  • Shorter instructions and faster instruction fetch.
  • Faster memory access to the operand(s) Disadvantages:
  • Very limited address space
  • Using multiple registers helps performance but it complicates the instructions. Register Indirect Mode: In this mode, the instruction specifies the register whose contents give us the address of operand which is in memory. Thus, the register contains the address of operand rather than the operand itself. Auto Increment/Decrement Mode: In this the register is incremented or decremented after or before its value is used. Direct Addressing Mode: In this mode, effective address of operand is present in instruction itself.
  • Single memory reference to access data.
  • No additional calculations to find the effective address of the operand. exp: ADD R1, 4000 - In this the 4000 is effective address of operand. Indirect Addressing Mode: In this, the address field of instruction gives the address where the effective address is stored in memory. This slows down the execution, as this includes multiple memory lookups to find the operand. Displacement Addressing Mode: In this the contents of the indexed register is added to the Address part of the instruction, to obtain the effective address of operand. EA = A + (R), In this the address field holds two values, A(which is the base value) and R(that holds the displacement), or vice versa. Relative Addressing Mode: It is a version of Displacement addressing mode. In this the contents of PC(Program Counter) is added to address part of instruction to obtain the effective address. EA = A + (PC), where EA is effective address and PC is program counter. The operand is A cells away from the current cell(the one pointed to by PC) Base Register Addressing Mode: It is again a version of Displacement addressing mode. This can be defined as EA = A + (R), where A is displacement and R holds pointer to base address. Stack Addressing Mode: In this mode, operand is at the top of the stack. For example: ADD, this instruction will POP top two items from the stack, add them, and will then PUSH the result to the top of the stack.

SR Flip Flop:

An SR Flip Flop (also referred to as an SR Latch) is the most simple type of flip flop. It has two inputs S and R and two outputs Q and Q’. The state of this latch is determined by the condition of Q. If Q is 1 the latch is said to be SET and if Q is 0 the latch is said to be RESET. This SR Latch or Flip flop can be designed either by two cross-coupled NAND gates or two-cross coupled NOR gates.

Johnson Ring Counter: A Johnson counter is a

modifed ring counter, where the inverted output from the last fipflop is connected to the input to the first. The register cycles through a sequence of bit patterns.The MOD of the Johnson counter is 2n if n fipflops are used.

Advantage of the Johnson counter is that it only

needs half the number of fipflops compared to the standard ring counter for the same MODIt can be implemented using D-type fipflops

Cach hit: if the processor finds that the memory

location is in the cache, a cache hit has occurred and data is read from cache

Cache miss: if the processor does not find the

memory location in the cache, a cache miss has occurred. for cache miss, the cache allocates a new entry and copies in data from main memory, then the request is fulfilled from the contents of the cache.

Hit Ratio: The performance of cache memory is

frequently measured in terms of a quantity called His Ratio.

  • Hit ratio = hit/(hit+miss)=no:of hits/total accesses.

Accumulator is a type of register for short-term,

intermediate storage of arithmetic and logic data in a computers CPU.

Interrupt is a signal emitted by a device attached to

a computer or from a program within the computer. it requires the operating system(OS) to stop and figure out what to do next. an interrupt temporary stopes or terminates a service or a current process. Most I/O devices have a bus control line called Interrupt Service Routine(ISR) for this purpose.