Sem 3
Sem 3
Sem 3
UNIT- I
NUMBER SYSTEM AND CODES
Number System:
A set of values used to represent different quantities is known as Number
System. For example, a number system can be used to represent the number of
students in a class or number of viewers watching a certain TV program etc. The
digital computer represents all kinds of data and information in binary numbers. It
includes audio, graphics, video, text and numbers.
There are mainly 2 types of Number Systems.
1. Non Positional Number System
2. Positional Number System
Roman Numbers are examples of the Non Positional Number System. This
is quite difficult to use and has no symbol for Zero. Ex: I, II, III, V, L, C… etc.
The most widely used number system is Positional Number System. The
total number of digits used in a number system is called its base or radix. The base
is written after the number as subscript. The weight of a digit in number depends on
its relative position with in the number.
Some important number systems are as follows.
Number System Base Digits
Decimal number system 10 0,1,2,3,4,5,6,7,8,9
Binary number system 2 0,1
Octal number system 8 0,1,2,3,4,5,6,7
Hexadecimal number system 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
The decimal number system is used in general. However, the computers use
binary number system. The octal and hexadecimal number systems are also used
in the computer.
Decimal number System
The Decimal Number System consists of ten digits from 0 to 9. These digits
can be used to represent any numeric value. The base of decimal number system
is 10. It is the most widely used number system. The value represented by
individual digit depends on weight and position of the digit.
The value of the number is determined by multiplying the digits with the
weight of their position and adding the results. This method is known as expansion
method.
The weights and positions of each digit of the number 453 are as follows:
The value of digit 4 = 4 x100 = 400
The value of digit 5 = 5 x10 = 50
The value of digit 3 = 3 x1 = 3
= 1 x 4 + 0 + 1 x 1 + ½ + 0 + 1/8
= 4 + 0 + 1 + 0.5 + 0.125
= 5.62510
Octal Number System
Octal Number System consists of eight digits from 0 to 7. The base of octal
system is 8. Each digit position in this system represents a power of 8. Any digit in
this system is always less than 8. Octal number system is used as a shorthand
representation of long binary numbers. The number 6418 is not valid in this number
system as 8 is not a valid digit.
Ex : convert 458 to decimal number
458 = 4 x 81 + 5 x 80
= 4 x 8 + 5 x1
= 32 + 5
= 3710
Hexadecimal number system
The Hexadecimal Number System consists of 16 digits from 0 to 9 and A to
F. The alphabets A to F represent decimal numbers from 10 to 15. The base of this
number system is 16. Each digit position in hexadecimal system represents a
power of 16. The number 764 16 is valid hexadecimal number. It is different from
76410 which is seven hundred and sixty four. This number system provides shortcut
method to represent long binary numbers.
Ex: Convert 3 A16 to decimal number
3A16 = 3 x 161 + A x 160
= 3 x 16 + 10 x 1
= 48 + 10 = 5810
Hexadecimal to Binary
Step 1 − Convert each hexadecimal digit to a 4 digit binary number
Step 2 − Combine all the resulting binary groups of 4digits each into a single binary
number.
Ex: Convert Hexadecimal no. 6A416 to Binary no.
6 A 4
0110 1010 0100
6A416 = 011010100100 2
CODES
When numbers, letters or words are represented by a specific group of
symbols, the group of symbols is called as a code. The digital data is represented,
stored and transmitted as group of binary bits. This group is also called as binary
code. The binary code is represented by the number as well as alphanumeric letter.
Advantages of Binary Code
Binary codes are suitable for the computer applications.
Binary codes are suitable for the digital communications.
Binary codes make the analysis and designing of digital circuits.
Since only 0 & 1 are being used, implementation becomes easy.
Binary Coded Decimal (BCD) code
In this code each decimal digit is represented by a 4-bit binary number. 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.
The most common BCD code is the 8421 BCD code. In this, the BCD
equivalent of a decimal number is written by replacing each decimal digit in integer
and fractional parts with its four-bit binary equivalent '(or nibble). Here 8, 4, 2 and 1
represent the weights of different bits in the four-bit groups.
Decimal
0 1 2 3 4 5 6 7 8 9
digit
BCD
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Code
Advantages of BCD Codes
It is very similar to decimal system.
We need to remember binary equivalent of decimal numbers 0 to 9 only.
Disadvantages of BCD Codes
The addition and subtraction of BCD have different rules.
The BCD arithmetic is little more complicated.
BCD needs more number of bits than binary to represent the decimal
number. So BCD is less efficient than binary.
BCD-to-Binary Conversion
A given BCD number can be converted into an equivalent binary number by
first writing its decimal equivalent and then converting it into its binary equivalent.
Example: Find the binary equivalent of the BCD number 0010 1001 . 0111 0101
BCD number : 0010 1001.0111 0101
Corresponding decimal number : 29.75
The binary equivalent of 29.75 is 11101 for the integer part and .11 for the
fractional part.
Therefore, (0010 1001.0111 0101)BCD = (11101.11)2.
Binary-to-BCD Conversion
The process of binary-to-BCD conversion is the same as the process of
BCD-to-binary conversion executed in reverse order. A given binary number can be
converted into an equivalent BCD number by first determining its decimal
equivalent and then writing the corresponding BCD equivalent.
Example: Find the BCD equivalent of the binary number 10101011.101
The decimal equivalent of this binary number can be determined to be
171.625.
The BCD equivalent can then be written as 0001 0111 0001.0110 0010 0101.
Excess-3 code
The Excess-3 code is also called as XS-3 code. It is non-weighted code
used to express decimal numbers. 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. The
excess-3 codes are obtained as follows −
BCD Excess – 3
Decimal
8421 BCD+0011
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
The third most significant bit, adjacent to the second MSB, in the Gray code
number is obtained by adding the second MSB and the third MSB in the
binary number and ignoring the carry, if any.
The process continues until we obtain the LSB of the Gray code number by
the addition of the LSB and the next higher adjacent bit of the binary
number.
Binary No : 11101
Gray code : 10011
Gray Code to Binary Conversion
A gi ven Gray code number can be converted into its binary equivalent by
going through the following steps:
Begin with the most significant bit (MSB). The MSB of the binary number is
the same as the MSB of the Gray code number.
The bit next to the MSB (the second MSB) in the binary number is obtained
by adding the MSB in the binary number to the second MSB in the Gray
code number and ignoring the carry, if an y.
The third MSB in the binary number is obtained by adding the second MSB
in the binary number to the third MSB in the Gra y code number. Again, carry,
if any, is to be ignored.
The process continues until we obtain the LSB of the binary number.
marks and space characters. The latest development in the field of ASCII code is
the development of 8 bit code which is known as US ASCII-8 or ASCII-8. As it is an
8 bit code it can represent 2 8 = 256 characters. Some of the ASCII codes are given
below.
6- 36H, A- 41H, a – 61H ..... etc.
Binary Addition
Binary arithmetic is essential part of all the digital computers and many other
digital systems.
101010011
010011010
111101101
Binary Subtraction
101010011
010011010
010111001
Binary Subtraction using complement methods
Complements are used in the digital computers in order to simplify the
subtraction operation. As the binary system has base2. So the two types of
complements for the binary system are 2's complement and 1's complement.
1's complement
The 1's complement of a number is found by changing all 1s to 0s and all 0s to 1s.
1's Complement = 2n – r - 1
n – No. of digits in given no, r – given no.
Ex. 1's Complement of 01011011 is 10100100
Subtraction using 1's complement
Note: If the number of bits in the subtrahend and minuend not equal, we
must make them equal in numbers of bits by taking 0s at left side
The steps to be followed in subtraction by 1’s complement are:
1. Write down 1's complement of the subtrahend.
2. Add this with the minuend.
3. If the result of addition has a carry over then it is dropped and 1 is added in the
last bit(End Around Carry - EAC ).
4. If there is no carry over, then 1’s complement of the result of addition is obtained
to get the final result and it is negative.
9's complement
The complements are used to make the arithmetic operations in digital
system easier. To obtain the 9's complement of any number we have to subtract
the number with (10 n - 1) where n = number of digits in the number, or in a simple
manner we have to subtract each digit of the given decimal number from 9.
9's complement of 43 is 99 - 43 = 56
10's complement
To find out the 10's complement, after finding out the 9's complement of that
number. We have to add 1 with the 9,s complement
10's complement of 43 = 9's complement+1
= (99 – 43)+1 = 56+1= 57
UNIT- II
BOOLEAN ALGEBRA AND THEOREMS
Positive and Negative Logic
The binary variables have either of the two states, i.e. the logic ‘0’ state or
the logic ‘1’ state. These logic states in digital systems such as computers, for
instance, are represented by two different voltage levels or two different current
levels.
If the two voltage levels are 0 V and +5 V, then in the positive logic system
the 0 V represents a logic ‘0’ and the +5 V represents a logic ‘1’. In the negative
logic system, 0 V represents a logic ‘1’ and +5 V represents a logic ‘0’.
If the two voltage levels are 0 V and −5 V, then in the positive logic system
the 0 V represents a logic ‘1’ and the −5 V represents a logic ‘0’. In the negative
logic system, 0 V represents a logic ‘0’ and −5 V represents a logic ‘1’.
Truth Table
A truth table lists all possible combinations of input binary variables and the
corresponding outputs of a logic system .
Logic Gates
Logic gates are the basic building blocks of any digital system. Logic gate
can be defined as an electronic circuit which makes decisions. It has one or more
than one input and only one output. The relationship between the input and the
output is based on certain logic. Basic logic gates are AND gate, OR gate, NOT
gate.
AND Gate
AND Gate is a logical gate which is widely used having two or more inputs
and a single output. This gate operates on logical multiplication. In this gate if either
of the inputs is low (0), then the output is also low, but if all the inputs are high (1)
the output will also be high (1)
Fig show 2 i/p AND gate, here i/ps are A & B and o/p is Y=A.B
Truth Table
A B Y=A.B
0 0 0
0 1 0
1 0 0
1 1 1
If any of the transistors T1 and T2 is in OFF condition, same result will come
at output X as both the transistors are in series.
If we apply +5 V at both the inputs A and B i.e. at base of transistor T1 and T2
respectively. This makes both the transistors T1 and T2 are in ON condition. Entire
supply voltage grounded through T1 and T2 and the base potential of the transistor
T3 will be zero and T3 becomes in OFF condition. As a result the supply voltage
+5V appear at output and X will become 1 or high.
OR Gate
OR gate performs operation which means output is logical 1 if at least one of
the inputs is 1. Just like AND gate, an OR gate may also have two or any more
numbers of inputs but only one output. Only if all of the inputs are low or 0 the
output is low or 0 and in all other input conditions the output will be high or 1.The
logical symbol of OR gate is shown below,
A B Y=A+B
Truth Table 0 0 0
0 1 1
1 0 1
1 1 1
OR Gate using Diodes
A simple two inputs OR gate by using diode as follows,
In the above circuit, When any of the inputs is given with +5V, the respective
diode becomes forward biased and behaves as ideally short circuited hence this +5
V will appear at output X. +5 V means logical 1.
Now if both of the inputs are given with +5 V, both diodes will be forward
biased. Hence, similarly +5 V will appear at X.
Now if both of the inputs A and B are grounded or given 0V, There will be no
voltage appears at X and hence X is considered as logical 0.
OR Gate using Transistors
The OR gate by using transistor is shown in figure. In this case the OR gate
is referred as transistor OR gate.
Now if A and B both are given with 0V, both of the transistor are in OFF
condition, hence supply voltage + 5 V will not get path to the ground through either
of the transistors, T1 and T2. As a result base of the transistor T3 will get enough
potential to make it ON. In that condition supply + 5 V will get path to ground
through transistor T3. Then no voltage appears at output. i.e., logical 0
Now, if base terminal either of the transistors T1 or T2 or both are given with
+ 5 V, the respective transistor or both will be in ON condition. In that case supply
voltage + 5 V will get path to ground through either of the transistors or both. As a
result base of T3 having 0 volts and T3 is in OFF condition. Hence, total supply
voltage appears at output. i.e., logical 1
NOT Gate
NOT gate is a logical gate which only inverts the input digital signal. NOT gate
sometimes is referred as inverter. A NOT gate always have high (1) output when its
input is low (0). On the other hand a logical NOT gate always have low (0) output
when input is high (1). The logical symbol of a NOT gate is shown below,
Truth Table
A Y= Α
0 1
1 0
NOT Gate using Transistors
A NOT gate can easily be designed by using a simple bipolar transistor. The
circuit of a
NOT gate or transistor inverter is shown below
Let us examine the above simple circuit by applying high input variable, i.e.
+5V. At that condition the transistor T gets enough base potential to make the
transistor T ‘ON’.
As soon as the transistor becomes ON, the supply voltage (+5V) will get a
path to the ground through transistor T. As a result no voltage appears at output.
i.e., logical 0
Input A = 0V i.e. base terminal of the transistor is given with 0V. At this
condition, as the base of the transistor is at 0 potential, the transistor T will be in
OFF condition and hence, the supply voltage will not get any path to the ground
and entire supply voltage will appear at output terminal of the NOT gate high (1).
Ex-OR Gate
Ex-OR gate operation is same as that of OR gate, except that the o/p is 0
when all i/ps are high. Symbol of Ex-OR gate
Truth Table
A B Y=A B Y A B AB AB
0 0 0 Logical diagram for Ex-OR gate
0 1 1
1 0 1
1 1 0
Universal Gates
NOR and NAND gates have the particular property that any one of them can
create any logical Basic gate (Boolean expression). Hence, NAND and NOR gates
are called universal gates
NAND Gate
NAND gate has 2 or more i/p signals and only one o/p signal. It has low o/p
when all i/p signals are high, otherwise it has high o/p signal
Symbol of NAND gate Logical Structure of NAND gate truth table
A B Y= AB
0 0 1
0 1 1
1 0 1
1 1 0
In logical structure AND gate followed by NOT gate. So it is also called NOT-AND
gate
NOR Gate
NOR gate has 2 or more i/p signals and only one o/p signal. It has high o/p
when all i/p signals are low, otherwise it has low o/p signal
Symbol of NOR gate Logical Structure of NORgate truth table
A B Y= A B
0 0 1
0 1 0
1 0 0
1 1 0
In logical structure OR gate followed by NOT gate. So it is
also called NOT-OR gate.
Demorgan’s Theorems
Demorgan, a mathematician, proposed two theorems that are an important part of
Boolean algebra.
First Theorem:
The complement of a product of variables is equal to the sum of the complements
of the variables.
ΑB Α B
Proof:
Case1: A=0, B=0
ΑB 0 . 0 0 1
Α B 0 0 11 1
Case2: A=0, B=1
ΑB 0 .1 0 1
Α B 0 1 1 0 1
Case3: A=1, B=0
ΑB 1. 0 0 1
Α B 1 0 0 1 1
Case4: A=1, B=1
ΑB 1.1 1 0
Α B 1 1 0 0 0
Truth Table
A B AB ΑB Α B Α B
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
Second Theorem:
The complement of a sum of variables is equal to the product of the complements
of the variables.
Α B Α . B
Proof:
Case1: A=0, B=0
Α B 0 0 0 1
Α . B 0 . 0 1. 1 1
Case2: A=0, B=1
Α B 0 1 1 0
Α . B 0 . 1 1.0 0
Case3: A=1, B=0
Α B 1 0 1 0
Α . B 1. 0 0 .1 0
Case4: A=1, B=1
Α B 1 1 1 0
Α . B 1. 1 0 . 0 0
Truth Table
A B A+B Α B Α B Α .B
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
A B Y= AB
0 0 1
0 1 1
1 0 1
AND gate using NAND gates. 1 1 0
A B Y= A B
0 0 1
0 1 0
1 0 0
1 1 0
OR gate using NOR gates.
AB A B = AB. A B = ( A B). ( A B) = AA AB AB BB = A B AB = A B
BOOLEAN ALGEBRA AND THEOREMS
The operation of almost all modern digital computers is based on binary systems.
Boolean Algebra is used to analyze and simplify the digital logic circuits. It uses
only the binary numbers i.e. 0 and 1. It is also called as Binary Algebra or logical
Algebra. Boolean algebra was invented by George Boole in 1854.
Rule in Boolean Algebra
Following are the important rules used in Boolean algebra.
1. Variable used can have only two values. Binary 1 for HIGH and Binary 0 for
LOW.
2. Complement of a variable is represented by an overbar − . Thus, complement of
variable A is represented as Α .
3. Logical ORing of the variables is represented by a plus + sign between them. For
example ORing of A, B, C is represented as A + B + C.
4. Logical ANDing of the two or more variable is represented by writing a dot ( . )
between them such as A.B.C. Sometime the dot may be omitted like ABC.
Boolean Laws
There are six types of Boolean Laws.
Commutative law
Commutative law states that changing the sequence of the variables does not have
any effect on the output of a logic circuit.
A.B= B. A
A+ B = B + A
Associative law
This law states that the order in which the logic operations are performed is
irrelevant as their effect is the same.
(A . B) . C = A . (B . C)
(A + B) + C = A + (B + C)
Distributive law
Distributive law states the following condition.
A . (B + C) = A . B + A . C
A + (B . C) = (A + B) . (A + C)
AND laws
These laws use the AND operation. Therefore they are called as AND laws.
A.0=0
A.1= A
A . A= A
A.Α =0
OR laws
These laws use the OR operation. Therefore they are called as OR laws.
A+ 0 = A
A+ 1 = 1
A+ A= A
A+ Α = 1
NOT law
This law uses the NOT operation. The NOT law states that double inversion of a
variable results in the original variable itself.
Α Α
Some simple logic expressions
A + AB = A
A . (A+B) = A
A+ ΑB = A + B
(A+B)(A+C) = A+BC
AB + BC + C A = AB+C
Ex: Simplify A + AB
A + AB = A( 1 + B)
=A.l
=A
Ex: Simplify Α AB
Α AB = Α AB AB
= ΑA AB AB
= ΑA AB AA AB
= Α A Α B
= 1.Α B Α B
Ex: Simplify (A + B)(A + C)
(A + B)(A + C) = AA + AC + AB + BC
= A +AC +AB +BC
= A(1+C) + AB + BC
= A . 1 + AB + BC
= A + AB + BC
= A(1 + B) + BC
= A .1 + BC
= A + BC
Ex: Simplify (Α B) (Α B ) Α
(Α B) (Α B ) = ΑA AB BA BB
= A A(B B) 0
= A A(1) = A A = A
Ex: Simplify (Α B) (Α B ) (Α C) AC
(Α B) (Α B ) (Α C) = (ΑΑ AB BA BB)( Α C)
= Α ( Α C) = Α Α ΑC = 0 ΑC = AC
Ex: Simplify ΑBC ΑBC ΑBC
ΑBC ΑBC ΑBC = ΑB(C C) ΑBC
= ΑB ΑBC = Α(B BC) = Α(B C) = ΑB ΑC
Ex: Simplify ( Α B C) ( Α B C)
( Α B C) ( Α B C) = (Α B C) ( Α B C)
= ( Α .B. C) (Α . B. C)
= (Α . B. C) (Α. B. C) = Α B (C C) = Α B
Ex: Simplify A B C
A B C = ( AB AB) C
= ( AB AB). C (AB AB). C
= ( AB. AB). C ABC ABC
= ((A B)(A B)).C ABC ABC
= (A A B A AB BB). C ABC ABC
= ABC ABC ABC ABC
Ex: Simplify AB (A B)C
AB (A B)C = AB ( AB AB)C
= AB ABC ABC
= B(A AC) ABC
= B(A C) ABC = BA BC ABC
= BA C(B AB) = BA C(B A) = AB BC AC
Ex: Simplify 1. ( Α B C) ( Α B C) ,
2. AB+ABC,
3. Α B C Α BC
4. Α BC Α BC AB
5. A B C Α B C
A B, A B, A B and A B
For a 3-variable (A, B and C) Boolean function, the possible maxterms are:
A B C, A B C, A B C, A B C, A B C, A B C, A B C, and A B C
Note that each minterm is complement of its corresponding maxterm or vice versa.
From above table minterms are ABC, ABC, ABC, ABC and ABC
f m1 m2 m4 m5 m7
Now consider complement of Boolean function from truth table by forming a
maxterm for each combination that produced ‘0’ and then take AND of those
maxterms.
f m1 m2 m4 m5 m7
f m(1, 2, 4, 5, 7)
Product of Sums (POS) Form
The product of sums (POS) form is a method of simplifying the Boolean
expressions of logic gates. In this POS form, all the variables are ORed, i.e. written
as sums to form sum terms. All these sum terms are ANDed together to get the
product-of-sum form. This form is exactly opposite to the SOP form. So this can
also be said as “Dual of SOP form”.
From above table f (A B C).(A B C).( A B C)
f M0.M3.M6
f M( 0, 3, 6)
C C CD CD CD CD
B B
AB AB
A
AB AB
A
AB AB
2 variable k-map
AB AB
3 variable k-map 4 variable k-map
In the K-map there are 2 pairs. The above K-map gives two minterms AC, AB
CD CD CD CD
AB 1 0 1 1
AB 0 0 1 1
AB 0 1 0 0
AB 1 1 1 0
f (B C D)(A C D) (A B C) (A C D)
The four groupings are pairs and 2Groups involved in over lapping.
Now terms obtained from these groupings are
(B C D),(A C D) ,(A B C) ,(A C D)
f (B C D)(A C D) (A B C) ( A C D)
f BD B C
Before simplification the Boolean function is
f ABCD ABCD ABCD ABCD, The X in the above stand for "don’t care", we
don't care whether a 1 or 0 is the value for that combination of inputs because the
inputs will never occur.
UNIT – III
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Full Adder
A full adder has three inputs A, B, and C. A full adder is a logical circuit that
performs an addition operation on three binary digits. The full adder produces a
sum(S) and carry(Co), which are both binary digits.
Block diagram
Inputs Outputs
A B C S Co
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
Sum (S) = A B C 1 1 0 0 1
1 1 1 1 1
A B C = ( AB AB) C
= ( AB AB) . C (AB AB). C
= ( AB. AB). C ABC ABC
= ((A B)( A B)). C ABC ABC
= (A A BA AB BB). C ABC ABC
= ABC ABC ABC ABC
Carry (C 0 )= AB (A B)C
AB (A B)C = AB (AB AB)C
= AB ABC ABC
= B(A AC) ABC
= B(A C) ABC = BA BC ABC
= BA C(B AB) = BA C(B A) = AB BC AC
Subtractor
In electronics, a subtractor can be designed using the same approach as
that of an adder.
Half subtractor
A combinational circuit which is used to perform subtraction of two bits and it
has two inputs, A (minuend) and B (subtrahend) and two outputs D (difference) and
Br (borrow). Such a circuit is called a half-subtractor because it enables borrow out
of the current arithmetic operation but no borrow in from a previous arithmetic
operation.
Truth table
Block diagram Logical circuit of Half Subtractor
A B D Br
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Br = A B
Full Subtractor
A full subtractor is made by combining two half-subtractors and an additional
OR-gate.
The truth table for a full subtractor
Block diagram A B C D Br
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
A4 A3 A2 A1 1011
B4 B 3 B2 B1 1101
C 4 S4 S3 S2 S1 11000
As the above circuit can only compare two single bit binary numbers, it is
called single bit digital comparator.
There are N bit binary comparators to compare multi bit binary numbers
which are normally4 bits and above.
Integrated circuit- IC (Scale integration component )
Digital circuits are constructed with integrated circuit (IC). An IC is a small
silicon semiconductor crystal called chip containing the electronic component for
digital gates. The various gates are interconnected inside the chip to form the
required circuit.
Digital IC are categorized according to their circuit complexity as measured
by the number of logic gates in a single packages.
Small scale integration (SSI). SSI devices contain fewer than 10 gates. The
input and output of the gates are connected directly to the pins in the
package.
Medium Scale Integration. MSI devices have the complexity of
approximately 10 to 100 gates in a single package.
Large Scale Integration (LSI). LSI devices contain between 100 and a few
thousand gates in a single package.
Very Large Scale Integration (VLSI). VLSI de vices contain thousand of gates
within a single package. VLSI devices have use in the computer system
design technology.
Multiplexers
A multiplexer or MUX, also called a data
selector, is a special type of combinational circuit.
It is a digital circuit which selects one of the data
input and routes it to the output. The selection of
one of the input is done by the selected inputs.
Depending on the digital code applied at the
selected inputs, one out of input data sources is
selected and transmitted to the single output Y. E
is called the strobe or enable input which is useful for the cascading.
If there are n selection lines, then the number of maximum possible input
lines is 2n and the multiplexer is referred to as a 2 n -to-1 multiplexer or 2 n x1
multiplexer.
2 X1 multiplexer
The 2-to-1 multiplexer, the functional table, the logic diagram of this
multiplexer shown in the above figs.
The circuit functions as follows:
For S = 0, the output becomes Y = I 0.
For S = 1, the output becomes Y = I 1.
Thus, inputs I0 and I1 are respectively switched to the output for S = 0 and S = 1.
2 X1 multiplexer with Enable
Multiplexers usually have an ENABLE input that can be used to control the
multiplexing function. When this input is enabled, that is, when it is in logic ‘1’ or
logic ‘0’ state, depending upon whether the ENABLE input is active HIGH or active
LOW respectively, the output is enabled. When the ENABLE input is inactive, the
output is disabled Figure shows 2-to-1 multiplexer can be modified to include an
ENABLE input. The functional table of this modified multiplexer is also shown in
Fig. The ENABLE input here is active when HIGH.
4 X1 multiplexer
The 4-to-1 multiplexer, the functional table, the logic diagram of this
multiplexer shown in the above figs.
The circuit functions as follows:
For S1 = 0, S0 = 0 the output becomes Y = I0.
For S1 = 0, S0 = 1 the output becomes Y = I1
For S1 = 1, S0 = 0 the output becomes Y = I2
For S1 = 1, S0 = 1 the output becomes Y = I3
Thus, the input combinations 00, 01, 10 and 11 on the selection lines respectively
switch I0, I 1, I2 and I3 to the output.
4 X1 multiplexer with Enable
Multiplexers usually have an ENABLE input that can be used to control the
multiplexing function. When this input is enabled, that is, when it is in logic ‘1’ or
logic ‘0’ state, depending upon whether the ENABLE input is active HIGH or active
LOW respectively, the output is enabled. When the ENABLE input is inactive, the
output is disabled Figure shows 4-to-1 multiplexer can be modified to include an
ENABLE input. The functional table of this modified multiplexer is also shown in
Fig. The ENABLE input here is active when LOW.
Decoders
A decoder is a combinational circuit that decodes the information on n input lines to
a maximum of 2 n unique output lines. Decoder is identical to a demultiplexer
without any data input. It performs operations which are exactly opposite to those of
an encoder.
Fig shows a decoder has n- inputs and 2 n outputs. Fig shows the block diagram of a typical
decoder with enable line.
3-to-8 decoder
Figure shows 3-to-8 line decoder with
enable input. In a 3 to 8 decoder, there are three
inputs and eight outputs, as shown in figure. The
three inputs are decoded into eight outputs. i.e.,
binary values at the input form a combination,
and based on this combination, the
corresponding output line is activated. Each
output represents one minterm. For example, for
input combination ABC = 001, output line D1
equals 1 while all other output lines equal 0s. It should be noted that at any given
instance of time, one and only one output line can be activated.
Encoders
An Encoder is a combinational circuit which is designed to perform the
inverse operation of the decoder and it is a multiplexer without its single output line.
Encoder has 2n input lines and n output lines, which corresponds to n selection
lines in a multiplexer. The n output lines generate the binary code for the possible
2n input lines. The o/p lines generate binary code corresponding to i/p. Figure
shows 2n X n encoder
8-to-3 encoder
Figure shows 8-to-3 encoder. Let us
take the case of an octal-to-binary encoder. In
this encoder there are eight input lines, each
representing an octal digit, and three output
lines representing the three-bit binary
equivalent. The truth table of such an encoder
is given in Table. In the truth table, D0 to D7
represent octal digits 0 to 7. A, B and C
represent the binary digits.
A B X = AB
0 0 1
0 1 1
1 0 1
1 1 0
When both input A and B are given with 0 V, both of the diodes are in
forward biased condition that is in ON condition. Supply voltage will get path to the
ground through diode D 1 and D2. Entire VCC +5 V will ideally drop across resistor R
and hence base terminal of transistor T will not get enough potential to turn ON,
and hence the transistor will be in OFF condition. As a result VCC +5 V will appear
at output terminal X and hence output X will become high or logical 1.
Now if either of diode D1 and D2, is applied with 0 V, the same thing happens
as in these cases also the supply voltage gets a path to the ground either of the
forward biased diode. In those cases also the output will be logical high or 1
When both of the inputs are given with +5 V that is logical 1, both of the
diodes are in OFF condition and hence supply voltage will appear at the base
terminal of the transistor T which makes it switched ON and supply voltage gets a
path to the ground through T. i.e., entire VCC +5 V will drop across resistor R’ and
output terminal X will get ‘0’ volts and hence the output is considered as logical 0.
Hence, the output is 0 only when both inputs are +5 V or logical 1.
NOR Gate using DTL
NOR gate circuit by using diodes and transistors is called DTL NOR gate or
Diode Transistor Logical NOR Gate.
A B X= A B
0 0 1
0 1 0
1 0 0
1 1 0
When both input A and B are given with 0 V, both of the diodes are in
Reverse biased condition that is in OFF condition. Base terminal of transistor T will
not get enough potential to turn ON, and hence the transistor will be in OFF
condition. As a result VCC +5 V will appear at output terminal X and hence output X
will become high or logical 1.
Now if either of i/p A or B or both of the inputs are given with +5 V that is
logical 1, both of the diodes or corresponding diode D 1 or D 2 is in ON condition and
hence high voltage will appear at the base terminal of the transistor T which makes
it switched ON and supply voltage gets a path to the ground through T. i.e., entire
VCC +5 V will drop across resistor R’ and output terminal X will get ‘0’ volts and
hence the output is considered as logical 0.
Hence, the output is 1 when both inputs are 0 V or logical 0.
NOR gate using Resistor Transistor Logic (RTL)
A B X= A B
0 0 1
0 1 0
1 0 0
1 1 0
A NOR gate can be realized by using two bipolar junction transistors. The circuit is
shown in fig.. This circuit is made by two parallel connected transistors
In the circuit when both A and B are given +5 V, base of the both transistors
get a high potential to make the transistors ‘ON’. As both transistors T1 and T2 are
in ON condition, supply voltage at terminal C gets path to the ground through
transistors. and hence o/p will be at logical 0 state.
Now, if either of inputs A and B is given with +5 V, the only corresponding
transistor will be in ON condition. But in this case also supply voltage will get path
to the ground and similarly the output will be in logical 0.
Now if both of the inputs A and B are given with 0 V or grounded, both
transistors will be in OFF condition as in this case the base of both transistors does
not have enough potential to make the transistors ON.
As the supply voltage will not get any path to the ground, the supply voltage
will appear at output X, hence output is in logical 1 or high.
Hence, in the circuit, the output is 1, only when both of the inputs are 0 and
in all other conditions, the output is 0.
CMOS Digital Logic
One of the main disadvantages with the TTL digital logic gate series is that
the logic gates are based on bipolar transistor logic technology and as transistors
are current operated devices, they consume large amounts of power from a fixed
+5 volt power supply. Also, TTL bipolar transistor gates have a limited operating
speed when switching from an “OFF” state to an “ON” state and vice-versa called
the “gate” or “propagation delay”. To overcome these limitations complementary
MOS (CMOS) logic gates using “Field Effect Transistors” or FET’s.
As these gates use both P-channel and N-channel MOSFET’s as their input
device, at quiescent conditions with no switching, the power consumption of CMOS
gates is almost zero,
NAND gate using CMOS Digital Logic
A B X = AB
0 0 1
0 1 1
1 0 1
1 1 0
The above figure shows CMOS NAND gate and it contains 2 N channel
MOS FETs (Q3 and Q4) and 2 P channel MOSFETs (Q1 and Q2). The FETs Q1 and
Q3 are controlled by same input signal (input A), the upper FET Q1 is turning OFF
and lower FET Q3 is turning ON when input is high and vice versa. Similarly FETS
Q2 and Q4 are controlled by same input B.
When one or both of the inputs are at logic 0, the corresponding FET Q1 or
Q2 or both are in ON and the corresponding FET Q3 or Q4 or both are in cut-off.
Hence, the output is at logic 1.
When both of the inputs are at logic 1, the FETs Q1 and Q2 are in cut-off and
FETs Q3 and Q4 are in ON. Hence, the output is at logic 0.
Truth table of NAND is gate shown in the table.
NOR gate using CMOS Digital Logic
A B X= A B
0 0 1
0 1 0
1 0 0
1 1 0
The above figure shows CMOS NOR gate and it contains 2 N channel MOS
FETs (Q3 and Q4) and 2 P channel MOSFETs (Q1 and Q2). The FETs Q1 and Q 3 are
controlled by same input signal (input A), the upper FET Q 1 is turning OFF and
lower FET Q3 is turning ON when input is high and vice versa. Similarly FETS Q2
and Q4 are controlled by same input B.
When both of the inputs are at logic 0, the FETs Q1 and Q2 are in ON and
FETs Q3 and Q4 are in cut-off. Hence, the output is at logic 1.
When one or both of the inputs are at logic 1, current flows through the
corresponding FET giving output state at logic 0.
Truth table of NOR is gate shown in the table.
Bi-CMOS Inverter
Two bipolar transistors (T3 and T4), one nMOS and one pMOS transistor (both
enhancement-type devices, OFF at Vin=0V)
The MOS switches perform the logic function &
bipolar transistors drive output loads
Vin = 0 :
T1 is OFF. Therefore T3 is non-conducting
T2 ON - supplies current to base of T4
T4 base voltage set to Vdd.
T4 conducts & acts as current source to charge load
CL towards Vdd.
Vout rises to Vdd (i.e. Vout =1)
Vin = Vdd (1)
T2 is off. Therefore T4 is non-conducting.
T1 is on and supplies current to the base of T3
T3 conducts & acts as a current sink to discharge load C L towards 0V.
Vout falls to 0V
• Inverter has high input impedance, i.e., MOS gate input
• Inverter has low output impedance
• Inverter has high drive capability but occupies a relatively small area
• However, this is not a good arrangement to implement since no discharge
path exists for current from the base of either bipolar transis tor when it is
being turned off. hence, this will slow down the action of the circuit
UNIT – IV
S R Q Q Comment
0 0 NC No Change
0 1 0 1 Reset (0)
1 0 1 0 Set (1)
1 1 X X Indeterminate
NOR gate always gives output 0 when at least one of the inputs is 1.
Case-1 if S = 1 and R = 0.
A clocked S-R flip flop is designed by adding two AND gates to a basic NOR
Gate flip flop. The circuit diagram and truth table are shown figs.
Case-1
A clock pulse (Clk) is given to the inputs of the AND Gate. When the value of
the clock pulse is ‘0’, the outputs of both the AND Gates remain ‘0’. i.e., with clk=0,
the SR FF is in No Change condition.
Case-2 Clk=1, S = 1 and R = 0.
In this case S’=1 and R’=0, the o/p of Clk SR FF is Q = 1 and Q = 0 when, S
= 1 and R = 0. This is called SET condition of the flip flop.
In this case S’=0 and R’=1, the o/p of Clk SR FF is Q = 0 and Q = 1 when, S
= 0 and R = 1. This is called RESET condition of the flip flop.
Case - 4 Clk=1, S = 0 and also R = 0.
In this case S’=0 and R’=0, the o/p of Clk SR FF is Q remains same as it is
when S = 0 and R = 0, This is called No Change condition of the flip flop.
Case - 5 Clk=1, S = 1 and also R = 1.
In this case S’=1 and R’=1, the o/p of Clk SR FF is Q = 0 and Q = 0 when, S
= 1 and R = 1. This is called Not Allowed condition of the flip flop.
JK Flip-Flop
A JK flip-flop is a modification of the SR flip-flop in
that the indeterminate state of the SR type is defined in the
JK type. Inputs J and K behave like inputs S and R to set
and clear the flip-flop. Note that in a JK flip-flop, the i/p J is
for set and the i/p K is for reset as S and R in SR FF. When
logic 1 inputs are applied to both J and K simultaneously, the flip-flop switches to its
complement state, ie., if Q=1, it switches to Q=0 and vice versa.
Clk J K Q Q Comment
0 X X NC No Change
1 0 0 NC No Change
1 0 1 0 1 Reset (0)
1 1 0 1 0 Set (1)
1 1 1 T Toggle
Case3: Clk=1, J = 0, K = 1, Q = 1 and Q = 0. This results S=0 and R=1. Then the
output 1st NOR gate will become 0 (Q=0) as R = 1 and Q = 0, while the output of
2nd Nor gate become 1 ( Q =1) as S = 0 and Q = 0. Thus o/p gets Q = 0 and Q = 1.
This implies that if J = 0 and K = 1, then the flip-flop resets (Q = 0 and Q = 1).
Case4: Clk=1, J = 1, K = 0, Q = 0 and Q = 1. This results S=1 and R=0. Then the
output of 2nd Nor gate become 0 ( Q =0) as S = 1 and Q = 0, while the output 1 st
NOR gate will become 1 (Q=1) as R = 0 and Q = 0. Thus o/p gets Q = 1 and Q =
0. This means that for the case of J = 1 and K = 0, flip-flop output will always be set
(Q = 1 and Q = 0).
Case5: Clk=1, J = K = 1, Q = 1 and Q = 0. This results S=0 and R=1. Then the
output 1st NOR gate will become 0 (Q=0) as R = 1 and Q = 0, while the output of
2nd Nor gate become 1 (Q =1) as S = 0 and Q = 0. Thus o/p gets Q = 0 and Q = 1.
This implies that if J = 1 and K = 1, then the flip-flop complements the previous
o/ps. This condition is called toggle condition of JK FF.
D Flip-Flop (Delay FF)
Clk D Q Comment
0 X NC No Change
1 0 0 Reset
1 1 1 Set
D Flip Flops are used to delay the digital signal by 1 clock period. It is
achieved by modifying JK FF b y joining the J and K i/ps by NOT gate and one i/p D
taken out as shown in figure. Thus K is Complement of J i/p.
Master-Slave JK Flip-Flop
Flip-flop Types
FLIP-
FLIP-FLOP CHARACTERISTIC CHARACTERISTIC
FLOP EXCITATION TABLE
SYMBOL TABLE EQUATION
NAME
S R Q (next) Q Q (next) S R
0 0 Q 0 0 0 X
Q (next) = S + R'Q
SR 0 1 0 0 1 1 0
SR = 0
1 0 1 1 0 0 1
1 1 ? 1 1 X 0
J K Q (next) Q Q (next) J K
0 0 Q 0 0 0 X
JK 0 1 0 Q (next) = JQ' + K'Q 0 1 1 X
1 0 1 1 0 X 1
1 1 Q' 1 1 X 0
Q Q (next) D
D Q (next) 0 0 0
D 0 0 Q (next) = D 0 1 1
1 1 1 0 0
1 1 1
Q Q (next) T
T Q (next) 0 0 0
T 0 Q Q (next) = TQ' + T'Q 0 1 1
1 Q' 1 0 1
1 1 0
Registers
A register is a sequential circuit. A register is a group of binary cells suitable
for holding binary information. A group of FFs constitutes a register, since each FF
is binary cell having capable to store 1 bit of information. An n-bit register is group
of n- flip flops capable of store n bit of binary information. Registers play an
important role in computers. Some of them are visible to the programmer, and are
used to hold variable values for later use. Some of them are hidden to the
programmer, and are used to hold values that are internal to the central processing
unit.
A register capable of shifting binary information either to the left or to the
right is called a shift register. It consists of a chain of FFs connected in cascade,
with the o/p of one FF connected to the i/p of next FF and all flip flops receives
common clk pulse that causes the shift from one stage to next stage.
Shift registers have provisions to shift data serially, parallely or both, and to
the left or to the right. The basic types of shift registers are
Fig shows block diagram of Serial In - Parallel Out shift register. Four data
bits will be shifted from “data in” by four clock pulses and be available at data out
at once.
3. Parallel In - Serial Out shift register (PISO).
Fig shows block diagram of Parallel In - Parallel Out shift register. Data in
and out take place by one clock pulse.
Serial-in to Parallel-out (SIPO) Shift Register
The operation is as follows. Lets assume that all the flip-flops ( FFA to FFD )
have been RESET ( CLEAR input ) and that all the outputs QA to QD are at logic
level “0”.
If a logic 1 is connected to the DATA input pin of FFA then on the first clock
pulse the output of FFA QA will be set “1” with all the other outputs still remaining
at “0”.
The second clock pulse will change the output of FFA to logic “0” and the
output of FFB and QB HIGH to logic “1” as its input D has the logic “1” from QA. The
logic “1” has now moved or been “shifted” one place along the register to the right
as it is now at QB.
When the third clock pulse arrives this logic “1” value moves to the output of
FFC ( QC ) and so on until the arrival of the fifth clock pulse which sets all the
outputs QA to QD back again to logic level “0” because the input to FFA has
remained constant at logic level “0”.
The effect of each clock pulse is to shift the data contents of each stage one
place to the right, and this is shown in the following table until the complete data
value of 0-0-0-1 is stored in the register. This data value can now be read directly
from the outputs of QA to QD.
Then the data has been converted from a serial data input signal to a
parallel data output. The truth table and following waveforms show the propagation
of the logic “1” through the register from left to right as follows.
Basic Data Movement through a Shift Register
Clock Pulse
QA QB QC QD
No
0 0 0 0 0
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
5 0 0 0 0
This type of Shift Register also acts as a temporary storage device or it can
act as a time delay device for the data, with the amount of time delay being
controlled by the number of stages in the register.
Parallel-in to Serial-out (PISO) Shift Register
The Parallel-in to Serial-out shift register acts in the opposite way to the
serial-in to parallel-out one above. The data is loaded into the register in a parallel
format in which all the data bits enter their inputs simultaneously, to the parallel
input pins PA to PD of the register. The data is then read out sequentially in the
normal shift-right mode from the register at Q representing the data present at PA to
PD .
This data is outputted one bit at a time on each clock cycle in a serial format.
It is important to note that with this type of data register a clock pulse is not required
to parallel load the register as it is already present, but four clock pulses are
required to unload the data.
As this type of shift register converts parallel data, such as an 8-bit data
word into serial format, it can be used to multiplex many different input lines into a
single serial DATA stream which can be sent directly to a computer or transmitted
over a communications line.
The PIPO shift register is the simplest of the four configurations as it has
only three connections, the parallel input (PI) which determines what enters the flip-
flop, the parallel output (PO) and the sequencing clock signal (Clk).
Shift Left Register
A four stage shift-left register is shown in figure. The single data input line is
connected as the D-input.
For example consider starting with all stages reset all Q-outputs to logical 0 and
applying logical 1 input as data input stage A. Table shows the data in each stage
after each of four shift pulses.
Shift Right Register
Uses of Counters
The most typical uses of counters are
To count the number of times that a certain event takes place; the
occurrence of event to be counted is represented by the input signal to
the counter.
To control a fixed sequence of actions in a digital system.
To generate timing signals.
To generate clocks of different frequencies.
CLK QB QA
0 0 0
1 0 1
2 1 0
3 1 1
4 0 0
CLK QD QC QB QA
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
The modulus is the number of unique states that counter can count. The
maximum possible number of states of a counter is 2n where n is the number of flip-
flops. Counters can be designed to have a number of states in their sequence that
is less than the maximum of 2 n. This type of sequence is called a truncated
sequence. One common modulus for counters with truncated sequences is 10
(Modules10) and is called decade counter. A decade counter requires 4 flip-flops
and counter back to initial after the count of 9 (1001). It can count total of 10
pulses from 0000 to 1001 as like mod 16 asynchronous counters. Here the output
of the NAND gate connected to the clear (CLR) inputs of the flip-flops, as shown in
Fig. this NAND gate turns the counter to it initial position when count is 1010.
CLK QD QC QB QA
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
CLK QC QB QA
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
Ripple counter are slow, because cumulative FF’s delay. A relatively simple
way to reduce the program time delay is to use a synchronous counter.
All the FFs in the synchronous counter are triggered by common clk pulse,
although the synchronous counter more complicated than ripple counter. A mod 16
synchronous counter is shown in figure.
It consists of –ve edge triggered JK FFs. Initially all the FFs are in reset
state. i.e. Q0= Q1= Q2= Q3=0, since JK FF0 have high i/p, the FF0 toggles on first –
ve clk edge and the same clk does not change state of FFs 1, 2 and 3, because
i/ps are low. Hence, at 1st clk pulse the o/p is 0001.
The first and second FFs toggles on 2 nd –ve clk pulse, because J, K i/ps of
FF0 and FF1 FFs are high. Remaing 2, 3 FFs remain in same state, because their
i/ps are low. Hence, after 2nd clk pulse counter becomes 0010
When the 3rd clk pulse arrived, the counter becomes 0011, after 1
propagation delay time, the counter becomes 0100. This process continuous up to
counter reaches 1111 and for next clk pulse the counter back to initial position or
state.
By adding more FFs and AND gates , we can construct synchronous
counter of any length. The advantage of synchronous over asynchronous is its fast
operating feature.
CLK Q3 Q2 Q1 Q0
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
Down Counter
Fig shows down counter. It counts from 1111 to 0000. each FF toggles when
it clk goes from 0 to 1. initially with the clear signal, all FFs are reset to 0 and the
o/p is 1111.
The FF0 toggles for every clk pulse.
The 1st clk pulse produces o/p word 1110
The 2nd clk pulse produces o/p word 1101
The 3rd clk pulse produces o/p word 1100
CLK Q3 Q2 Q1 Q0
0 1 1 1 1
1 1 1 1 0
2 1 1 0 1
3 1 1 0 0
4 1 0 1 1
5 1 0 1 0
6 1 0 0 1
7 1 0 0 0
8 0 1 1 1
9 0 1 1 0
10 0 1 0 1
11 0 1 0 0
12 0 0 1 1
13 0 0 1 0
14 0 0 0 1
15 0 0 0 0
Ring Counters
UNIT – V
MEMORY DEVICES
The basic goal of digital memory is to provide a means to store and access
binary data: sequences of 1’s and 0’s. The digital storage of information has
advantages over analog techniques. This is not to say that digital data storage is
extremely superior to analog, but it does address some of the more common
problems associated with analog techniques and thus finds immense popularity in
both consumer and industrial applications. Digital data storage is also use in digital
computations, and thus finds natural application in the world of computers. The
most advantage of digital data storage is the resistance to corruption.
A memory is just like a human brain. It is used to store data and instruction.
Computer memory is the storage space in computer where data is to be processed
and instructions required for processing are stored. The memory is divided into
large number of small parts. Each part is called a cell. Each location or cell has a
unique address which varies from zero to memory size minus one.
For example if computer has 64k words, then this memory unit has 64 *
1024 = 65536 memory location. The address of these locations varies from 0 to
65535.
Memory is primarily of two types
1. Internal Memory − cache memory and primary/main memory
2. External Memory − secondary memory /magnetic disk / optical disk etc.
The main memory of the computer system is volatile, it holds
information(data, programs and results) as long as power supply is on. Therefore,
to store information and supervise programs, a computer must have a permanent
storage memory. Magnetic/optical memories can used as permanent memory and
is called secondary memory.
Memory Operations in calculator
Calculator can remember results of operations for you, and reuse them in
later calculations. You can access these functions via several buttons labeled MR,
MS, M+ and MC.
MS : The MS button stores the currently displayed result in memory.
M+ : The M+ button adds the current result to the one in memory. So, if
you had stored 20, and the current result is 5, your memory would
contain 25 when you press it. If the memory is empty, it acts like MS
and simply stores the result.
MR : The MR button gets the value stored in memory and puts it in the
display.
MC : The MC button clears the memory.
Cache Memory
Cache memory is a very high speed semiconductor memory which can
speed up CPU. It acts as a buffer between the CPU and main memory. It is used to
hold those parts of data and program which are most frequently used by CPU. The
parts of data and programs, are transferred from disk to cache memory by
operating system, from where CPU can access them.
Advantages
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short period of
time.
It stores data for temporary use.
Disadvantages
Cache memory has limited capacity.
It is very e xpensive.
Auxiliary Memory
Au xiliary memory is much larger in size than main memory but is slower. It
normally stores system programs, instruction and data files. It is also known as
secondary memory. It can also be used as an overflow/virtual memory in case the
main memory capacity has been exceeded. Secondary memories cannot be
accessed directly by a processor. First the data/information of auxiliary memory is
transferred to the main memory and then that information can be accessed by the
CPU.
Programmable Logic Array (PLA)
A PLA consists of two levels of logic gates: a programmable, “wired” AND-
plane followed by a programmable, “wired” OR-plane. A PLA's structure allows any
of its inputs (or their complements) to be AND-ed together in the AND plane; each
AND plane output can thus correspond to any product term of the inputs. Similarly,
users can configure each OR plane output to produce the logical sum of any AND
plane output. With this structure, PLAs are well-suited for implementing logic
functions in sum-of-products form.
In a PLA, the number of AND functions is independent of the number of
inputs, and the number of OR functions is independent of both the number of inputs
and the number of AND functions.
Y ΑBC ΑBC
Example:
Y ΑBC ΑBC
PLAs are more flexible than PALs, but PALs operate faster, because hard-wired
connections take less time to switch than their programmable equivalents. Due to
the fact they are fast and cheap to manufacture.
Example: