DFA Unit 1 To 4 Notes
DFA Unit 1 To 4 Notes
SCIENCE
UNIT I:
Number System and Binary Codes: Decimal, Binary, Octal, Hexadecimal – Binary addition,
Multiplication, Division – Floating point representation, Complements, BCD, Excess3, Gray Code.
Arithmetic Circuits: Half adder, Full adder, Parallel binary adder, BCD adder, Half subtractor, Full
subtractor, Parallel binary subtractor - Digital Logic: the Basic Gates – NOR, NAND, XOR Gates.
UNIT II:
Combinational Logic Circuits: Boolean algebra – Karnaugh map – Canonical form 1 – Construction and
properties – Implicants – Don‘t care combinations - Product of sum, Sum of products, simplifications.
Sequential circuits: Flip-Flops: RS, D, JK, and T - Multiplexers – Demultiplexers – Decoder Encoder –
shift registers-Counters.
UNIT III:
Input – Output Organization: Input – output interface – I/O Bus and Interface – I/O Bus Versus Memory
Bus – Isolated Versus Memory – Mapped I/O – Example of I/O Interface. Asynchronous data transfer:
Strobe Control and Handshaking
Priority Interrupt: Daisy- Chaining Priority, Parallel Priority Interrupt. Direct Memory Access: DMA
Controller, DMA Transfer. Input – Output Processor: CPU-IOP Communication.
UNIT IV: Memory Organization: Memory Hierarchy – Main Memory- Associative memory: Hardware
Organization, Match Logic, Read Operation, Write Operation. Cache Memory: Associative, Direct, Set-
associative Mapping – Writing into Cache Initialization.
TEXT BOOKS:
1. Digital Electronics Circuits and Systems, V.K. Puri, TMH.
2. Digital principles and applications, Albert Paul Malvino, Donald P Leach, TMH, 1996.
3. Computer System Architecture -M. Morris Mano , PHI.
REFERENCE BOOKS:
1. Computer Architecture -M. Carter, Schaum’s outline series, TMH
UNIT – I
Number System and Binary Codes
1.Introduction
Definition:
In digital electronics, the number system is used for representing the information.
The number system has different bases and the most common of them are the decimal, binary, octal,
and hexadecimal.
The base of binary number system is 2 because it has only two digit 0 and 1.The digital electronic
equipments are works on the binary number system and hence the decimal number system is converted into
binary system.
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
1. 4 Hexadecimal Numbers
The hexadecimal number system has a base of 16, and hence it consists of the following sixteen
number of digits.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
2.Conversions :
2.1 Decimal number to other conversions :
1. Decimal to binary conversion
The radix point splits the number into two parts; the part to the left of the radix point is called the
INTEGER. The part to the right of the radix point is the FRACTION. A number such as 34.62510 is
therefore split into 3410 (the integer)
To convert a decimal number into binary number it requires successive division by 2 writing down
each quotient and its remainder. The remainders are taken in the reverse order, which is the binary
equivalent of the decimal number.
Example : 2510
2 25
2 12 -1
2 6 -0
2 3 -0
1 -1
Ans : The binary equivalent for 2510 =110012
HW
1. 15010 =?
2. 18610=?
Conversion from decimal to octal can be performed by repeatedly dividing the decimal number by 8
and using each remainder as a digit in the octal number being formed.
The octal number system has a base radix of 8.
The reminders read in the reverse order.
Example : (200)10
8 200
8 25 - 0
3 - 1
Therefore (200)10 = (310)8
HW :
1. (888)10 =?
2. (1993)10 =?
3. Decimal to Hexadecimal conversion :
One way to convert decimal to Hexadecimal is the hex dabbles. The idea is as divide successively
by 16, writing down the remainders.
Example :2429
16 2429
16 154 -15 F
9 - 10 A
For converting the value of Binary numbers to decimal equivalent we have to find its quantity,
which is found by multiplying a digit by its place value.
Example :
1)101
=1*23-1 +0*23-2+1*23-3
= 1*22 +0*21+1*20
= 4 + 0 +1
= 5
2)1001
=1*24-1 +0*24-2+0*24-3 + 1*24-4
= 1*23 + 0*22 + 0*21 + 1*20
= 8+1
=9
3)11.011
=1*22-1 +1*22-2+0*22-3 +1*22-4+1*22-5
=1*21 +1*20+0*2-1 +1*2-2+1*2-3
2
= 2+1+0+ 1/2 +1/23
= 2+1+1/4+1/8
=3+1*2/4*2+1/8
=3+2/8+1/8
=3 + 3/8
=24+3/8
=27/8
=3.37
HW :
1. 1. (10110)2 = ?
There is a simple trick for converting a binary number to an octal number. Simply group the binary
digits into groups of 3, starting at the octal point, and read each set of three binary digits according to above
table.
= 3 5
= (3 5) 8
HW :
1.(010101110) 2 = ?
2. (010100110) 2 = ?
3.Binary to hexadecimal :
To convert binary to hexadecimal, we simply break a binary number into groups of four
digits and convert each group of four digits according to the preceding code. Here are some
examples:
Example:1
(10111011)2 = 1011 1011
= B B
= (B B)16
Example:2
(10010101)2 = 1001 0101
= 9 5
= (9 5)16
1.Octal to decimal
To convert an octal number to a decimal number, we use the same sort of polynomial as
was used in the binary case, except that we now have a radix of 8 instead of 2.
Example :
1213=?
=1*83+2*82+1*81+3*80
=512 + 128 + 8 + 3
=651
Example :
1.1038 2.1023
2.Octal to binary
(2 6 1 5 3. 7 4 0 6)8
(010 110 001 101 011. 111 100 000 110)2
HW :
1.(1023)
2.125.125
3.Octal to hexadecimal
The method of converting octal to hexadecimal number is to convert the given octal
number to binary number and then arrange the binary digits into groups of 4 starting at the binary
point.
Example :
Convert octal number 714.06 to hexadecimal.
(714.06)8 =(111 001 100.000 110)2
=0001 1100 1100 . 0001 1000
=1 C C . 1 8
The hexadecimal equivalent of (714.06)8 is (1CC.18)16
HW :
1.346 = ?
2.4 Hexadecimal to other conversions :
1.Hexadecimal to binary
Example : 2
9 A F
Example : 3
C 5 E 2
The conversion of Hexadecimal number to octal number involves two steps. First the
method suggests to go from hexadecimal to binary numbers and second from binary to octal
numbers.
1.432 =?
3.Hexadecimal to decimal
Example : BB
BB=B*161 +B*160
=11*16+11*1
=176+11
=187
HW :
1.3246 = ?
‘Carry over’ are performed in the same manner as in decimal arithmetic. Since 1 is the
largest digit in the binary system, any sum greater than 1 requires that a digit be carried.
Example :11+10 = ?
1 1
1 0
10 1
HW:
1.111 +100
2.1001+1111
1001 – 101 =?
1 0 0 1
- 1 0 1
1 0 0
HW :
1.11.01111 =01.00110
The table for binary multiplication is very short, with only four entries instead of the
many for normal decimal multiplication
0*0=0
0*1=0
1*0=0
1*1=1
Example :
11*10 = ?
1 1 * 1 0
1 0
1 1
1 1 0
HW :
1.101.111 =?
3.4 Binary division :
0/1=0
1/1=1
Example:1 111
110 101010
110
1001
110
110
110
0
Example :2
111 /10
11
` 10 1 1 1
10
1 1
1 0
1
1.The first part of the number is a signed fixed- point number, which is termed as mantissa.
2.The second part specifies the decimal or binary point position and is termed as an
Exponent. The mantissa can be an integer or a fraction.
Always mantisa part is an integer part,the number which splits by dots(.) are fraction part.
Example:
Sign Sign
0 1234 0 02
Mantissa(fraction) Exponent
Floating-point numbers are often represented in normalized form. A floating-point number whose mantissa
does not contain zero as the most significant digit of the number is considered to be in a normalized form.
The floating point representation is a must as it is useful in scientific calculations. Real
numbers are normally represented as floating point numbers.
5.Complements:
The 2’s complement of a binary no is obtained by adding 1 to the least significant bit
of the 1’s complement of that binary number.
100010
Carry last digit and add 1 to above answer
00010
1
Ans : 00011
HW :
1.1011-0101
Perform the following subtraction using 2’s complementary arithmetic
a)11011 - 11001
11011
00111
100010
Carry is dropped
HW :
1.01011 - 11000
6. BCD :(Binary coded decimal)
In BCD number system a group of binary bit is used to represent each of 10 decimal
digits.
BCD is a way to express each of the decimal digits with a binary code.
The advantage of the BCD code is an easy mode of conversion from decimal to binary
and binary to decimal.
Examples:
4 0 1 9
1 9 0 7
The decimal equivalent of BCD Number 0001 1001 0000 0111 is 1907. BCD numbers
are useful wherever decimal information is transferred into a computer.
The pocket calculator is one of the best examples for the application of BCD numbers.
Other examples of BCD system are electronic counters, digital voltmeter and digital clocks.
7. Excess 3:
The Excess-3 code is a decimal code that has been used in older computers.
In the excess-3 code,3 is added to each decimal digit and then each of the resulting digit
is converted to an equivalent binary number.
Excess-3 code in short is abbreviated as XS3.
MSB 1 0 1 1 1 0
Ans :(110100)2 = 101110 graycode value
Convert the following gray code to binary number.
Sum : 110111
MSB(Most significant bit) is = 1
1 1 0 1 1 1
MSB 1 0 0 1 0 1
9.Half adder:
A basic module used in binary arithmetic elements is the half-adder. The function of the
half-adder is to add two binary digits, producing a sum according to the binary addition rules.
Block diagram :
⮚ Half adder is a combinational of arithmetic circuit that adds two numbers and produces a
sum bit and carry bit.
⮚ It is conatructed using XOR and AND gate.but only add two inputs.
Truth table :
A B S C
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
10.Full adder:
Full Adder is the adder which 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 circuit is central to most digital circuits that perform addition or
subtraction.
X Full Adder S
Y C0
Ci
X
Y S
Logic Diagram
INPUT OUTPU
T
X Y C S C
I 0
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 1 0 0 1
1 1 1 1 1
Truth Table
A basic 4-bit parallel adder is implemented with the four full adders.
In above diagram 4 binary digits are
1.A0 – A3 = 1st 4-bit number
2. B0 – B3 = 2st 4-bit number
12.BCD adder :
⮚ BCD stands for Binary Coded Decimal Adder.
⮚ Addition of two BCD digits requires two 4-bit parallel adder circuit.
⮚ The BCD-Adder is used in the computers and the calculators that perform arithmetic operation
directly in the decimal number system. The BCD-Adder accepts the binary-coded form of decimal
numbers.
Carry in
X1 X2 X3
X4 Carry out
Augend Digit
Z1
Y1 Y2 Z2 Sum Digit
Addend Y3 Decimal Z3
Digit Y4 Adder Z4
The adder has an augends digit input consisting of four lines, an addend digit input for four lines, a carry-
in and a carryout, and a sum digit with four output lines. The augend digit, addend digit and sum digit with
four-output line.
Example :
X=0100 y=1100
It is a multiple output combinational logic network which subtract two bits of binary data.
The subtraction table (or truth table) of a half subtractor is shown below. The half
subtractor has two input bits A and B two output bits, a difference DIFF = (A-B) and a Borrow.
Rules :
INPUTS
BORROW DIFFERENCE= AB+AB
DIFF BORROW= AB
A
B
0
0
Truth table
Half subtractor :
14.Full subtractor :
A full subtractor subtracts with three bits (A-B-C). The third bit C is the borrow from previous stage.
A full subtractor is a multiple output combinational logic network which performs a subtraction between
two binary bits a and b.
Truth table :
Inputs Outputs
Minuend Subtrahend Borrow Difference Borrow
(A) (B) (Bin) (D) (Bout)
0 0
0 0 0
0
0 1 1 1
1
0 1 0 1
1
0 1 1 0
1
0 0 1 0
0
1 0 1 0
1
1 0 0 0
1 1
1 1 1
Circuit diagram :
1. The parallel adder/subtractor performs the addition operation faster as compared to serial
adder/subtractor.
2. Time required for addition does not depend on the number of bits.
3. The output is in parallel form i.e all the bits are added/subtracted at the same time.
4. It is less costly.
Disadvantages of parallel Adder/Subtractor
1. Each adder has to wait for the carry which is to be generated from the previous adder in chain.
2. The propagation delay( delay associated with the travelling of carry bit) is found to increase with the
increase in the number of bits to be added.
Digital Logic
⮚ Gates are digital circuits because input and output signals have only two status.
⮚ Either low(or) high,low means 0 and high means 1.
⮚ Gates are also called logic circuits.
⮚ A gate is actually a circuit with one (or) more than input signal but having only one output signal.
⮚ Digital systems are said to be constructed by using logic gates. The basic gates are the AND, OR,
NOT gates.
1.AND gate :
The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. A dot (.) is used to
show the AND operation i.e. A.B. Bear in mind that this dot is sometimes omitted i.e. AB
2. OR gate
The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A plus (+) is
used to show the OR operation.
3. NOT gate
The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also known as
an inverter. If the input variable is A, the inverted output is known as NOT A.
4.EXOR gate
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both, of its two inputs are
high. An encircled plus sign ( ) is used to show the EOR operation.
5.NOR gate :
6.NAND gate :
⮚ NAND gate is actually means NOT-AND.
⮚ It allows two or more inputs but only one output , which is complement of the AND product of all
inputs.
UNIT – 2
Combinational Logic Circuits
2. KARNAUGH MAP :
⮚ The k-map provides simple and straight forward method of minimizing Boolean expression.
⮚ The k-map is systematic method for combining terms and determining minimal expression.
3.Canonical form 1 :
⮚ Canonical forms for Boolean functions are sum of products (SOP) form and basic forms.
⮚ Any variable taken in uncompleted form in the product if it has the value 1 and should be
taken in completed form if it has the value 0.
⮚ In three variable function f(A,B,C) the value of A,B and C are 1,0,1 respectively,then the
product term will be ABC.
⮚ Each of all the variables as factors in either completed or uncompleted form is known as
minterm.
⮚ The switching function expressed as the sum of all the minterms is called the canonical sum
of products(SOP).
3.1 Example :
Find the sum of product (SOP) form of switching function f(A,B,C) which is represented by the truth
table given below :
Decimal A B C f
value
0 0 0 0 0
1 0 0 1 1
2 0 1 0 1
3 0 1 1 0
4 1 0 0 1
5 1 0 1 0
6 1 1 0 0
7 1 1 1 1
f(0,3,5,6) = ∑(0,3,5,6)
f(1,2,4,7) = ∑(1,2,4,7)
In the above table that the decimal value for which the function f assumes the value 1 are 1,2,4,7.
SOP :
= ∑(1,2,4,7)
= 001+010+100+111
F(a,b,c)= A B C + A B C + A B C + A B C
⮚ The k-map is a modified form of the Venn diagram of the switching function with four or less
variables in the canonical sum of products form.
⮚ Each square of the k-map is denoted by a binary number (or) its equivalent decimal.
⮚ If the switching function consists of 3 variables,then the k-map has 8(=23) squares and if the
function consist of four variables , then the map has 16(=24) small squares .
⮚ To construct the k-map of a switching function ,first the function is represented in the sum of
products form.
4.1 Example :
f=ABC+ABC+ABC+ABC+ABC
5.Implicants :
⮚ The simpltfied product term obtained by combining the minterms of set are called implicants of the
switching function.
1.Prime implicants
1.Prime implicants :
Example:
2.Essential prime implicants :
These are those subcubes(groups) which cover atleast one minterm that can’t be covered by any other
prime implicant. Essential prime implicants(EPI) are those prime implicants which always appear in final
solution.
Example:
The prime implicants for which each of its minterm is covered by some essential prime implicant
are redundant prime implicants(RPI). This prime implicant never appears in final solution.
Example:
4.Selective Prime Implicants :
The prime implicants for which are neither essential nor redundant prime implicants are
called selective prime implicants(SPI). These are also known as non-essential prime implicants. They may
appear in some solution or may not appear in some solution.
Example:
⮚ The “Don't Care” conditions allow us to replace the empty cell of a K-Map to form a grouping of
the variables. While forming groups of cells, we can consider a “Don't Care” cell as either 1 or 0 or
we can simply ignore that cell. Therefore, “Don't Care” condition can help us to form a larger group
of cells.
⮚ In digital logic, a don't-care term (abbreviated DC, historically also known as redundancies,
irrelevancies, optional entries, invalid combinations, vacuous combinations,
forbidden combinations, or unused states).
⮚ A function assumes value 1 for some combinations and value 0 for other combinations.
7. Product of sum, Sum of products, simplifications:
⮚ Sum of Products and Product of Sums. The different forms of canonical expression which includes
the sum of products (SOP) and products of the sum (POS), The canonical expression can be defined
as a Boolean expression which has either min term otherwise max term.
⮚ The k-map method are useful when we applied for four variables.
Sequential circuits
Flip-Flops :
Introduction
A flip flop is a stable device, that is, it can remain in one of the two stable states which
are designated as “0” and “1” states.
It is the fundamental logic circuit used for storing information in digital systems.
Different types of shift registers and counters are designed only using flip flops, which
can be built using NOR gates or NAND gates.
A flip flop has two outputs, one of which is the complement of the other. They are called
Normal and complement outputs.
A flip-flop is an basic memory element used to share one bit of information.
The basic difference between the various types of flip-flops is the number of inputs and
outputs.
Types of flip-flop :
1.R.S flip-flop
2.D flip-flop
3.J.K flip-flop
4.T flip-flop
A C
S Q
R B D Q’
RS Flip Flop
The above diagram shows an RS Flip Flop constructed with four NAND gates A, B, C and
D. It has two inputs S and R and two outputs Q and Q’. (The state of any flip-flop is known by
the state of a output only).
Truth table
Step 1:
R=0 , S=0 means the value are not allowed so the output value is one.
Step 2:
R=0 ,S=1 means the Q value is 1
Q’ is an opposite to the Q
Step 3:
R=1,S=0 means the value is 0
Q’ value is 1
Step 4:
R=1 , S=1 means the status will not be change.
10. D Flipflop :
⮚ The D-type flip-flop is a modified Set-Reset flip-flop with the addition of an inverter to prevent the
S and R inputs from being at the same logic level.
⮚ The D of D-flip-flop stands for “data”.
⮚ D flip flop is very useful for temporary data storage.
⮚ It is modify over the R-S flip flop.
⮚ The D-type flip flop are constructed from a gated SR flip-flop with an inverter added between
the S and the R inputs to allow for a single D (Data) input.
⮚ It is also known as a Data Latch, Delay flip flop, D-type Bistable, D-type Flip Flop .
Circuit diagram :
⮚ Thus this single input is called the “DATA” input. If this data input is held HIGH the flip flop
would be “SET” and when it is LOW the flip flop would change and become “RESET”.
⮚ To avoid this an additional input called the “CLOCK” or “ENABLE” input is used to isolate the
data input from the flip flop’s latching circuitry after the desired data has been stored.
⮚ The “D flip flop” will store and output whatever logic level is applied to its data terminal so long as
the clock input is HIGH.
Truth table :
Clk D Q Q Description
Memory
↓»0 X Q Q no change
↑»1 0 0 1 Reset Q » 0
↑»1 1 1 0 Set Q » 1
⮚ The JK Flip Flop is the most widely used flip flop. It is considered to be a universal flip-flop
circuit. The sequential operation of the JK Flip Flop is the same as for the RS flip-flop with the
same SET and RESET input.
⮚ Jk flip flop is otherwise called as positive edge triggered flip flop.
⮚ The JK flipflop is the improved or modified form of the RS flipflop.
Circuit Diagram :
Truth table
⮚ Whenever the clock signal is LOW, the input is never going to affect the output state. The clock
has to be high for the inputs to get active.
⮚ A flip-flop is a device which stores a single bit (binary digit) of data; one of its two states represents
a "one" and the other represents a "zero".
Circuit diagram :
In the above diagram they are using four NAND gates and there are two outputs Q and Q’.
Additionally hear we have Clk pulse and input is given as T.
Truth table :
13.Multiplexers :
14. Demultiplexers
15.Decoder :
G0 Y0
G1 Y1
G2 Y2
G3 Y3
⮚ The octal-to-binary encoder consists of eight inputs, one for each of the eight digits, and three
outputs that generate the corresponding binary number. It is constructed with OR gates .
18.Counters:
⮚ Counter is a sequential circuit. A digital circuit which is used for a counting pulses is known
counter. Counter is the widest application of flip-flops. It is a group of flip-flops with a clock
signal applied.
⮚ A flipflop can store one bit information but counters can store more binary information.
⮚ The counters are used for counting the clock pulses in an application.
⮚ A counter is a device which can count any particular event on the basis of how many times the
particular event(s) is occurred.
⮚ In a digital logic system or computers, this counter can count and store the number of time any
particular event or process have occurred, depending on a clock signal.
⮚ Most common type of counter is sequential digital logic circuit with a single clock input and
multiple outputs. The outputs represent binary or binary coded decimal numbers. Each clock pulse
either increase the number or decrease the number.
⮚ Asynchronous counters are sometimes called ripple counters because the data appears to
“ripple” from the output of one flip-flop to the input of the next.
⮚ They are simple and easy to design by Toggle flip flop or D flip flop.
⮚ They can be used in low speed circuits.
⮚ They are most reliable because they use the same clock signal for all flip flops.
Example :
Q = Q3 Q2 Q1 Q0
0 0 0 1
⮚ In synchronous counters, all flip flops are connected to the same clock signal and all flip flops will
trigger at the same time.Synchronous counters are also known as ' Simultaneous counters .
⮚ The Synchronous Counter, the external clock signal is connected to the clock input of EVERY
individual flip-flop within the counter so that all of the flip-flops are clocked together
simultaneously (in parallel) at the same time giving a fixed time relationship.
⮚ Synchronous counters are easier to design than asynchronous counters , are all clocked together at
the same time with the same clock signal. Due to this common clock pulse all output states switch
or change simultaneously.
⮚ It is very fast comparing asynchronous counters.
⮚ The inputs of first flip flop are connected to HIGH (logic 1), which makes the flip flop to toggle,
for every clock pulse entered into it.
⮚ So the synchronous counter will work with single clock signal and changes its state with each pulse.
⮚ The output of first JK flip flop (Q) is connected to the input of second flip flop.
⮚ The AND gates (which are connected externally) drives the inputs of other two flip flops .
⮚ The inputs of these AND gates , are supplied from previous stage flip flop outputs.
UNIT III
Input – Output Organization
1.Input – output interface :
⮚ Input output interface provides a method for transferring information between internal storage and external
I/O devices.
⮚ Input output interface connected to the peripheral devices.
⮚ Data codes and formats in peripherals differ from the word format in the CPU and memory.
⮚ The operating modes of peripherals are different from each other and each must be
controlled so as not to disturb the operation of other peripherals connected to the CPU.
1. Use two separate buses, one for memory and other for I/O.
2. Use one common bus for both memory and I/O but have separate control lines for each.
3. Use one common bus for memory and I/O with common control lines.
Bus
Internal buses
The internal bus, also known as internal data bus, memory bus, system bus or front-side bus,
connects all the internal components of a computer, such as CPU and memory, to the motherboard.
Internal data buses are also referred to as local buses, because they are intended to connect to local
devices.
External buses
The external bus, or expansion bus, is made up of the electronic pathways that connect the different
external devices, such as printer etc., to the computer.
1.Dataline:
A data bus can transfer data to the memory of a computer, or into or out of the central processing
unit (CPU) that acts as the device's "engine." A data bus can also transfer information between two
computers.
2.Address line :
An address line usually refers to a physical connection between a CPU/chipset and memory. They
specify which address to access in the memory.
The address bus carries addressing signals from the processor to memory.
3. Read/write control lines:
These control lines running through the data buses and also having control signals, when a DMA
controller places a Bus request input (BR) to CPU and to take the control the over Buses.
⮚ The I/O read and I/O writes control lines are enabled during an I/O transfer.
⮚ The memory read and memory write control lines are enabled during a memory transfer.
⮚ When the CPU fetches and decodes the operation code of an input or output instruction, it
places the address associated with the instruction into the common address lines.
⮚ At the same time, it enables the I/O read (for input) or I/O write (for output) control line.
⮚ Memory-mapped I/O uses the same address space to address both memory and I/O devices
Load and store instructions used for reading and writing from memory can be used to input
and output data from I/O registers.
⮚ The chip select and register select used to determine the address assigining to interface.
⮚ The I/O read and I/O write specifies an input and output datas.
⮚ By loading appropriate bits into the control register, the interface and the I/O device attached
to it can be placed in a variety of a operating modes.
⮚ The interface register communicate with the CPU through the bidirectional data bus.
⮚ The interface register select the address and assigned to its registers.
⮚ The CPU transfer binary information to the selected register to the data bus.
Asynchronous data transfer
7.Strobe Control and Handshaking :
7.1Introduction :
The internal operations in a digital system are synchronized by means of clock pulses
supplied by a common pulse generator. If the interface registers and CPU shares a common
clock, the transfer is said to be synchronous.
Clock pulses are applied to all registers within a unit and all data transfers among internal
registers occur simultaneously during the occurrence of a clock pulse.
Methods
Asynchronous data transfer between two independent units requires that control signals
be transmitted between the communicating units to indicate the time at which data is being
transmitted. Two ways of achieving this,
1. Strobe control
2. Handshaking
⮚ A strobe is a single line that informs the destination unit when a valid data
its available in the bus.
⮚ Actually, the source does not have to change the information in the data bus.
⮚ The fact that the strobe signal is disabled indicates that the data bus does not contain valid
data. New valid data will be available only after the strobe is enabled again.
Advantages :
The handshake scheme provides high degree of flexibility and reliability because the
successful completion of a data transfer relies on active participation by both units.
UNIT IV
1.Priority Interrupt :
⮚ Data transfer between the CPU and I/O devices.
⮚ The CPU cannot start the transfer unless the device is ready to communicate with the CPU.
⮚ A priority interrupt is a system that establishes a priority over the various sources to destination
which condition is to be serviced first when two or more requests arrive simultaneously.
⮚ When two devices interrupt the computer at the same time, the computer services the device,
with the higher priority first.
Diagram
⮚ The interrupt request line is common to all devices and forms a wired logic connection.
⮚ If any device has to interrupt signal in the low- level state, the interrupt line goes to the low- level
state.
⮚ When no interrupts are pending, the interrupt line stays in the high- level state.
⮚ This signal is received by device 1 at its PI (Priority In) input. The acknowledge signal passes on to
the next device through the PO (Priority out) output only if device 1 is not requesting an interrupt. If
device 1 has a pending interrupt, it blocks the acknowledge signal from the next device by placing a
0 in the PO output.
⮚ A device with a 0 in its PI input generates a 0 in its PO output to inform the next- lower- priority
device that the acknowledge signal has been blocked.
⮚ The daisy chain arrangement gives the highest priority to the device that receives the interrupt
acknowledge signal from the CPU.
⮚ The mask register can be programmed to disable lower priority interrupts while a higher
priority device is being serviced. It can also provide a facility that allows a high priority
device to interrupt the CPU while a lower priority device is being serviced.
⮚ An interrupt register whose indivual bits are set by external conditions and cleared by
program instructions.
⮚ The magnatic disk is a high speed device so disk having highest priority.
⮚ Printer has the next priority,followed by the character reader and keyboard.
⮚ Program instructions is possible to set or reset in the mask register.
⮚ The priority encoder generates two bits of vector addresses,which is transfer to the CPU such
as x and y.
⮚ Another output from the encoder sets an interrupt status in IST.
⮚ IEN is cleared by the program to provide an overall control over the interrupt system.
Priority Encoder :
⮚ The priority encoder is a circuit.
⮚ The logic of priority encoder is if 2 or more inputs arrive at the same time,which input
having the highest priority will precedence.
Direct Memory Access
4.DMA Controller:(Direct Memory Access)
⮚ The transfer of data between a fast storage device such as magnetic disk and memory.
⮚ A DMA controller takes over the buses to manage the transfer directly between the
I/O device and memory.
1.Bus request(BR)
2.Bus grant(BG)
3.Burst transfer
4.Cycle stealing
Bus request(BR) :
⮚ The bus request (BR) input is used by the DMA controller to request the CPU to
control of the buses.
⮚ The CPU terminates the execution of the current instruction and read and write lines
into a high independent state.
Bus grant(BG) :
⮚ CPU activates the bus grant (BG) output to inform the external DMA.
⮚ When the DMA terminates the transfer it disables the bus request line.
Burst transfer :
⮚ This mode of transfer is needed for fast devices such as magnetic disk.
Cycle stealing :
⮚ Cycle stealing allows the DMA controller to transfer one data word at a time.
⮚ The word count register specifies the number of words that must be transferred. The
data transfer may be close directly between the device and memory under control of
the DMA.
Diagram :
⮚ The RD (read) and WR (write) inputs are bi-directional. When the BG (bus grant)
input is 0, the CPU can communicate with the DMA registers through the data bus to
read from or write to the DMA registers.
⮚ When BG=1 the CPU can communicate directly with the memory by specifying an
address in the address bus and activating the RD or WR control. The DMA Controller
has three registers.
● 1.Address register
● 2.Word count register
● 3.Control register
ADDRESS REGISTER
Address register contains an address to specify the desired location in
memory.
CONTROL REGISTER
The control register specifies the mode of transfer.
⮚ The memory unit occupies a central position and can communicate with each
processor by means of direct access memory.
⮚ The CPU is responsible for processing data needed in the solution of computational
tasks.
Block diagram :
⮚ The IOP provides a path for transfer of data between various peripheral devices and
the memory unit.
⮚ The CPU is usually assigned the task of initiating the I/O program.
⮚ In most computer system the CPU is the master while the IOP is a slave processor.
⮚ The CPU informs the IOP where to find the commands in memory.
7. CPU-IOP Communication :
Introduction :
⮚ The communication between CPU and IOP may take different forms, depending on the
particular computer considered.
⮚ In most cases the memory unit acts as a message center where each processor leaves
information for the other.
⮚ The sequence of operations may be carried out as shown in the following flowchart.
UNIT IV
Memory Organization
1.Memory Hierarchy :
1.1 Introduction :
⮚ The memory unit is an essential component in any digital computer.
⮚ Small computer with a limited application may be able to fulfill its task,without need a
addition storage capacity.
⮚ The memory unit that communicates directly with a CPU is called the main memory.
Diagram :The components in a typical memory hierarchy
1.2 Multiprogramming :
Multiprogramming refers to the existence of many programs in different parts of
main memory at the same time.
For example, suppose a program is being executed in the CPU and the I/O transfer
is required. The CPU initiates the I/O transfer by using I/O processor. This leaves the
CPU free to execute another program.
The part of the operating system that supervises the flow of information between
all storage devices is called “Memory Management System”. The memory management
system distributes program and data to various levels in the memory hierarchy.
They are
● Batch Mode
● Time sharing mode
In a Batch mode, each user prepares his program off- line and submits it to the
computer center. An operator loads all programs into the computer where they are
executed. The operator retrieves the printed output and returns it to the user.
In a time-sharing mode, many users communicate with the computer via remote
terminals. Because of slow human response compared to computer speeds, the computer
can respond to multiple users at, seemingly at the same time.
⮚ The above devices used for sharing system programs,large data files and other backup
information.
⮚ It occupies a central position and able to communicate directly with the CPU.
2.Main Memory :
2.1 Introduction :
⮚ The main memory is the central storage unit in a computer system.
⮚ It is a relatively large and fast memory used to store programs and data during the computer
operation. The principal technology used for the main memory is based on semiconductor
integrated circuits. Integrated circuit RAM chips are available in two possible operating
modes, static and dynamic.
⮚ The static RAM consists essentially of internal flip- flops that store the binary information.
⮚ The dynamic RAM stores the binary information.
⮚ The static RAM is easier to use and has shorter read and write cycles.
⮚ ROM is used for storing programs that are permanently.
2.2 RAM and ROM chips :
A ROM chip is organized externally in a similar manner. However, since a ROM can only read, the
data bus can only be in an output mode.
⮚ RAM and ROM chip are connected to CPU through the data bus and address bus.
⮚ The selection between RAM and ROM is achieved through bus line 10. The RAMs are
selected when the bit in this line is 0 and the ROM when the bit is 1.
⮚ To select one of 128 possible bytes.
3.Associative memory:
1.Introduction
2.Hardware Organization
3.Match Logic
4.Read Operation
5.Write Operation.
3.1 Introduction :
⮚ Associative memory is also known as content addressable memory (CAM) or associative
storage or associative array.
⮚ This type of memory is accessed simultaneously and in parallel based on the data content
rather than the specific address or location.
⮚ Memory is capable of finding empty unused space to store the word, or part of the word
specified.
⮚ The memory locates all words, which match the specified content, and marks them for
reading. Because of its organization, the associative memory is uniquely suited to do parallel
searches by data association.
⮚ Associative memories are used in applications where the search time is very critical and must
be very short
Applications of Associative memory :-
1. It can be only used in memory allocation format.
2. It is widely used in the database management systems, etc.
Advantages of Associative memory :-
1. It is used where search time needs to be less or short.
2. It is suitable for parallel searches.
3. It is often used to speedup databases.
4. It is used in page tables used by the virtual memory and used in neural networks.
Disadvantages of Associative memory :-
1. It is more expensive than RAM.
2. Each cell must have storage capability .
3.2 Hardware Organization :
⮚ Memory Organization in Computer Architecture, A memory unit is the collection of
storage units or devices together. The memory unit stores the binary information in the form
of bits.
⮚ Associative memory not accessed by address, it is accessed by the content. Whenever a word
is to be read from the associative memory, it's content or a part of that word is specified and
then all the words of the memory which match the specified content are marked for reading .
⮚ If only one word may match the unmasked argument field, then connect output Mi directly to
the read line in the same word position, the content of the matched word will be presented
automatically at the output lines and no special read command signal is needed.
⮚ Memory read operation transfers the desired word to address lines and activates the read
control line.
4.Cache Memory:
1.Introduction
2.Associative Mapping
3.Direct Mapping
4.Set-associative Mapping
5.Writing into Cache Initialization.
4.1 Introduction :
⮚ It is the faster component in the hierarchy and approaches the speed of CPU
components.
⮚ The performance of the cache memory is measured in terms of a quality called “Hit
Ratio”. When the CPU refers to memory and finds the word in cache, it produces a
hit. If the word is not found in cache, it counts it as a miss.
⮚ The ratio of the number of hits divided by the total CPU references to memory (hits +
misses) is the hit ratio.
⮚ The average memory access time of a computer system can be improved considerably
by use of cache.
⮚ When the CPU needs to access memory, the cache is examined. If it is found in the
cache, it is read very quickly. If it is not found in the cache, the main memory is
accessed.
The basic characteristic of cache memory is its fast access time. Therefore, very little or no
time must be fasted when searching for words in the cache.
● Associative Mapping
● Direct Mapping
● Self – Associative Mapping.
Consider the following memory organization Figure.5.8 to show mapping procedures of the
cache memory.
The associative mapping stores both the address and content (data) of the memory
word.
The diagram, given below shows 3 words presently stored in cache.
The address value of 15 bits it’s shown as a 5 digit octal number and its
corresponding 12 bits is shown as 4 digit octal number.
Argument register
Address Dat
a
01000 3450
02777 6710
22345 1234
Associative Mapping Cache (all numbers in octal)
a)Main memory
Memory address Memory data
1220
2340
3450
4500
5670
6710
00000
00777
01000
01777
02000
02777
b) Cache memory
Index address Tag data
00 1220
02 6710
000
777
⮚ The cache tag is 00 but the address tag is 02, which does not produce match.
Therefore the main memory is accessed and the data word 5670 is transferred to CPU.
⮚ Index address 000 is then replaced with a tag of 02 and data of 5670. The direct
mapping uses a block size of 1 word or 8 words.
In set – Associative mapping, each word of cache can store two or more words of memory
under the same index address. Each data word is stored together with its tag and the
number of tag – data items in one word of cache is said to form a set.
Index Tag Data Tag Data
01 3450 02 5670
02 6710 00 2340
000
777