Digital Logic Gates Explained
Digital Logic Gates Explained
NAND gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical AND of all those inputs.
The following table shows the truth table of 2-input NAND gate.
A B Y = (A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
The following image shows the symbol of NAND gate, which is having two inputs A, B and
one output, Y.
NAND gate operation is same as that of AND gate followed by an inverter. That’s why the
NAND gate symbol is represented like that.
NOR gate:
NOR gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical OR of all those inputs.
The following table shows the truth table of 2-input NOR gate
A B Y = (A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
The following figure shows the symbol of NOR gate, which is having two inputs A, B and one
output, Y.
NOR gate operation is same as that of OR gate followed by an inverter. That’s why the NOR
gate symbol is represented like that.
Special Gates
Ex-OR & Ex-NOR gates are called as special gates. Because, these two gates are special
cases of OR & NOR gates.
Ex-OR gate:
The full form of Ex-OR gate is Exclusive-OR gate. Its function is same as that of OR gate
except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-OR gate.
A B Y = A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
The output of Ex-OR gate is ‘1’, when only one of the two inputs is ‘1’. And it is zero, when
both inputs are same.
Below figure shows the symbol of Ex-OR gate, which is having two inputs A, B and one
output, Y.
The output of Ex-OR gate is ‘1’, when odd number of ones present at the inputs. Hence, the
output of Ex-OR gate is also called as an odd function.
Ex-NOR gate:
The full form of Ex-NOR gate is Exclusive-NOR gate. Its function is same as that of NOR
gate except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-NOR gate.
A B Y = A⊙B
0 0 1
0 1 0
1 0 0
1 1 1
The output of Ex-NOR gate is ‘1’, when both inputs are same. And it is zero, when both the
inputs are different.
The following figure shows the symbol of Ex-NOR gate, which is having two inputs A, B and
one output, Y.
The output of Ex-NOR gate is ‘1’, when even number of ones present at the inputs. Hence,
the output of Ex-NOR gate is also called as an even function.
From the above truth tables of Ex-OR & Ex-NOR logic gates, we can easily notice that the
Ex-NOR operation is just the logical inversion of Ex-OR operation.
Commutative law states that changing the sequence of the variables does not have any
effect on the output of a logic circuit.
Associative law
This law states that the order in which the logic operations are performed is irrelevant as
their effect is the same.
Distributive law
Distributive law states the following condition.
AND law
These laws use the AND operation. Therefore, they are called as AND laws.
OR law
These laws use the OR operation. Therefore, they are called as OR laws.
INVERSION law
This law uses the NOT operation. The inversion law states that double inversion of a variable
results in the original variable itself.
Boolean Function:
Boolean algebra deals with binary variables and logic operation. A Boolean Function is
described by an algebraic expression called Boolean expression which consists of binary
variables, the constants 0 and 1, and the logic operation symbols. Consider the following
example.
Here the left side of the equation represents the output Y. So we can state equation no. 1
The output will be high (1) if A = 1 or BC = 1 or both are 1. The truth table for this equation is
shown by Table (a). The number of rows in the truth table is 2 n where n is the number of input
variables (n=3 for the given equation). Hence there are 2 3 = 8 possible input combination of
inputs.
De Morgan’s 1st theorem states that the complement of the product of all the terms is equal
to the sum of the complement of each term.
(A.B)’ = A’ + B’
De Morgan’s 2nd theorem states that the complement of the sum of all the terms is equal to
the product of the complement of each term.
(A + B)’ = A’. B’
Duality Theorem:
This theorem states that the dual of the Boolean function is obtained by interchanging the
logical AND operator with logical OR operator and zeros with ones. For every Boolean
function, there will be a corresponding Dual function.
Group1 Group2
x+0=x x.1 = x
x+1=1 x.0 = 0
x+x=x x.x = x
x + x’ = 1 x.x’ = 0
Block diagram
Truth Table
Circuit Diagram
Full Adder
Full adder is developed to overcome the drawback of Half Adder circuit. It can add two one-
bit numbers A and B, and carry c. The full adder is a three input and two output combinational
circuit.
Block diagram
Truth Table
Circuit Diagram
Block diagram
Half Subtractors
Half subtractor is a combination circuit with two inputs and two outputs (difference and
borrow). It produces the difference between the two binary bits at the input and also produces
an output (Borrow) to indicate if a 1 has been borrowed. In the subtraction (A-B), A is called
as Minuend bit and B is called as Subtrahend bit.
Truth Table
Circuit Diagram
Full Subtractors
The disadvantage of a half subtractor is overcome by full subtractor. The full subtractor is a
combinational circuit with three inputs A,B,C and two output D and C'. A is the 'minuend', B
is 'subtrahend', C is the 'borrow' produced by the previous stage, D is the difference output
and C' is the borrow output.
Truth Table
Circuit Diagram
2.2 Multiplexers
Multiplexer is a special type of combinational circuit. There are n-data inputs, one output and
m select inputs with 2m = n. It is a digital circuit which selects one of the n data inputs and
routes it to the output. The selection of one of the n inputs is done by the selected inputs.
Depending on the digital code applied at the selected inputs, one out of n 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. It is generally an active low terminal that means it will perform the
required operation when it is low.
Block diagram
Multiplexers come in multiple variations
2 : 1 multiplexer
4 : 1 multiplexer
16 : 1 multiplexer
32 : 1 multiplexer
Block Diagram
Truth Table
Demultiplexers
A demultiplexer performs the reverse operation of a multiplexer i.e. it receives one input and
distributes it over several outputs. It has only one input, n outputs, m select input. At a time
only one output line is selected by the select lines and the input is transmitted to the selected
output line. A de-multiplexer is equivalent to a single pole multiple way switch as shown in
fig.
Demultiplexers comes in multiple variations.
1 : 2 demultiplexer
1 : 4 demultiplexer
1 : 16 demultiplexer
1 : 32 demultiplexer
Block diagram
Truth Table
4:1 Multiplexer
4:1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 & s0 and one output Y.
The block diagram of 4x1 Multiplexer is shown in the following figure.
One of these 4 inputs will be connected to the output based on the combination of inputs
present at these two selection lines.
Truth table of 4:1 Multiplexer is shown below.
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
From Truth table, we can directly write the Boolean function for output, Y as
𝑌 = 𝑆1′𝑆0′𝐼0 + 𝑆1′𝑆0𝐼1 + 𝑆1𝑆0′𝐼2 + 𝑆1𝑆0𝐼3
We can implement this Boolean function using Inverters, AND gates & OR gate.
The circuit diagram of 4:1 multiplexer is shown in the following figure.
We can easily understand the operation of the above circuit. Similarly, you can implement
8x1 Multiplexer and 16x1 multiplexer by following the same procedure.
1:4 De-Multiplexer
1:4 De-Multiplexer has one input I, two selection lines, s 1 & s0 and four outputs Y3, Y2, Y1 &Y0.
The block diagram of 1:4 De-Multiplexer is shown in the following figure.
The single input ‘I’ will be connected to one of the four outputs, Y 3 to Y0 based on the values
of selection lines s1 & s0. The Truth table of 1x4 De-Multiplexer is shown below.
S1 S0 Y3 Y2 Y1 Y0
0 0 0 0 0 I
0 1 0 0 I 0
1 0 0 I 0 0
1 1 I 0 0 0
From the above Truth table, we can directly write the Boolean functions for each output as
𝑌3 = 𝑠1 𝑠0 𝐼
𝑌2 = 𝑠1𝑠0′𝐼
𝑌1 = 𝑠1′𝑠0𝐼
𝑌0 = 𝑠1′𝑠0′𝐼
We can implement these Boolean functions using Inverters & 3-input AND gates.
The circuit diagram of 1:4 De-Multiplexer is shown in the following figure.
Decoder
A decoder is a combinational circuit. It has n input and to a maximum m = 2n outputs. Decoder
is identical to a demultiplexer without any data input. It performs operations which are exactly
opposite to those of an encoder.
Block diagram
Examples of Decoders are following.
Code converters
BCD to seven segment decoders
2 to 4 Decoder
Let 2 to 4 Decoder has two inputs A 1 & A0 and four outputs Y3, Y2, Y1 & Y0.
The block diagram of 2 to 4 decoder is shown in the following figure.
One of these four outputs will be ‘1’ for each combination of inputs when enable, E is ‘1’.
The Truth table of 2 to 4 decoder is shown below.
E A1 A0 Y3 Y2 Y1 Y0
0 x X 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
From Truth table, we can write the Boolean functions for each output as
𝑌3 = 𝐸. 𝐴1. 𝐴0
𝑌2 = 𝐸. 𝐴1. 𝐴0′
𝑌1 = 𝐸. 𝐴1′. 𝐴0
𝑌0 = 𝐸. 𝐴1′. 𝐴0′
Each output is having one product term. So, there are four product terms in total. We can
implement these four product terms by using four AND gates having three inputs each & two
inverters. The circuit diagram of 2 to 4 decoder is shown in the following figure.
Therefore, the outputs of 2 to 4 decoder are nothing but the min terms of two input variables
A1 & A0, when enable, E is equal to one. If enable, E is zero, then all the outputs of decoder
will be equal to zero.
Similarly, 3 to 8 decoder produces eight min terms of three input variables A 2, A1 & A0 and 4
to 16 decoder produces sixteen min terms of four input variables A3, A2, A1 & A0.
Encoder
Encoder is a combinational circuit which is designed to perform the inverse operation of the
decoder. An encoder has n number of input lines and m number of output lines. An encoder
produces an m bit binary code corresponding to the digital input number. The encoder
accepts an n input digital word and converts it into an m bit another digital word.
Block diagram
Priority encoders
Decimal to BCD encoder
Octal to binary encoder
Hexadecimal to binary encoder
4 to 2 Encoder
Let 4 to 2 Encoder has four inputs Y3, Y2, Y1 & Y0 and two outputs A1 & A0.
The block diagram of 4 to 2 Encoder is shown in the following figure.
At any time, only one of these 4 inputs can be ‘1’ in order to get the respective binary code
at the output. The Truth table of 4 to 2 encoder is shown below.
Inputs Outputs
Y3 Y2 Y1 Y0 A1 A0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
From Truth table, we can write the Boolean functions for each output as
𝐴1 = 𝑌3 + 𝑌2
𝐴0 = 𝑌3 + 𝑌1
We can implement the above two Boolean functions by using two input OR gates.
The circuit diagram of 4 to 2 encoder is shown in the following figure.
The above circuit diagram contains two OR gates. These OR gates encode the four inputs
with two bits
Octal to Binary Encoder
Octal to binary Encoder has eight inputs, Y7 to Y0 and three outputs A2, A1 & A0. Octal to
binary encoder is nothing but 8 to 3 encoder.
The block diagram of octal to binary Encoder is shown in the following figure.
At any time, only one of these eight inputs can be ‘1’ in order to get the respective binary
code. The Truth table of octal to binary encoder is shown below.
Inputs Outputs
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 A2 A1 A0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
From Truth table, we can write the Boolean functions for each output as
𝐴2 = 𝑌7 + 𝑌6 + 𝑌5 + 𝑌4
𝐴1 = 𝑌7 + 𝑌6 + 𝑌3 + 𝑌2
𝐴0 = 𝑌7 + 𝑌5 + 𝑌3 + 𝑌1
We can implement the above Boolean functions by using four input OR gates.
The circuit diagram of octal to binary encoder is shown in the following figure.
The above circuit diagram contains three 4-input OR gates. These OR gates encode the eight
inputs with three bits.
Digital comparator
The Digital Comparator is another very useful combinational logic circuit used to compare the
value of two binary digits.
Then the operation of a 1-bit digital comparator is given in the following Truth Table.
8 1 1 1 1 1 1 1
9 1 1 1 1 0 1 1
Therefore, Boolean expression for each decimal digit which requires respective light emitting
diodes (LEDs) are ON or OFF.
UNIT-3
Sequential Logic Circuits
3.1 principles of flip-flops:
Sequential circuit contains a set of inputs and outputs. The outputs of sequential circuit
depend not only on the combination of present inputs but also on the previous outputs.
Previous output is nothing but the present state. Therefore, sequential circuits contain
combinational circuits along with memory storage elements. Some sequential circuits may
not contain combinational circuits, but only memory elements.
Following table shows the differences between combinational circuits and sequential
circuits.
Outputs depend only on present Outputs depend on both present inputs and
inputs. present state.
If some or all the outputs of a sequential circuit do not change affect with respect to active
transition of clock signal, then that sequential circuit is called as Asynchronous sequential
circuit. That means, all the outputs of asynchronous sequential circuits do not
change affect at the same time. Therefore, most of the outputs of asynchronous sequential
circuits are not in synchronous with either only positive edges or only negative edges of
clock signal.
If all the outputs of a sequential circuit change affect with respect to active transition of clock
signal, then that sequential circuit is called as Synchronous sequential circuit. That means,
all the outputs of synchronous sequential circuits change affect at the same time. Therefore,
the outputs of synchronous sequential circuits are in synchronous with either only positive
edges or only negative edges of clock signal.
Clock Signal and Triggering
Clock signal
Clock signal is a periodic signal and its ON time and OFF time need not be the same. We
can represent the clock signal as a square wave, when both its ON time and OFF time are
same. This clock signal is shown in the following figure.
Types of Triggering
Following are the two possible types of triggering that are used in sequential circuits.
Level triggering
Edge triggering
Level triggering
There are two levels, namely logic High and logic Low in clock signal. Following are the
two types of level triggering.
If the sequential circuit is operated with the clock signal when it is in Logic Low, then that
type of triggering is known as Negative level triggering. It is highlighted in the following
figure.
Edge triggering
There are two types of transitions that occur in clock signal. That means, the clock signal
transitions either from Logic Low to Logic High or Logic High to Logic Low.
Following are the two types of edge triggering based on the transitions of clock signal.
If the sequential circuit is operated with the clock signal that is transitioning from Logic High
to Logic Low, then that type of triggering is known as Negative edge triggering. It is also
called as falling edge triggering. It is shown in the following figure.
There are two types of memory elements based on the type of triggering that is suitable to
operate it.
Latches
Flip-flops
Latches operate with enable signal, which is level sensitive. Whereas, flip-flops are edge
sensitive.
There are 4 types of flip flops:
SR Flip-Flop
D Flip-Flop
JK Flip-Flop
T Flip-Flop
3.2 SR Flip-Flop
SR flip-flop operates with only positive clock transitions or negative clock transitions.
Whereas, SR latch operates with enable signal.
The circuit diagram of SR flip-flop is shown in the following figure.
This circuit has two inputs S & R and two outputs Q& Q’. The operation of SR flipflop is similar
to SR Latch. But, this flip-flop affects the outputs only when positive transition of the clock
signal is applied instead of active enable.
The following table shows the state table of SR flip-flop.
S R Qt+1
0 0 Q
0 1 0
1 0 1
1 1 -
Here, Q & Qt+1 are present state & next state respectively. So, SR flip-flop can be used for
one of these three functions such as Hold, Reset & Set based on the input conditions, when
positive transition of clock signal is applied.
D Flip-Flop
D flip-flop operates with only positive clock transitions or negative clock transitions. Whereas,
D latch operates with enable signal. That means, the output of D flip-flop is insensitive to the
changes in the input, D except for active transition of the clock signal.
The circuit diagram of D flip-flop is shown in the following figure.
This circuit has single input D and two outputs Q & Q’. The operation of D flip-flop is similar
to D Latch. But, this flip-flop affects the outputs only when positive transition of the clock
signal is applied instead of active enable.
The following table shows the state table of D flip-flop.
D Qt + 1
0 0
1 1
Therefore, D flip-flop always Hold the information, which is available on data input, D of earlier
positive transition of clock signal.
D flip-flops can be used in registers, shift registers and some of the counters.
JK Flip-Flop
JK flip-flop is the modified version of SR flip-flop. It operates with only positive clock
transitions or negative clock transitions.
The circuit diagram of JK flip-flop is shown in the following figure.
This circuit has two inputs J & K and two outputs Q & Q’. The operation of JK flip-flop is similar
to SR flip-flop.
The following table shows the state table of JK flip-flop.
J K Qt+1
0 0 Q
0 1 0
1 0 1
1 1 Q'
Here, Q & Qt+1 are present state & next state respectively. So, JK flip-flop can be used for
one of these four functions such as Hold, Reset, Set & Complement of present state based
on the input conditions, when positive transition of clock signal is applied.
Master-Slave JK Flip Flop
In "JK Flip Flop", when both the inputs and CLK set to 1 for a long time, then Q output toggle
until the CLK is 1. Thus, the uncertain or unreliable output produces. This problem is referred
to as a race-round condition in JK flip-flop and avoided by ensuring that the CLK set to 1
only for a very short time.
Explanation
The master-slave flip flop is constructed by combining two J K flip flop. These flip flops are
connected in a series configuration. In these two flip flops, the 1st flip flop work as "master",
called the master flip flop, and the 2nd work as a "slave", called slave flip flop.
In "master-slave flip flop", apart from these two flip flops, an inverter or NOT gate is also used.
For passing the inverted clock pulse to the "slave" flip flop, the inverter is connected to the
clock's pulse. In simple words, when CP set to false for "master", then CP is set to true for
"slave", and when CP set to true for "master", then CP is set to false for "slave".
Working:
o When the clock pulse is true, the slave flip flop will be in the isolated state, and the
system's state may be affected by the J and K inputs. The "slave" remains isolated
until the CP is 1. When the CP set to 0, the master flip-flop passes the information to
the slave flip flop to obtain the output.
o The master flip flop responds first from the slave because the master flip flop is the
positive level trigger, and the slave flip flop is the negative level trigger.
o The output Q'=1 of the master flip flop is passed to the slave flip flop as an input K
when the input J set to 0 and K set to 1. The clock forces the slave flip flop to work as
reset, and then the slave copies the master flip flop.
o When J=1, and K=0, the output Q=1 is passed to the J input of the slave. The clock's
negative transition sets the slave and copies the master.
o The master flip flop toggles on the clock's positive transition when the inputs J and K
set to 1. At that time, the slave flip flop toggles on the clock's negative transition.
o The flip flop will be disabled, and Q remains unchanged when both the inputs of the
JK flip flop set to 0.
o When the clock pulse set to 1, the output of the master flip flop will be one until the
clock input remains 0.
o When the clock pulse becomes high again, then the master's output is 0, which will be
set to 1 when the clock becomes one again.
o The master flip flop is operational when the clock pulse is 1. The slave's output remains
0 until the clock is not set to 0 because the slave flip flop is not operational.
o The slave flip flop is operational when the clock pulse is 0. The output of the master
remains one until the clock is not set to 0 again.
o Toggling occurs during the entire process because the output changes once in the
cycle.
T Flip-Flop
T flip-flop is the simplified version of JK flip-flop. It is obtained by connecting the same input
‘T’ to both inputs of JK flip-flop. It operates with only positive clock transitions or negative
clock transitions.
The circuit diagram of T flip-flop is shown in the following figure.
This circuit has single input T and two outputs Q & Q’. The operation of T flip-flop is same as
that of JK flip-flop. Here, we considered the inputs of JK flip-flop as J = T and K = T in order
to utilize the modified JK flip-flop for 2 combinations of inputs. So, we eliminated the other
two combinations of J & K, for which those two values are complement to each other in T flip-
flop.
The following table shows the state table of T flip-flop.
D Qt+1
0 Q
1 Q’
Here, Q & Qt+1 are present state & next state respectively. So, T flip-flop can be used for
one of these two functions such as Hold, & Complement of present state based on the input
conditions, when positive transition of clock signal is applied.
The output of T flip-flop always toggles for every positive transition of the clock signal, when
input T remains at logic High 11. Hence, T flip-flop can be used in counters.
UNIT-4
Registers, memories and PLD
4.1 Shift register
Flip flops can be used to store a single bit of binary data (1or 0).
However, in order to store multiple bits of data, we need multiple flip flops. N flip flops
are to be connected in an order to store n bits of data.
A Register is a device which is used to store such information. It is a group of flip
flops connected in series used to store multiple bits of data.
The information stored within these registers can be transferred with the help of shift
registers.
Shift Register is a group of flip flops used to store multiple bits of data. The bits stored
in such registers can be made to move within the registers and in/out of the registers
by applying clock pulses.
An n-bit shift register can be formed by connecting n flip-flops where each flip flop
stores a single bit of data.
Shift registers are basically of 4 types. These are:
1. Serial In Serial Out shift register
2. Serial In parallel Out shift register
3. Parallel In Serial Out shift register
4. Parallel In parallel Out shift register
4.3 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. Counters are of two types.
Up counters
Down counters
Up/Down counters
UP/DOWN Counter
Up counter and down counter is combined together to obtain an UP/DOWN counter. A mode
control (M) input is also provided to select either up or down mode. A combinational circuit is
required to be designed and used between each pair of flip-flop in order to achieve the
up/down operation.
Clock
pulse 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 0 0 0 0
We see from circuit diagram that we have used NAND gate for Q3 and Q1 and feeding this
to clear input line because binary representation of 10 is—1010
And we see Q3 and Q1 are 1 here, if we give NAND of these two bits to clear input then
counter will be clear at 10 and again start from beginning.
Synchronous counters
If the "clock" pulses are applied to all the flip-flops in a counter simultaneously, then such a
counter is called as synchronous counter.
2-bit Synchronous up counter
The JA and KA inputs of FF-A are tied to logic 1. So, FF-A will work as a toggle flip-flop. The
JB and KB inputs are connected to QA.
Operation
S.N. Condition Operation
1 Initially let both the FFs be in the reset state QBQA = 00 initially.
Ring counter
The clock pulse (CLK) is applied to all the flip-flop simultaneously. Therefore, it is a
Synchronous Counter.
Also, here we use Overriding input (ORI) to each flip-flop. Preset (PR) and Clear
(CLR) are used as ORI.
When PR is 0, then the output is 1. And when CLR is 0, then the output is 0. Both
PR and CLR are active low signal that is always works in value 0.
PR = 0, Q = 1
CLR = 0, Q = 0
These two values are always fixed. They are independent with the value of input D
and the Clock pulse (CLK).
Working–
Here, ORI is connected to Preset (PR) in FF-0 and it is connected to Clear (CLR) in
FF-1, FF-2, and FF-3.
Thus, output Q = 1 is generated at FF-0 and rest of the flip-flop generate output Q =
0.
This output Q = 1 at FF-0 is known as Pre-set 1 which is used to form the ring in the
Ring Counter.
This Preseted 1 is generated by making ORI low and that time Clock (CLK) becomes
don’t care.
After that ORI made to high and apply low clock pulse signal as the Clock (CLK) is
negative edge triggered.
After that, at each clock pulse the preseted 1 is shifted to the next flip -flop and thus
form Ring.
From the above table, we can say that there are 4 states in 4-bit Ring Counter.
4 states are:
1000
0100
0010
0001
4.5 Concept of memories
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
Internal Memory − cache memory and primary/main memory
External Memory − magnetic disk / optical disk etc.
RAM
A RAM constitutes the internal memory of the CPU for storing data, program and program
result. It is read/write memory. It is called random access memory (RAM).
Since access time in RAM is independent of the address to the word that is, each storage
location inside the memory is as easy to reach as other location & takes the same amount of
time. We can reach into the memory at random & extremely fast but can also be quite
expensive.
RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a
power failure. Hence, a backup uninterruptible power system (UPS) is often used with
computers. RAM is small, both in terms of its physical size and in the amount of data it can
hold.
RAM is of two types
The word static indicates that the memory retains its contents as long as power remains
applied. However, data is lost when the power gets down due to volatile nature. SRAM chips
use a matrix of 6-transistors and no capacitors. Transistors do not require power to prevent
leakage, so SRAM need not have to be refreshed on a regular basis.
Because of the extra space in the matrix, SRAM uses more chips than DRAM for the same
amount of storage space, thus making the manufacturing costs higher.
Static RAM is used as cache memory needs to be very fast and small.
DRAM, unlike SRAM, must be continually refreshed in order for it to maintain the data. This
is done by placing the memory on a refresh circuit that rewrites the data several hundred
times per second. DRAM is used for most system memory because it is cheap and small. All
DRAMs are made up of memory cells. These cells are composed of one capacitor and one
transistor.
ROM
ROM stands for Read Only Memory. The memory from which we can only read but cannot
write on it. This type of memory is non-volatile. The information is stored permanently in such
memories during manufacture.
A ROM, stores such instruction as are required to start computer when electricity is first
turned on, this operation is referred to as bootstrap. ROM chip are not only used in the
computer but also in other electronic items like washing machine and microwave oven.
Following are the various types of ROM −
The very first ROMs were hard-wired devices that contained a pre-programmed set of data
or instructions. These kind of ROMs are known as masked ROMs. It is inexpensive ROM.
PROM is read-only memory that can be modified only once by a user. The user buys a blank
PROM and enters the desired contents using a PROM programmer. Inside the PROM chip
there are small fuses which are burnt open during programming. It can be programmed only
once and is not erasable.
The EPROM can be erased by exposing it to ultra-violet light for a duration of upto 40 minutes.
Usually, an EPROM eraser achieves this function. During programming an electrical charge
is trapped in an insulated gate region. The charge is retained for more than ten years because
the charge has no leakage path. For erasing this charge, ultra-violet light is passed through
a quartz crystal window (lid). This exposure to ultra-violet light dissipates the charge. During
normal use the quartz lid is sealed with a sticker.
The EEPROM is programmed and erased electrically. It can be erased and reprogrammed
about ten thousand times. Both erasing and programming take about 4 to 10 ms
(millisecond). In EEPROM, any location can be selectively erased and programmed.
EEPROMs can be erased one byte at a time, rather than erasing the entire chip. Hence, the
process of re-programming is flexible but slow.
4.6 Programmable Logic Devices (PLD)
The given two functions are in sum of products form. The number of product terms present
in the given Boolean functions A & B are two and three respectively. One product term, Z′X is
common in each function.
So, we require four programmable AND gates & two programmable OR gates for producing
those two functions. The corresponding PLA is shown in the following figure.
The programmable AND gates have the access of both normal and complemented inputs
of variables. In the above figure, the inputs X, X′, Y, Y′, Z & Z′, are available at the inputs of
each AND gate. So, program only the required literals in order to generate one product term
by each AND gate.
All these product terms are available at the inputs of each programmable OR gate. But, only
program the required product terms in order to produce the respective Boolean functions by
each OR gate. The symbol ‘X’ is used for programmable connections.
UNIT-5
A/D and D/A converter
5.1 ADC & DAC
Analog to Digital Converter (ADC) and Digital to Analog Converter (DAC) are very important
components in electronic equipment. Since most real-world signals are analog, these two
converting interfaces are necessary to allow digital electronic equipment to process the analog
signals.
Digital to analog converter (DAC)
A Digital to Analog Converter (DAC) converts a digital input signal into an analog output
signal. The digital signal is represented with a binary code, which is a combination of bits 0
and 1. This chapter deals with Digital to Analog Converters in detail.
The block diagram of DAC is shown in the following figure −
A Digital to Analog Converter (DAC) consists of a number of binary inputs and a single output.
In general, the number of binary inputs of a DAC will be a power of two.
Types of DACs
The resistor with the lowest value R corresponds to the highest weighted binary input Bit 3
(MSB) [23 = 8], and 2R, 4R, 8R correspond to the binary weights of Bit 2 (2 2 = 4), Bit 1 (21 =
2), and Bit 0 (LSB) [2 0 = 1] respectively. The relationship between the digital inputs (Bit 0 to
Bit 3) and the analog output VOUT is as follow:
R-2R Digital-to-Analogue Converter, or DAC, is a data converter which use two precision
resistors to convert a digital binary number into an analogue output signal proportional to the
value of the digital number. A R-2R resistive ladder network provides a simple means of
converting digital voltage signals into an equivalent analogue output. Input voltages are
applied to the ladder network at various points along its length and the more input points the
better the resolution of the R-2R ladder. The output signal as a result of all these input voltage
points is taken from the end of the ladder which is used to drive the inverting input of an
operational amplifier.
Lets assume all the binary inputs are grounded at 0 volts, that is: V A = VB = VC = VD = 0V
(LOW). The binary code corresponding to these four inputs will therefore be: 0000.
Resistors R1 and R2 are in “parallel” with each other but in “series” with resistor R 3. Then we
can find the equivalent resistance of these three resistors and call it R A for simplicity
Then RA is equivalent to “2R”. Now we can see that the equivalent resistance “R A” is in
parallel with R4 with the parallel combination in series with R 5.
Again, we can find the equivalent resistance of this combination and call it R B.
So, RB combination is equivalent to “2R”. Hopefully we can see that this equivalent
resistance RB is in parallel with R6 with the parallel combination in series with R7 as shown.
As we have shown above, when two equal resistor values are parallel together, the resulting
value is one-half, so 2R in parallel with 2R equals an equivalent resistance of R. So, the
whole 4-bit R-2R resistive ladder network comprising of individual resistors connected
together in parallel and series combinations has an equivalent resistance (R EQ) of “R” when
a binary code of “0000” is applied to its four inputs.
Therefore, with a binary code of “0000” applied as inputs, our basic 4-bit R-2R digital-to-
analogue converter circuit would look something like this:
5.4 Counter type ADC
The circuit functions as follows.
Firstly, to begin with, the counter is reset to all 0s.
Secondly, when a convert signal appears on the start line, the input gate is enabled and
the clock pulses are applied to the clock input of the counter. The counter advances
through its normal binary count sequence.
Thirdly, the counter output feeds a D/A converter and the staircase waveform generated at
the output of the D/A converter forms one of the inputs of the comparator. The other input to
the comparator is the analogue input signal.
Fourthly, Whenever the D/A converter output exceeds the analogue input voltage, the
comparator changes state.
Finally, the gate is disabled and the counter stops. The counter output at that instant of
time is then the required digital output corresponding to the analogue input signal.
It consists of a successive approximation register (SAR), DAC and comparator. The output of
SAR is given to n-bit DAC. The equivalent analog output voltage of DAC, VD is applied to the
non-inverting input of the comparator. The second input to the comparator is the unknown
analog input voltage VA. The output of the comparator is used to activate the successive
approximation logic of SAR.
When the start command is applied, the SAR sets the MSB to logic 1 and other bits are made
logic 0, so that the trial code becomes 1000.
Advantages:
1 Conversion time is very small.
2 Conversion time is constant and independent of the amplitude of the analog input signal
VA.
Disadvantages:
1 Circuit is complex.
2 The conversion time is more compared to flash type ADC.
UNIT-6
Logic families
6.1 Logic Families
In Digital Designs, our primary aim is to create an Integrated Circuit (IC). A Circuit
configuration or arrangement of the circuit elements in a special manner will result in a
particular Logic Family.
Different types of logic families
1. Resistor Transistor Logic (RTL)