CPE305 (Lecture Notes)
CPE305 (Lecture Notes)
1. Circuits
a. Basic circuits
i. Gates and Flip-flops
ii. Counters and Registers.
b. General requirements/ circuit parameters
i. Fan in, Fan out
ii. Gate delay, wire delay, Skew
iii. Logic Levels, Noise margin and Power dissipation
c. Circuit families
i. TTL: Transistor-Transistor Logic
ii. ECL: Emitter Coupled Logic
iii. CMOS: Complementary Metal Oxide Semi-conductor
iv. DTL: Diode Transistor Logic
v. I2L: Integrated Injection Logic
d. Special circuits
i. Pulse shaping
ii. Driving,
iii. Addressing
iv. Tuning – Delays, Strobing
v. Interconnection, Back winding, interfacing
vi. Peripheral equipment circuitry.
2. Reliability
a. Component selection
i. Sampled testing
ii. Mean Time Between Failure
b. Redundancy
i. Component level repetitive operation
ii. System level repetitive operation
c. Error detection and correction
i. Parity
ii. Grey codes
iii. Processing Errors
iv. Fail safe/soft.
Assessment
o Coursework: 40% : format to be decided- written test, term paper, group work etc
o Written Examination: 60% : 3hrs paper, Answer 5 of 7 questions
References
1. Roger L. Tokheim (1994): Schuam's outline of Theory and Problems of Digital Principles, McGrawHill
2. Tony R. Kuphaldt (2008): Introduction Lessons in Electric Circuits, Volume IV – Digital, Fourth Edition,
available freely from www.ibiblio.org/obp/electricCircuits [assessed February 2013].
3. Deepak K. Tala (2013): Tutorial on Digital Electronics, www.asic-world.com [assessed March 2013].
1
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
M. Senthil
Fundamentals of Digital Design 2014
Sivakumar
Amit Kumar
Basic Computer Engineering 2012
Mishra
Electronic Circuits Analysis and Design-
Donald A Neamen TK.7867N41 2008
Third Edition
M. Morris Mano,
Digital Design-Fourth Edition 2007
Michael D. Ciletti
An Introduction to Digital Computer V. Rajaraman, T. TK7888.3 .R32
Design-Fifth Edition Radhakrishnan 2009
Circuits, Devices and Systems-Fifth Ralph J. Smith,
1992
Edition Richard C. Dofr
Microelectronics Circuit Analysis and TK7867.N412
Donald A. Neamen 2
Design-Third Edition 2007
Introduction to Electronics A.I. Menkiti, et al TK7860.M46 2010
R. Ananda
Digital Design 2015
Natarajan
An Introduction to Semiconductor
Donald Neamen 2006
devices
Ian A. Glover, TK5103.7.G58
Digital communication-Second Edition 2
Peter M. Grant 2004
S. Salivahanan, S.
Digital Circuits and Design-Third Edition 2008
Arivazhagan
2
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The explosion in digital techniques and technology has been made possible by the incredible increase in the
density of digital circuitry, its robust performance, its relatively low cost, and its speed. The requirement of
using many bits in reproduction is no longer an issue: The more the better. This circuitry is based upon the
transistor, which can be operated as a switch with two states. Hence, the digital information is intrinsically
binary. So in practice, the terms digital and binary are used interchangeably. In the following sections, we
summarize some conventions for defining the binary states and for doing binary arithmetic.
The convention for naming these states is illustrated in Fig. 1. The “positive true” case is illustrated. The
relationship between the logic state and label (in this case “switch open”) at some point in the circuit can be
summarized with the following:
The labelled voltage is High (Low) when the label’s stated function is True (False).
In the figure, the stated function is certainly true (switch open), and this does correspond to a high voltage at
the labelled point. (Recall that with the switch open, Ohm’s Law implies that with zero current, the voltage
difference across the “pull up” resistor is zero, so that the labelled point is at +5 Volts. With a closed switch,
the labelled point is connected to ground, with a 5 Volt drop across the resistor and a current of I = V /R = 5
mA through it.)
1
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
With the convention known as “negative true”, the label would be changed to “switch closed” with a bar
over it: switch closed. Our statement becomes:
The labelled voltage is Low (High) when the label’s stated function is True (False).
So in the figure, the stated function (switch closed) is true when the voltage is low. The bar is meant to
invoke the Boolean inversion operation: T=F, F=T and T=T.
Generally the subscripts will be omitted, since it will be clear from the context. To convert from base 10 to
binary, one can use a decomposition like above, or use the following algorithm illustrated by 79: 79/2 = 39,
remainder 1, then 39/2 = 19 r 1, and so forth. Then assemble all the remainders in reverse order. The largest
number which can be represented by n bits is 2n − 1. For example, with 4 bits the largest number is 11112 =
15. The most significant bit (MSB) is the bit representing the highest power of 2, and the LSB represents the
lowest power of 2.
Arithmetic with unsigned binary is analogous to decimal. For example 1-bit addition and multiplication are
as follows: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0, 0 × 0 = 0, 0 × 1 = 0, and 1 × 1 = 1. Note that this is different from
Boolean algebra, as we shall see later, where 1+1 = 1.
Another convention is called BCD (“binary coded decimal”) and is a type of weighted binary code. In this
case each decimal digit is separately converted to binary. Therefore, since 7 = 01112 and 9 = 10012, then 79
= 01111001 (BCD). Note that this is different than our previous result. BCD is quite often used in digital
electronics. It is quite convenient, for example, when decimal numerical displays are used. Weighted BCD
4-bit codes include 8421 BCD, 5421 BCD and 2421 BCD. Some binary codes are non-weighted. Each bit
therefore has no special weighting. Two such non-weighted codes are the excess-3 and Gray codes.
The excess-3 (XS3) code is related to the 8421 BCD code because of its binary-coded-decimal nature. In
other words, each 4-bit group in the XS3 code equals a specific decimal digit. Table 2.2 shows the XS3 code
along with its 8421 BCD and decimal equivalents. Note that the XS3 number is always 3 more than the 8421
BCD number. To convert from XS3 code to decimal, the XS3 number is divided into 4-bit groups starting at
2
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
the binary point. 3 (binary 0011) is subtracted from each 4-bit group to give an 8421 BCD number results
which can be translated into its decimal equivalent. The XS3 code has significant value in arithmetic
circuits. The value of the code lies in its ease of complementing. If each bit is complemented (0s to 1s and
1s to 0s), the resulting 4-bit word will be the 9s complement of the number. Adders can use 9s complement
numbers to perform subtraction.
The Gray code is another non-weighted binary code. The Gray code is not a BCD-type code. Table 2.3
compares the Gray code with equivalent binary and decimal numbers. Look carefully at the Gray code. Note
that each increase in count (increment) is accompanied by only 1bit changing state. Look at the change from
the decimal 7 line to the decimal 8 line. In binary all four bits change state (from 0111 to 1000). In this same
line the Gray code has only the left bit changing state (0100 to 1100). This change of a single bit in the code
group per increment characteristic is important in some applications in digital electronics.
Consider converting a binary number to its Gray code equivalent. Figure 2.2 shows the binary number 0010
being translated into its Gray code equivalent. The rules for converting from any binary number to its
equivalent Gray code number are as follows:
1. The left bit is the same in the Gray code as in the binary number.
2. Add the MSB to the bit on its immediate right and record the sum (neglect any carry) below in the
Gray code line.
3. Continue adding bits to the bits on their right and recording sums until the LSB is reached.
4. The Gray code number will always have the same number of bits as the binary number.
3
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
It is very often quite useful to represent blocks of 4 bits by a single digit. Thus in base 16 there is a
convention for using one digit for the numbers 0,1,2,.. .,15 which is called hexadecimal. It follows decimal
for 0–9, then uses letters A–F. Bits can also be coded to represent letters of the alphabet, numbers, and
punctuation marks. One such 7-bit code is the American Standard Code for Information Interchange (ASCII,
pronounced “ask-ee”), shown in Figure 2.3. Note that the letter A is represented by 1000001, whereas B in
the ASCII code is 1000010. The ASCII code is used extensively in small computer systems to translate
from the keyboard characters to computer language. The chart in Fig. 2.3 is not a complete list of all the
combinations in the ASCII code. Codes that can represent both letters and numbers are called alphanumeric
codes. Another alphanumeric code that is widely used is the Extended Binary-Coded Decimal Interchange
Code (EBCDIC, pronounced “eb-si-dik”). Part of the EBCDIC code is shown in Fig. 2.3. Note that the
EBCDIC code is an 8-bit code and therefore can have more variations and characters than the ASCII code
can have. The EBCDIC code is used in many larger computer systems. The alphanumeric ASCII code is the
modern code for getting information into and out of microcomputers. ASCII is used when interfacing
computer keyboards, printers, and video displays. ASCII has become the standard input/output code for
microcomputers. Other alphanumeric codes are:
4
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
5
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
3. Logic Gates
The binary numeration system is an interesting mathematical abstraction has practical application to
electronics. What makes binary numeration so important to the application of digital electronics is the ease
in which bits may be represented in physical terms. Because a binary bit can only have one of two different
values, either 0 or 1, any physical medium capable of switching between two saturated states may be used to
represent a bit. Consequently, any physical system capable of representing binary bits is able to represent
numerical quantities, and potentially has the ability to manipulate those numbers. This is the basic concept
underlying digital computing.
Electronic circuits are physical systems that lend themselves well to the representation of binary numbers.
Transistors, when operated at their bias limits, may be in one of two different states: either cut-off (no
controlled current) or saturation (maximum controlled current). If a transistor circuit is designed to
maximize the probability of falling into either one of these states (and not operating in the linear, or active,
mode), it can serve as a physical representation of a binary bit. A voltage signal measured at the output of
such a circuit may also serve as a representation of a single bit, a low voltage representing a binary ”0” and a
(relatively) high voltage representing a binary ”1.” Note the transistor circuit in Fig. 3.1.
In this circuit, the transistor is in a state of saturation by virtue of the applied input voltage (5 volts) through
the two-position switch. Because its saturated, the transistor drops very little voltage between collector and
emitter, resulting in an output voltage of (practically) 0 volts. If we were using this circuit to represent
binary bits, we would say that the input signal is a binary ”1” and that the output signal is a binary ”0.” Any
voltage close to full supply voltage (measured in reference to ground, of course) is considered a ”1” and a
lack of voltage is considered a ”0.” Alternative terms for these voltage levels are high (same as a binary ”1”)
and low (same as a binary ”0”). A general term for the representation of a binary bit by a circuit voltage is
logic level. Moving the switch to the other position, we apply a binary ”0” to the input and receive a binary
”1” at the output as shown in Fig. 3.2.
6
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
What we’ve created here with a single transistor is a circuit generally known as a logic gate, or simply gate.
A gate is a special type of amplifier circuit designed to accept and generate voltage signals corresponding to
binary 1’s and 0’s. As such, gates are not intended to be used for amplifying analog signals (voltage signals
between 0 and full voltage). Used together, multiple gates may be applied to the task of binary number
storage (memory circuits) or manipulation (computing circuits), each gate’s output representing one bit of a
multi-bit binary number. The gate shown in Figures 3.1 & 3.2 with the single transistor is known as an
inverter, or NOT gate, because it outputs the exact opposite digital signal as what is input. For convenience,
gate circuits are generally represented by their own symbols rather than by their constituent transistors and
resistors.
The NOT gate performs the basic logical function called inversion or complementation. NOT gate is also
called inverter. The purpose of this gate is to convert one logic level into the opposite logic level. It has one
input and one output. When a HIGH level is applied to an inverter, a LOW level appears on its output and
vice versa.
If X is the input, then output F can be represented mathematically as F = X', Here apostrophe (') denotes the
NOT (inversion) operation. There are a couple of other ways to represent inversion, F= !X, here ! represents
inversion. Truth table and NOT gate symbol is shown in the figure below.
Truth Table
X F= X'
0 1
1 0
NOT gate using "transistor-resistor" logic is shown in the figure below, where X is the input and F is the
output.
7
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
When X = 1, The transistor input pin 1 is HIGH, this produces the forward bias across the emitter base
junction and so the transistor conducts. As the collector current flows, the voltage drop across RL increases
and hence F is LOW. When X = 0, the transistor input pin 2 is LOW: this produces no bias voltage across
the transistor base emitter junction. Thus, Voltage at F is HIGH.
The single-transistor inverter circuit illustrated In Fig. 3.1 is actually too crude to be of practical use as a
gate. Real inverter circuits contain more than one transistor to maximize voltage gain (so as to ensure that
the final output transistor is either in full cut-off or full saturation), and other components designed to reduce
the chance of accidental damage. Figure below shows a schematic diagram for a real inverter circuit,
complete with all necessary components for efficient and reliable operation. This circuit is composed
exclusively of resistors and bipolar transistors. Bear in mind that other circuit designs are capable of
performing the NOT gate function, including designs substituting field-effect transistors for bipolar.
Let’s analyze this circuit for the condition where the input is ”high,” or in a binary ”1” state. We can
simulate this by showing the input terminal connected to Vcc through a switch:
In this case, diode D1 will be reverse-biased, and therefore not conduct any current. In fact, the only purpose
for having D1 in the circuit is to prevent transistor damage in the case of a negative voltage being impressed
on the input (a voltage that is negative, rather than positive, with respect to ground). With no voltage
between the base and emitter of transistor Q1 , we would expect no current through it, either. However, as
strange as it may seem, transistor Q1 is not being used as is customary for a transistor. In reality , Q1 is being
used in this circuit as nothing more than a back-to-back pair of diodes. The following schematic shows the
real function of Q1:
8
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The purpose of these diodes is to ”steer” current to or away from the base of transistor Q2, depending on the
logic level of the input. Exactly how these two diodes are able to ”steer” current isn’t exactly obvious at first
inspection, so a short example may be necessary for understanding. Suppose we had the following
diode/resistor circuit, representing the base-emitter junctions of transistors Q2 and Q4 as single diodes,
stripping away all other portions of the circuit so that we can concentrate on the current ”steered” through
the two back-to-back diodes:
With the input switch in the ”up” position (connected to Vcc), it should be obvious that there will be no
current through the left steering diode of Q1, because there isn’t any voltage in the switch-diode-R1 switch
loop to motivate electrons to flow. However, there will be current through the right steering diode of Q1, as
well as through Q2’s base-emitter diode junction and Q4’s base-emitter diode junction:
This tells us that in the real gate circuit, transistors Q2 and Q4 will have base current, which will turn them
on to conduct collector current. The total voltage dropped between the base of Q1 (the node joining the two
back-to-back steering diodes) and ground will be about 2.1 volts, equal to the combined voltage drops of
three PN junctions: the right steering diode, Q2’s base-emitter diode, and Q4’s base-emitter diode.
Now, let’s move the input switch to the ”down” position and see what happens:
9
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
If we were to measure current in this circuit, we would find that all of the current goes through the left
steering diode of Q1 and none of it through the right diode. Why is this? It still appears as though there is a
complete path for current through Q4’s diode, Q2 ’s diode, the right diode of the pair, and R1, so why will
there be no current through that path?
Remember that PN junction diodes are very nonlinear devices: they do not even begin to conduct current
until the forward voltage applied across them reaches a certain minimum quantity, approximately 0.7 volts
for silicon and 0.3 volts for germanium. And then when they begin to conduct current, they will not drop
substantially more than 0.7 volts. When the switch in this circuit is in the ”down” position, the left diode of
the steering diode pair is fully conducting, and so it drops about 0.7 volts across it and no more.
Recall that with the switch in the ”up” position (transistors Q2 and Q4 conducting), there was about 2.1 volts
dropped between those same two points (Q1’s base and ground), which also happens to be the minimum
voltage necessary to forward-bias three series-connected silicon PN junctions into a state of conduction. The
0.7 volts provided by the left diode’s forward voltage drop is simply insufficient to allow any electron flow
through the series string of the right diode, Q2’s diode, and the R3//Q4 diode parallel sub-circuit, and so no
electrons flow through that path. With no current through the bases of either transistor Q2 or Q4 , neither one
will be able to conduct collector current: transistors Q2 and Q4 will both be in a state of cut-off.
Consequently, this circuit configuration allows 100 percent switching of Q2 base current (and therefore
control over the rest of the gate circuit, including voltage at the output) by diversion of current through the
left steering diode.
In the case of our example gate circuit, the input is held ”high” by the switch (connected to Vcc), making the
left steering diode (zero voltage dropped across it). However, the right steering diode is conducting current
through the base of Q2, through resistor R1:
10
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
With base current provided, transistor Q2 will be turned ”on.” More specifically, it will be saturated by
virtue of the more-than-adequate current allowed by R1 through the base. With Q2 saturated, resistor R3 will
be dropping enough voltage to forward-bias the base-emitter junction of transistor Q4, thus saturating it as
well:
With Q4 saturated, the output terminal will be almost directly shorted to ground, leaving the output terminal
at a voltage (in reference to ground) of almost 0volts, or a binary ”0” (”low”) logic level. Due to the
presence of diode D2, there will not be enough voltage between the base of Q3 and its emitter to turn it on, so
it remains in cut-off.
Let’s see now what happens if we reverse the input’s logic level to a binary ”0” by actuating the input
switch:
Now there will be current through the left steering diode of Q1 and no current through the right steering
diode. This eliminates current through the base of Q2, thus turning it off. With Q2 off, there is no longer a
11
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
path for Q4 base current, so Q4 goes into cut-off as well. Q3, on the other hand, now has sufficient voltage
dropped between its base and ground to forward-bias its base-emitter junction and saturate it, thus raising
the output terminal voltage to a ”high” state. In actuality, the output voltage will be somewhere around 4
volts depending on the degree of saturation and any load current, but still high enough to be considered a
”high” (1) logic level. With this, our simulation of the inverter circuit is complete: a ”1” in gives a ”0” out,
and vice versa.
The astute observer will note that this inverter circuit’s input will assume a ”high” state of left floating (not
connected to either Vcc or ground). With the input terminal left unconnected, there will be no current through
the left steering diode of Q1, leaving all of R1’s current to go through Q2’s base, thus saturating Q2 and
driving the circuit output to a ”low” state:
The tendency for such a circuit to assume a high input state if left floating is one shared by all gate circuits
based on this type of design, known as Transistor-to-Transistor Logic, or TTL. This characteristic may be
taken advantage of in simplifying the design of a gate’s output circuitry, knowing that the outputs of gates
typically drive the inputs of other gates. If the input of a TTL gate circuit assumes a high state when floating,
then the output of any gate driving a TTL input need only provide a path to ground for a low state and be
floating for a high state. This concept may require further elaboration for full understanding, so it will be
explored in detail here.
A gate circuit as we have just analyzed has the ability to handle output current in two directions: in and out.
Technically, this is known as sourcing and sinking current, respectively. When the gate output is high, there
is continuity from the output terminal to Vcc through the top output transistor (Q3), allowing electrons to
flow from ground, through a load, into the gate’s output terminal, through the emitter of Q3, and eventually
up to the Vcc power terminal (positive side of the DC power supply):
12
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
To simplify this concept, we may show the output of a gate circuit as being a double-throw switch, capable
of connecting the output terminal either to Vcc or ground, depending on its state. For a gate outputting a
”high” logic level, the combination of Q3 saturated and Q4 cut-off is analogous to a double-throw switch in
the ”Vcc” position, providing a path for current through a grounded load:
Please note that this two-position switch shown inside the gate symbol is representative of transistors Q3 and
Q4 alternately connecting the output terminal to Vcc or ground, not of the switch previously shown sending
an input signal to the gate! Conversely, when a gate circuit is outputting a ”low” logic level to a load, it is
analogous to the double-throw switch being set in the ”ground” position. Current will then be going the
other way if the load resistance connects to Vcc: from ground, through the emitter of Q4, out the output
terminal, through the load resistance, and back to Vcc. In this condition, the gate is said to be sinking current:
The combination of Q3 and Q4 working as a ”push-pull” transistor pair (otherwise known as a totem pole
output) has the ability to either source current (draw in current to Vcc ) or sink current (output current from
ground) to a load. However, a standard TTL gate input never needs current to be sourced, only sunk. That is,
since a TTL gate input naturally assumes a high state if left floating, any gate output driving a TTL input
need only sink current to provide a ”0” or ”low” input, and need not source current to provide a ”1” or a
”high” logic level at the input of the receiving gate:
13
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
This means we have the option of simplifying the output stage of a gate circuit so as to eliminate Q3
altogether. The result is known as an open-collector output:
To designate open-collector output circuitry within a standard gate symbol, a special marker is used. Shown
here is the symbol for an inverter gate with open-collector output:
Please keep in mind that the ”high” default condition of a floating gate input is only true for TTL circuitry,
and not necessarily for other types, especially for logic gates constructed of field-effect transistors.
For simplification, we shall skip the internal details of other logic gates and focus more on their
functionalities. This is because in practice, such gates will be realised with the use of integrated circuits
(ICs). For each gate, it is important to know the symbol(s), truth table and Boolean expression. Truth tables
show all combinations of input conditions in terms of logic level states (either ”high” or ”low,” ”1” or ”0,”
for each input terminal of the gate), along with the corresponding output logic level, either ”high” or ”low".
The number of truth table rows needed for a gate is equal to 2 raised to the power of the number of input
terminals (2n).
14
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
While this may seem like a pointless thing to do, it does have practical application. Remember that gate
circuits are signal amplifiers, regardless of what logic function they may perform. A weak signal source (one
that is not capable of sourcing or sinking very much current to a load) may be boosted by means of two
inverters like the pair shown in the previous illustration. The logic level is unchanged, but the full current-
sourcing or -sinking capabilities of the final inverter are available to drive a load resistance if needed. For
this purpose, a special logic gate called a buffer is manufactured to perform the same function as two
inverters. Its symbol is simply a triangle, with no inverting ”bubble” on the output terminal
Buffer or BUF is also a gate with the exception that it does not perform any logical operation on its input.
Buffers just pass input to output. Buffers are used to increase the drive strength or sometime just to
introduce delay. If X is the input, then output F can be represented mathematically as F = X. Truth table and
symbol of the Buffer gate is shown in the figure below.
Truth Table
X F= X
0 0
1 1
3.3 Multiple Input Gates
Given commutative and associative laws, many logic gates can be implemented with more than two inputs,
and for reasons of space in circuits, usually multiple input, complex gates are made. You will encounter such
gates in real world.
F = X.Y
Here dot (.) denotes the AND operation. Symbol of the AND gate is shown in the figure below followed by
its Truth table.
Truth Table
X Y F= X.Y
0 0 0
15
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
0 1 0
1 0 0
1 1 1
Two input AND gate using "diode-resistor" logic circuit is shown in the figure below, where X, Y are inputs
and F is the output.
If X = 0 and Y = 0, then both diodes D1 and D2 are forward biased and thus both diodes conduct and pull F
low. If X = 0 and Y = 1, D2 is reverse biased, thus does not conduct. But D1 is forward biased, thus
conducts and thus pulls Flow. If X = 1 and Y = 0, D1 is reverse biased, thus does not conduct. But D2 is
forward biased, thus conducts and thus pulls Flow. If X = 1 and Y = 1, then both diodes D1 and D2 are
reverse biased and thus both the diodes are in cut-off and thus there is no drop in voltage at F. Thus F is
HIGH.
Truth Table
X Y Z F= X.Y.Z
16
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
3.3.2 OR Gate
The OR gate performs logical addition, commonly known as OR function. The OR gate has two or more
inputs and single output. The output of OR gate is HIGH only when any one of its inputs are HIGH (i.e.
even if one input is HIGH, Output will be HIGH). If X and Y are two inputs, then output F can be
represented mathematically as F = X+Y. Here plus sign (+) denotes the OR operation. Truth table and
symbol of the OR gate is shown in the figure below.
Truth Table
X Y F= X+Y
0 0 0
0 1 1
1 0 1
1 1 1
Two input OR gate using "diode-resistor" logic is shown in figure below, where X, Y are inputs and F is the
output.
If X = 0 and Y = 0, then both diodes D1 and D2 are reverse biased and thus both the diodes are in cut-off
and thus F is low. If X = 0 and Y = 1, D1 is reverse biased, thus does not conduct. But D2 is forward biased,
thus conducts and thus pulling F to HIGH. If X = 1 and Y = 0, D2 is reverse biased, thus does not conduct.
But D1 is forward biased, thus conducts and thus pulling F to HIGH. If X = 1 and Y = 1, then both diodes
D1 and D2 are forward biased and thus both the diodes conduct and thus F is HIGH.
17
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Truth Table
X Y Z F= X+Y+Z
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
3.3.3 NAND Gate
NAND gate is a cascade of AND gate and NOT gate, as shown in the figure below. It has two or more
inputs and only one output. The output of NAND gate is HIGH when any one of its input is LOW (i.e. even
if one input is LOW, Output will be HIGH).
If X and Y are two inputs, then output F can be represented mathematically as F = (X.Y)', Here dot (.)
denotes the AND operation and (') denotes inversion. Truth table and symbol of the NAND gate is shown in
the figure below.
18
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Truth Table
X Y F= (X.Y)'
0 0 1
0 1 1
1 0 1
1 1 0
3.3.4 NOR Gate
NOR gate is a cascade of OR gate and NOT gate, as shown in the figure below. It has two or more inputs
and only one output. The output of NOR gate is HIGH when any all its inputs are LOW (i.e. even if one
input is HIGH, output will be LOW).
If X and Y are two inputs, then output F can be represented mathematically as F = (X+Y)'; here plus (+)
denotes the OR operation and (') denotes inversion. Truth table of the NOR gate is shown below.
Truth Table
X Y F= (X+Y)'
0 0 1
0 1 0
1 0 0
1 1 0
3.3.5 XOR Gate
An Exclusive-OR (XOR) gate is gate with two or three or more inputs and one output. The output of a two-
input XOR gate assumes a HIGH state if one and only one input assumes a HIGH state. This is equivalent to
saying that the output is HIGH if either input X or input Y is HIGH exclusively, and LOW when both are 1
or 0 simultaneously. If X and Y are two inputs, then output F can be represented mathematically as F = X Y.
Here denotes the XOR operation. This is equivalent to X.Y' + X'.Y. Truth table and symbol of the XOR
gate is shown in the figure below.
19
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Truth Table
X Y F= X+Y
0 0 0
0 1 1
1 0 1
1 1 0
3.3.6 XNOR Gate
An Exclusive-NOR (XNOR) gate is gate with two or three or more inputs and one output. The output of a
two-input XNOR gate assumes a HIGH state if all the inputs assumes same state. This is equivalent to
saying that the output is HIGH if both input X and input Y is HIGH exclusively or same as input X and
input Y is LOW exclusively, and LOW when both are not same. If X and Y are two inputs, then output F
can be represented mathematically as F = (X Y)' which denotes the XNOR operation. (X Y)' and is
equivalent to X.Y + X'.Y'. Truth table and symbol of the XNOR gate is shown in the figure below.
Truth Table
X Y F= (X Y)'
0 0 1
0 1 0
1 0 0
1 1 1
3.4 Universal Gates
Universal gates are the ones which can be used for implementing any gate like AND, OR and NOT, or any
combination of these basic gates; NAND and NOR gates are universal gates. But there are some rules that
need to be followed when implementing NAND or NOR based gates. To facilitate the conversion to NAND
and NOR logic, we have two new logic symbols for these gates.
NOR Gate
20
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The above expression can be implemented with three AND gates in first stage and one OR gate in second
stage as shown in figure below.
If bubbles are introduced at AND gates output and OR gates inputs (the same for NOR gates), the above
circuit becomes as shown in figure.
Now replace OR gate with input bubble with the NAND gate. Now we have circuit which is fully
implemented with just NAND gates.
21
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
22
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
NOR gate. In other words any logic circuit with OR gates in first level and AND gates in second level can
be converted into a NOR-NOR gate circuit. Consider the following POS expression: F = (X+Y) . (Y+Z).
This expression can be implemented with three OR gates in first stage and one AND gate in second stage as
shown in figure below
If bubble are introduced at the output of the OR gates and the inputs of AND gate, the above circuit becomes
as shown in figure below.
Now replace AND gate with input bubble with the NOR gate. Now we have circuit which is fully
implemented with just NOR gates.
23
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Tutorial Questions
A. From Section 2
1. Discuss the concept of Digitization. What are its advantages and disadvantages?
2. Explain briefly how the following conventions are used to represent unsigned numbers on Computer
systems. a) Binary Coded Decimal b) Excess 3 c) Gray codes
3. Elucidate on the ways in which signed numbers can be represented on a Computer system.
4. Differentiate between ASCII and EBCDIC alpha-numeric codes for representing alphabet, numbers,
punctuation marks and other special characters in binary.
B. From Section 3
1. If a transistor circuit is designed to maximize the probability of falling into either one of cut-off or
saturated states (and not operating in the linear or active mode), it can serve as a physical representation of
binary digits essential to digital Computer system design. Discuss.
2. Show a schematic diagram for a real inverter circuit, complete with all necessary components for efficient
and reliable operation and explain how it works.
3. With the aid of the electronic circuits (transistor, diodes and resistors), ladder logic (switches), logic
symbol/ diagram, boolean algebra and truth table, explain the functions of the following gates:
a) NOT b) AND c) OR d) NAND e) NOR f) XOR
24
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
4. The NAND and NOR are universal gates. Discuss this statement with suitable examples of converting the
three basic logic symbols (NOT, AND, and OR) to these universal gates.
4.2.2 Precedence
As with any other branch of mathematics, these operators have an order of precedence. NOT operations
have the highest precedence, followed by AND operations, followed by OR operations. Brackets can be
used as with other forms of algebra. E.g. X.Y + Z and X.(Y + Z) are different.
4.2.3 Boolean Algebraic Axioms and Theories
Identity Law
an identity 0 for + such that X + 0 = X
an identity 1 for . such that X . 1 = X
Commutative Laws
X+Y=Y+X X.Y=Y.X
Distributive Laws
X.(Y + Z ) = X.Y + X.Z X + Y.Z = (X + Y) . (X + Z)
Complement
X + X' = 1 X . X' = 0
Idempotent Law
X+X=X X.X=X
DeMorgan's Law
25
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
This allows us to represent expressions in either Sum of Products or Product of Sums forms
4.2.4.2 Sum Of Products (SOP)
The Sum of Products form represents an expression as a sum of minterms.
F(X, Y, ...) = Sum (ak.mk) where ak is 0 or 1 and mk is a minterm.
To derive the Sum of Products form from a truth table, OR together all of the minterms which give a value
of 1.
Example: SOP
Consider the truth table
X Y F MinTerm
0 0 0 X'.Y'
0 1 0 X'.Y
1 0 1 X.Y'
1 1 1 X.Y
Here SOP is f(X.Y) = X.Y' + X.Y
A K-map consists of a grid of squares, each square representing one canonical minterm combination of the
variables or their inverse. The map is arranged so that squares representing minterms which differ by only
one variable are adjacent both vertically and horizontally. Therefore XY'Z' would be adjacent to X'Y'Z' and
would also adjacent to XY'Z and XYZ'.
The objective is to cover all the 1's on the map in the fewest number of groups and to create the largest
groups to do this. Once all possible groups have been formed, the corresponding terms are identified. A
group of two 1's eliminates one variable from the original minterm. A group of four 1's eliminates two
variables from the original minterm. A group of eight 1's eliminates three variables from the original
minterm, and so on. The variables eliminated are those which are different in the original minterms of the
group.
K-map needs not follow the ordering as shown in the figure above. What this means is that we can change
the position of m0, m1, m2, m3 of the above figure as shown in the two figures below. Position assignment
is the same as the default k-maps positions. This is the one which we will be using throughout this course
notes. The K-map for a function is specified by putting a '1' in the square corresponding to a minterm, a '0'
otherwise.
X Y SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
29
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
If a square containing 1 cannot be placed in a group, then leave it out to include in final expression. The
number of squares in a group must be equal to 2 , i.e. 2,4,8 etc. The map is considered to be folded or
spherical, therefore squares at the end of a row or column are treated as adjacent squares. The simplified
logic expression obtained from a K-map is not always unique. Groupings can be made in different ways.
Before drawing a K-map the logic expression must be in canonical form.
F=Y
30
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
F=X+Y
Using gray code arrangement ensures that minterms of adjacent cells differ by only ONE literal. (Other
arrangements which satisfy this criterion may also be used). Each cell in a 3-variable K-map has 3 adjacent
neighbours. In general, each cell in an n-variable K-map has n adjacent neighbours.
31
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
4.3.6.1 Example
F = XYZ'+XYZ+X'YZ
F = XY + YZ
4.3.6.2 Example
F(X,Y,Z) =Summation (1,3,4,5,6,7)
F=X+Z
There are 16 cells in a 4-variable (W, X, Y, Z); K-map as shown in the figure below
There are 2 wrap-a-rounds: a horizontal wrap-around and a vertical wrap-around. Every cell thus has 4
neighbours. For example, the cell corresponding to minterm m0 has neighbours m1, m2, m4 and m8.
4.3.7.1 Example
F(W,X,Y,Z) = (1,5,12,13)
F = WY'Z + W'Y'Z
4.3.7.2 Example
F(W,X,Y,Z) = (4, 5, 10, 11, 14, 15)
33
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
F = W'XY' + WY
34
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
5.1 Introduction
Combinatorial Circuits are circuits which can be considered to have the following generic structure.
Whenever the same set of inputs is fed in to a combinatorial circuit, the same outputs will be generated.
Such circuits are said to be stateless. Some simple combinational logic elements that we have seen in
previous sections are "Gates".
All the gates in the above figure have 2 inputs and one output; combinational elements simplest form are
"not" gate and "buffer" as shown in the figure below. They have only one input and one output.
5.2 Decoders
A decoder is a multiple-input, multiple-output logic circuit that converts coded inputs into coded outputs,
where the input and output codes are different; e.g. n-to-2n, BCD decoders. Enable inputs must be on for the
decoder to function, otherwise its outputs assume a single "disabled" output code word. Decoding is
necessary in applications such as data multiplexing, 7-segment display and memory address decoding.
Figure below shows the pseudo block of a decoder.
35
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
36
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
To minimize the above truth table we may use k-map, but doing that you will realize that it is a waste of
time. One can directly write down the function for each of the outputs. Thus we can draw the circuit as
shown in figure below. Note that each output is a 2-variable minterm (X'Y', X'Y, XY',XY).
Truth Table
X Y Z F0 F1 F2 F3 F4 F5 F6 F7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
From the truth table we can draw the circuit diagram as shown in figure below.
37
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
X Y Z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
From the truth table we know the values for which the sum (S) is active and also the carry (C) is active.
Thus we have the equation as shown above and a circuit can be drawn as shown below from the equation
derived.
38
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
5.4 Encoders
An encoder is a combinational circuit that performs the inverse operation of a decoder. If a device output
code has fewer bits than the input code has, the device is usually called an encoder. e.g. 2n-to-n, priority
encoders. The simplest encoder is a 2n-to-n binary encoder, where it has only one of 2n inputs and the output
is the n-bit binary number corresponding to the active input.
For an 8-to-3 binary encoder with inputs I0-I7 the logic expressions of the outputs Y0-Y2 are:
Y0 = I1 + I3 + I5 + I7
Y1= I2 + I3 + I6 + I7
Y2 = I4 + I5 + I6 +I7
Based on the above equations, we can draw the circuit as shown below.
39
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
From the above truth table , we can derive the functions Y3, Y2, Y1 and Y0 as given below.
Y3 = I8 + I9
Y2 = I4 + I5 + I6 + I7
Y1 = I2 + I3 + I6 + I7
Y0 = I1 + I3 + I5 + I7 + I9
Truth Table
D3 D2 D1 D0 Y2 Y1 Y0
0 0 0 0 0 0 0
0 0 0 1 0 0 1
0 0 1 X 0 1 0
0 1 X X 0 1 1
1 X X X 1 0 0
Now that we have the truth table, we can draw the K-maps as shown below.
40
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
From the K-map we can draw the circuit as shown below. For Y2, we connect directly to D3.
We can apply the same logic to get higher order priority encoders.
5.5 Multiplexer
A multiplexer (MUX) is a digital switch which connects data from one of n sources to the output. A number
of select inputs determine which data source is connected to the output. The block diagram of MUX with n
data sources of b bits wide and s bits wide select line is shown in below figure.
MUX acts like a digitally controlled multi-position switch where the binary code applied to the select inputs
controls the input source that will be switched on to the output as shown in the figure below. At any given
point of time only one input gets selected and is connected to output, based on the select input signal.
41
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Truth Table
S Y
0 A
1 B
42
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
5.6 De-multiplexers
They are digital switches which connect data from one input source to one of n outputs. Usually
implemented by using n-to-2n binary decoders where the decoder enable line is used for data input of the de-
43
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
multiplexer. The figure below shows a de-multiplexer block diagram which has got s-bits-wide select input,
one b-bits-wide data input and n b-bits-wide outputs.
Truth Table
S1 S0 F0 F1 F2 F3
0 0 D 0 0 0
0 1 0 D 0 0
1 0 0 0 D 0
1 1 0 0 0 D
5.6.3 Boolean Function Implementation
Earlier we had seen that it is possible to implement Boolean functions using decoders. In the same way it is
also possible to implement Boolean functions using MUXers and DEMUXers.
44
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
B. From Section 5
1. What are Decoders? Hence, design a n-to-2n decoder when n=2; show the truth table, simplification and
logic diagram.
2. What are Encoders? Hence, design a decimal-to-binary encoder having 10 inputs and 4 outputs; showing
the truth table and logic diagram.
3. Differentiate between Standard Encoders and Priority Encoders. Hence, design two 3-to-2 encoders, one
apiece for standard and priority.
4. What is a Multiplexer? Illustrate with a schematic diagram and explain how it might be useful on a
computer circuit board.
5. Design a 2:1 Multiplexer and illustrate how this might be used to construct larger multiplexers such as an
8:1 multiplexer.
6. Design a 1:4 de-multiplexer, show its block diagram, truth table, logic symbol as well as logic
combinational circuit from gates.
45
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
6.2 Adders
Adders are the basic building blocks of all arithmetic circuits; adders add two binary numbers and give out
sum and carry as output. Basically we have two types of adders: Half Adder and Full Adder.
46
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
47
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
X = X3 X2 X1 X0
Y = Y3 Y2 Y1 Y0
producing the sum S = S3 S2 S1 S0 , C-out = C4 from the most significant position j=3.
= 4 x 2 nD = 4 x 8D = 32 D or 32 gate delays
6.3 Subtracter
Subtracter circuits take two binary numbers as input and subtract one binary number input from the other
binary number input. Similar to adders, it gives out two outputs, difference and borrow (carry-in the case of
Adder). There are two types of subtracters: Half Subtracter and Full Subtracter.
48
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
From the above table we can draw the K-map as shown below for "difference" and "borrow". The boolean
expression for the difference and Borrow can be written. From the equation we can draw the half-subtracter
as shown in the figure below.
49
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
From above table we can draw the K-map as shown below for "difference" and "borrow". The boolean
expression for difference and borrow can be written.
From the above expression, we can draw the circuit below. If you look carefully, you will see that a full-
subtracter circuit is more or less same as a full-adder with slight modification.
D3
50
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
➢ The number X has two types of binary figures: bits corresponding to '1' in the predefined constant
and bits corresponding to '0'in the predefined constant.
➢ The bits of the number X corresponding to '1' are supplied to AND gates
➢ The bits corresponding to '0' are supplied to OR logic gates
➢ If the least significant bits of the predefined constant are '10' then bit X0 is supplied to the same
AND gate as bit X1.
If the least significant bits of the constant are all '1' then the corresponding bits of the number X are not
included in the hardware implementation. All other relations between X and C can be transformed in
equivalent ones that use the operator '>' and the NOT logic operator as shown in the table below.
The comparison process of two positive numbers X and Y is performed in a bit-by-bit manner starting with
the most significant bit:
➢ If the most significant bits are Xn='1' and Yn='0' then number X is larger than Y.
➢ If Xn='0' and Yn='1' then number X is smaller than Y.
➢ If Xn=Yn then no decision can be taken about X and Y based only on these two bits.
➢ If the most significant bits are equal then the result of the comparison is determined by the less
significant bits Xn-1 and Yn-1. If these bits are equal as well, the process continues with the next
pair of bits. If all bits are equal then the two numbers are equal.
6.5 Multipliers
Multiplication is achieved by adding a list of shifted multiplicands according to the digits of the multiplier.
An n-bit X n-bit multiplier can be realized in combinational circuitry by using an array of n-1 n-bit adders
where each adder is shifted by one position. For each adder one input is the shifted multiplicand multiplied
by 0 or 1 (using AND gates) depending on the multiplier bit, the other input is n partial product bits.
51
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
6.6 Dividers
The binary divisions are performed in a very similar manner to the decimal divisions, as shown in the
diagrams below. Thus, the second number is repeatedly subtracted from the figures of the first number after
being multiplied either with '1' or with '0'. The multiplication bit ('1' or '0') is selected for each subtraction
step in such a manner that the subtraction result is not negative. The division result is composed from all the
successive multiplication bits while the remainder is the result of the last subtraction step.
This algorithm can be implemented by a series of subtracters composed of modified elementary cells. Each
subtracter calculates the difference between two input numbers, but if the result is negative the operation is
cancelled and replaced with a subtraction by zero. Thus, each divider cell has the normal inputs of a
subtracter unit as in the figure below but a supplementary input ('div_bit') is also present. This input is
connected to the b_req_out signal generated by the most significant cell of the subtracter. If this signal is '1',
the initial subtraction result is negative and it has to be replaced with a subtraction by zero. Inside each
divider cell the div_bit signal controls an equivalent 2:1 multiplexer that selects between bit 'x' and the bit
included in the subtraction result X-Y. The complete division can therefore by implemented by a matrix of
divider cells connected on rows and columns as shown in figure below. Each row performs one
multiplication-and-subtraction cycle where the multiplication bit is supplied by the NOT logic gate at the
end of each row . Therefore, the NOT logic gates generate the bits of the division result.
52
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
7. Sequential Circuits
Digital electronics is classified into combinational logic and sequential logic. Combinational logic output
depends on the inputs levels, whereas sequential logic output depends on stored levels and also the input
levels.
The memory elements are devices capable of storing binary info. The binary info stored in the memory
elements at any given time defines the state of the sequential circuit. The input and the present state of the
memory element determines the output. Memory elements next state is also a function of external inputs
and present state. A sequential circuit is specified by a time sequence of inputs, outputs, and internal states.
There are two types of sequential circuits. Their classification depends on the timing of their signals:
➢ Synchronous sequential circuits
➢ Asynchronous sequential circuits
53
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
A clock signal is a periodic square wave that indefinitely switches from 0 to 1 and from 1 to 0 at fixed
intervals. Clock cycle time or clock period: the time interval between two consecutive rising or falling edges
of the clock. Clock Frequency is the inverse of clock cycle time and measured in cycles per second or
Hertz). For example, if Clock cycle time = 10ns then, clock frequency = 100MHz.
The basic idea of having the feedback is to store the value or hold the value, but in the above circuit, output
keeps toggling. We can overcome this problem with the circuit below, which is basically cascading two
inverters, so that the feedback is in-phase, thus avoids toggling. The equivalent circuit is the same as having
a buffer with its output connected to its input.
But there is a problem here too: each gate output value is stable, but what will it be? Or in other words,
buffer output cannot be known. There is no way to tell. If we could know or set the value we would have a
simple 1-bit storage/memory element.
The circuit below is the same as the inverters connected back to back with provision to set the state of each
gate (NOR gate with both inputs shorted is like a inverter). The operation is clear from the truth table. S is
called set and R is called Reset.
54
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
S R Q Q+
0 0 0 0
0 0 1 1
0 1 X 0
1 0 X 1
1 1 X 0
There still seems to be some problem with the above configuration, we cannot control when the input should
be sampled. In other words, there is no enable signal to control when the input is sampled. Normally input
enable signals can be of two types:
➢ Level Sensitive or ( LATCH)
➢ Edge Sensitive or (Flip-Flop)
Level Sensitive: The circuit below is a modification of the above one to have level sensitive enable input.
Enable, when LOW, masks the input S and R. When HIGH, presents S and R to the sequential logic input
(the above circuit two NOR Gates). Thus Enable, when HIGH, transfers input S and R to the sequential cell
transparently, so this kind of sequential circuits are called transparent Latch. The memory element we get is
an RS Latch with active high Enable.
Edge Sensitive: The circuit below is a cascade of two level sensitive memory elements, with a phase shift in
the enable input between first memory element and second memory element. The first RS latch (i.e. the first
memory element) will be enabled when CLK input is HIGH and the second RS latch will be enabled when
CLK is LOW. The net effect is input RS is moved to Q and Q' when CLK changes state from HIGH to
LOW, this HIGH to LOW transition is called falling edge. So the Edge sensitive element we get is called
negative edge RS flip-flop.
55
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
As seen in last section, Latches and Flip-flops are one and the same with a slight variation: Latches have
level sensitive control signal input and Flip-flops have edge sensitive control signal input. Flip-flops and
latches which use this control signals are called synchronous circuits. So if they don't use clock inputs, then
they are called asynchronous circuits.
7.4.1 RS Latch
RS latch have two inputs, S and R. S is called set and R is called reset. The S input is used to produce HIGH
on Q ( i.e. store binary 1 in flip-flop). The R input is used to produce LOW on Q (i.e. store binary 0 in flip-
flop). Q' is Q complementary output, so it always holds the opposite value of Q. The output of the S-R latch
depends on current as well as previous inputs or state, and its state (value stored) can change as soon as its
inputs change. The circuit and the truth table of RS latch is shown below. (This circuit is as we saw
previously, but arranged to look beautiful.
S R Q Q+
0 0 0 0
0 0 1 1
0 1 X 0
1 0 X 1
1 1 X invalid
The operation has to be analyzed with the 4 inputs combinations together with the 2 possible previous states.
When S = 0 and R = 0: If we assume Q = 1 and Q' = 0 as initial condition, then output Q after input is
applied would be Q = (R + Q')' = 1 and Q' = (S + Q)' = 0. Assuming Q =0 and Q' = 1 as initial condition,
then output Q after the input applied would be Q = (R + Q')' = 0 and Q' = (S + Q)' = 1. So it is clear that
when both S and R inputs are LOW, the output is retained as before the application of inputs. (i.e. there is no
state change).
When S = 1 and R = 0: If we assume Q = 1 and Q' = 0 as initial condition, then output Q after input is
applied would be Q = (R + Q')' = 1 and Q' = (S + Q)' = 0. Assuming Q =0 and Q' = 1 as initial condition,
then output Q after the input applied would be Q = (R + Q')' = 1 and Q' = (S + Q)' = 0. So in simple words
when S is HIGH and R is LOW, output Q is HIGH.
56
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
When S = 0 and R = 1:If we assume Q = 1 and Q' = 0 as initial condition, then output Q after input is
applied would be Q = (R + Q')' = 0 and Q' = (S + Q)' = 1. Assuming Q =0 and Q' = 1 as initial condition,
then output Q after the input applied would be Q = (R + Q')' = 0 and Q' = (S + Q)' = 1. So in simple words
when S is LOW and R is HIGH, output Q is LOW.
When S = 1 and R =1 :No matter what state Q and Q' are in, application of 1 at input of NOR gate always
results in 0 at output of NOR gate, which results in both Q and Q' set to LOW (i.e. Q = Q'). LOW in both the
outputs basically is wrong, so this case is invalid.
The waveform below shows the operation of NOR gates based RS Latch.
It is possible to construct the RS latch using NAND gates (of course as seen in Logic gates section). The
only difference is that NAND is NOR gate dual form. So in this case the R = 0 and S = 0 case becomes the
invalid case. The circuit and Truth table of RS latch using NAND is shown below.
S R Q Q+
1 1 0 0
1 1 1 1
0 1 X 0
1 0 X 1
0 0 X invalid
If you look closely, there is no control signal (i.e. no clock and no enable), so this kind of latches or flip-
flops are called asynchronous logic elements. Since all the sequential circuits are built around the RS latch,
we will concentrate on synchronous circuits and not on asynchronous circuits.
57
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
E is LOW, it drives LOW to both inputs of RS latch. As we saw previously, when both inputs of a NOR
latch are low, values are retained (i.e. the output does not change).
If data makes transition within this setup window and before the hold window, then the flip-flop output is
not predictable, and flip-flop enters what is known as meta stable state. In this state flip-flop output
oscillates between 0 and 1. It takes some time for the flip-flop to settle down. The whole process is called
meta-stability. The waveform below shows input S (R is not shown), and CLK and output Q (Q' is not
shown) for a SR posedge flip-flop.
7.4.3 D Latch
The RS latch seen earlier contains ambiguous state; to eliminate this condition we can ensure that S and R
are never equal. This is done by connecting S and R together with an inverter. Thus we have D Latch: the
same as the RS latch, with the only difference that there is only one input, instead of two (R and S). This
input is called D or Data input. D latch is called D transparent latch for the reasons explained earlier. Delay
flip-flop or delay latch is another name used. Below is the truth table and circuit of D latch. In most real
world designs, only D latches/Flip-Flops are used.
58
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
D Q Q+
1 X 1
0 X 0
Below is the D latch waveform, which is similar to the RS latch one, but with R removed.
7.4.4 JK Latch
The ambiguous state output in the RS latch was eliminated in the D latch by joining the inputs with an
inverter. But the D latch has a single input. JK latch is similar to RS latch in that it has 2 inputs J and K as
shown figure below. The ambiguous state has been eliminated here: when both inputs are high, output
toggles. The only difference we see here is output feedback to inputs, which is not there in the RS latch.
J K Q Q+
1 1 0 1
1 1 1 0
1 0 X 1
0 1 X 0
7.4.5 T Latch
When the two inputs of JK latch are shorted (shunted), a T Latch is formed. It is called T latch as, when
input is held HIGH, output toggles.
59
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
T Q Q+
1 0 1
1 1 0
0 1 1
0 0 0
In the figure above there are two latches, the first latch on the left is called master latch and the one on the
right is called slave latch. Master latch is positively clocked and slave latch is negatively clocked.
60
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
gate level circuit for the problem. Similarly we have a flow for the sequential circuit design. The steps are
given below.
➢ Draw state diagram.
➢ Draw the state table (excitation table) for each output.
➢ Draw the K-map for each output.
➢ Draw the circuit.
Therefore, sequential circuit design flow is very much the same as for combinational circuit.
7.5.3 K-map
The K-map is the same as the combinational circuits K-map. Only difference: we draw K-map for the inputs
i.e. T1 and T0 in the above table. From the table we deduct that we don't need to draw K-map for T0, as it is
high for all the state combinations. But for T1 we need to draw the K-map as shown below, using SOP.
7.5.4 Circuit
There is nothing special in drawing the circuit, it is the same as any circuit drawing from K-map output.
Below is the circuit of 2-bit up counter using the T flip-flop.
61
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
7.6 COUNTERS
Counters are important digital electronic circuits. They are sequential logic circuits because timing is
obviously important and because they need a memory characteristic. Digital counters have the following
important characteristics:
1. Maximum number of counts (modulus of counter)
2. Up or down count
3. Asynchronous or synchronous operation
4. Free-running or self-stopping
As with other sequential circuits, flip-flops are used to construct counters. Counters are extremely useful in
digital systems. Counters can be used to count events such as a number of clock pulses in a given time
(measuring frequency). They can be used to divide frequency and store data as in a digital clock, and they
can also be used in sequential addressing and in some arithmetic circuits.
A logic diagram of a mod-16 counter using JK flip-flops is shown in the next Figure. First note that the J
and K data inputs of the flip-flops are tied to logical 1. This means that each flip-flop is in its toggle mode.
Each clock pulse will then cause the flip-flop to toggle to its opposite state. Note also that the Q output of
FF1 (flip-flop 1) is connected directly to the clock (CLK) input to the next unit (FF2), and so forth. Output
indicators (lamps or LEDs), shown at the upper right, monitor the binary output of the counter. Indicator A
is the LSB (least significant bit), D is the MSB.
62
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The counting sequence for this 3-bit parallel counter is shown above. Note that this is a modulo-8 (mod-8)
counter. The counter will start counting at binary 000 and count up to 111. It will then recycle back to 000 to
start the count again. Hardly any time lag is evident from FF1 to FF3 because all the flip-flops are clocked at
exactly the same time. That is the advantage of the parallel-type counter. Parallel counters are also called
synchronous counters because all flip-flops trigger exactly in time with the clock. Parallel counters are more
complicated (see the added lines and the AND gate), but they are used when the time lag problem with a
ripple counter would cause problems. You should be able to construct a 4-bit parallel counter using the steps
for designing sequential circuits discussed in Section 7.5. Is there a difference from the 4-bit ripple counter?
Formerly, very long (several hundred stages) shift registers served as digital memory. This obsolete
application is reminiscent of the acoustic mercury delay lines used as early computer memory. Serial data
transmission, over a distance of meters to kilometres, uses shift registers to convert parallel data to serial
63
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
form. Serial data communications replaces many slow parallel data wires with a single serial high speed
circuit. Serial data over shorter distances of tens of centimetres, uses shift registers to get data into and out of
microprocessors. Numerous peripherals, including analog to digital converters, digital to analog converters,
display drivers, and memory, use shift registers to reduce the amount of wiring in circuit boards. Some
specialized counter circuits actually use shift registers to generate repeating waveforms. Longer shift
registers, with the help of feedback generate patterns so long that they look like random noise, pseudo-noise.
Basic shift registers are classified by structure according to the following types:
➢ Serial-in/serial-out
➢ Parallel-in/serial-out
➢ Serial-in/parallel-out
➢ Universal parallel-in/parallel-out
➢ Ring counter
7.7.1 Serial-in/serial-out
Above we show a block diagram of a serial-in/serial-out shift register, which is 4-stages long. Data at the
input will be delayed by four clock periods from the input to the output of the shift register. Data at ”data
in”, above, will be present at the Stage A output after the first clock pulse. After the second pulse stage A
data is transferred to stage B output, and ”data in” is transferred to stage A output. After the third clock,
stage C is replaced by stage B; stage B is replaced by stage A; and stage A is replaced by ”data in”. After the
fourth clock, the data originally present at ”data in” is at stage D, ”output”. The ”first in” data is ”first out”
as it is shifted from ”data in” to ”data out”.
7.7.2 Parallel-in/serial-out
Data is loaded into all stages at once of a parallel-in/serial-out shift register. The data is then shifted out via
”data out” by clock pulses. Since a 4- stage shift register is shown above, four clock pulses are required to
shift out all of the data. In the diagram above, stage D data will be present at the ”data out” up until the first
clock pulse; stage C data will be present at ”data out” between the first clock and the second clock pulse;
stage B data will be present between the second clock and the third clock; and stage A data will be present
64
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
between the third and the fourth clock. After the fourth clock pulse and thereafter, successive bits of ”data
in” should appear at ”data out” of the shift register after a delay of four clock pulses. If four switches were
connected to DA through DD, the status could be read into a microprocessor using only one data pin and a
clock pin. Since adding more switches would require no additional pins, this approach looks attractive for
many inputs.
7.7.3 Serial-in/parallel-out
Above, four data bits will be shifted in from ”data in” by four clock pulses and be available at QA through
QD for driving external circuitry such as LEDs, lamps, relay drivers, and horns. After the first clock, the data
at ”data in” appears at QA. After the second clock, The old QA data appears at QB; QA receives next data
from ”data in”. After the third clock, QB data is at QC. After the fourth clock, QC data is at QD. This stage
contains the data first present at ”data in”. The shift register should now contain four data bits.
7.7.4 Parallel-in/parallel-out
A parallel-in/parallel-out shift register combines the function of the parallel-in, serial-out shift register with
the function of the serial-in, parallel-out shift register to yields the universal shift register. The ”do anything”
shifter comes at a price– the increased number of I/O (Input/ Output) pins may reduce the number of stages
which can be packaged. Data presented at DA through DD is parallel loaded into the registers. This data at
QA through QD may be shifted by the number of pulses presented at the clock input. The shifted data is
available at QA through QD. The ”mode” input, which may be more than one input, controls parallel loading
of data from DA through DD, shifting of data, and the direction of shifting. There are shift registers which
will shift data either left or right.
65
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
If the serial output of a shift register is connected to the serial input, data can be perpetually shifted around
the ring as long as clock pulses are present. If the output is inverted before being fed back as shown above,
we do not have to worry about loading the initial data into the ”ring counter”.
B. From Section 7
1. Write short notes on the following:
a) Ripple (asynchronous) counters b) Parallel (synchronous) counters
Hence, design the synchronous and asynchronous versions of a modulo 8 counter.
2. List and state the functions of the various types of Shift registers that you know. Hence, give the detailed
design and practical operation of any three of the listed shift registers.
3. All Computer logic systems are built from Combinational and Sequential logic. Discuss this statement in
relation to the building block of Combinational and Sequential logic. Also, explain the difference between
truth table and state table.
4. Explain the two types of Sequential circuits briefly.
5. Explain the difference between Latches and flip-flops.
6. What is setup and hold time with respect to the operation of flip-flops?
7. List the types of latches/flip-flops that you are aware of and explain the workings of any two of them.
8. List the steps required in design of sequential circuits. Hence, design a 2-bit synchronous down counter.
66
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Among these, only CMOS is most widely used by the Chip designers; we will still try to understand a few of
the extinct / less used technologies.
1) Speed of operation: Speed is typically the first parameter at which a designer looks. Usually people
want high speed devices. So it is normally desired to have a shorter propagation delay time. But
increased speed often creates many potential problems such as: increased noise generation, higher
power consumption, increased component and system cost, more difficult board layout, etc.
2) Operating Temperature: The temperature range in which an IC functions properly is a very
important parameter. The accepted temperature ranges are: 0 to +700C for consumer and industrial
applications whereas -550C to +125 0C for military applications.
3) Logic levels: Logic levels are the voltage levels for logic high and logic low. These are
➢ VOHmin: The minimum output voltage in HIGH state (logic '1'). VOHmin is 2.4V for TTL and 4.9V
for CMOS.
➢ VOLmax: The maximum output voltage in LOW state (logic '0'). VOLmax is 0.4V for TTL and 0.1V
for CMOS.
➢ VIHmin: The minimum input voltage guaranteed to be recognised as logic 1. VIHmin is 2 V for TTL
and 3.5 V for CMOS.
➢ VILmax: The maximum input voltage guaranteed to be recognised as logic 0. VILmax is 0.8 V for
TTL and 1.5V for CMOS.
4) Current levels
➢ IOHmin: The maximum current the output can source in HIGH state while still maintaining the
output voltage above VOHmin.
67
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
➢ IOLmax: The maximum current the output can sink in LOW state while still maintaining the output
voltage below VOLmax.
➢ IImax: The maximum current that flows into an input in any state (1µA for CMOS).
5) Rise time (tr): The time required for the output voltage to increase from VILmax to VIHmin.
6) Fall time (tf): The time required for the output voltage to decrease from VIHmin to VILmax.
7) tp (Propagation delay): The time between the logic transition on an input and the corresponding
logic transition on the output of the logic gate. The propagation delay is measured at midpoints.
Propagation delay is the time taken between 50% of peak points on the input and output transistors.
The propagation delay time of a logic gate varies from 1 nano-second to 50 nano-seconds.
8) Fan-in: Fan-in is the number of inputs a gate has. A two input AND gate has fan-in of two, a three
input NAND gate as a fan-in of three. So a NOT gate always has a fan-in of one. Normally gate
delay increases following a quadratic function of fan-in.
9) Fan-out: The number of gates that each gate can drive, while providing voltage levels in the
guaranteed range, is called the standard load or fan-out. The fan-out really depends on the amount of
electric current a gate can source or sink while driving other gates. Normally as in the case of fan-in,
the delay offered by a gate increases with the increase in fan-out. The effects of loading a logic gate
output with more than its rated fan-out has the following effects:
➢ In the LOW state the output voltage VOL may increase above VOLmax
➢ In the HIGH state the output voltage VOH may decrease below VOHmin.
➢ The operating temperature of the device may increase thereby reducing the reliability of the
device and eventually causing the device failure.
➢ Output rise and fall times may increase beyond specifications
➢ The propagation delay may rise above the specified value.
10) Gate Delay: Gate delay is the delay offered by a gate for the signal appearing at its input, before it
reaches the gate output. The figure below shows a NOT gate with a delay of "Delta", where output X'
changes only after a delay of "Delta". Gate delay is also known as propagation delay. Gate delay is
not the same for both transitions, i.e. gate delay will be different for low to high transition, compared
to high to low transition. Low to high transition delay is called turn-on delay and High to low
transition delay is called turn-off delay.
11) Wire Delay: Gates are connected together with wires and these wires do delay the signal they carry,
these delays become very significant when frequency increases, say when the transistor sizes are
sub-micron. Sometimes wire delay is also called flight time (i.e. signal flight time from point A to
B). Wire delay is also known as transport delay.
68
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
12) Skew: The same signal arriving at different parts of the design with different phase is known as
skew. Skew normally refers to clock signals. In the figure below, clock signal CLK reaches flip-flop
FF0 at time t0, so with respect to the clock phase at the source, it has at FF0 input a clock skew of t0
time units. Normally this is expressed in nanoseconds.
The waveform below shows how clock looks at different parts of the design.
13) Noise Margin: Gate circuits are constructed to sustain variations in input and output voltage levels.
Variations are usually the result of several different factors.
➢ Batteries lose their full potential, causing the supply voltage to drop
➢ High operating temperatures may cause a drift in transistor voltage and current characteristics
➢ Spurious pulses may be introduced on signal lines by normal surges of current in neighbouring
supply lines.
All these undesirable voltage variations that are superimposed on normal operating voltage levels are
called noise. All gates are designed to tolerate a certain amount of noise on their input and output
ports. The maximum noise voltage level that is tolerated by a gate is called noise margin. It derives
from I/P-O/P voltage characteristic, measured under different operating conditions. It's normally
supplied from manufacturer in the gate documentation.
69
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
➢ LNM (Low noise margin): The largest noise amplitude that is guaranteed not to change the
output voltage level when superimposed on the input voltage of the logic gate (when this voltage
is in the LOW interval). LNM=VILmax - VOLmax
➢ HNM (High noise margin): The largest noise amplitude that is guaranteed not to change the
output voltage level if superimposed on the input voltage of the logic gate (when this voltage is
in the HIGH interval). HNM=VOHmin - VIHmin
14) Power Dissipation: Each gate is connected to a power supply VCC (VDD in the case of CMOS). It
draws a certain amount of current during its operation. It is defined as the supply power required for
the logic gate to operate with 50% duty cycle at the specified frequency. The power dissipation of a
logic circuit varies from 0.05 mW to 50mW per gate. This is determined by the current drawn by the
chip. Normally there is only one power supply terminal on the chip, which is normally denoted by
Vcc for TTL devices and by VDD for MOS devices. The power is specified in milli-watts.
Since each gate can be in a High, Transition or Low state, there are three different currents drawn
from power supply.
For TTL, ICCT the transition current is negligible, in comparison to ICCH and ICCL. If we assume
that ICCH and ICCL are equal then,
For CMOS, ICCH and ICCL current is negligible, in comparison to ICCT. So the Average power
dissipation is calculated as below.
So for TTL-like logic family, power dissipation does not depend on frequency of operation, and for
CMOS the power dissipation depends on the operation frequency. Power Dissipation is an important
metric for two reasons. The amount of current and power available in a battery is nearly constant.
➢ Power dissipation of a circuit or system defines battery life: the greater the power dissipation, the
shorter the battery life.
➢ Power dissipation is proportional to the heat generated by the chip or system; excessive heat
dissipation may increase operating temperature and cause gate circuitry to drift out of its normal
operating range; will cause gates to generate improper output values. Thus power dissipation of
any gate implementation must be kept as low as possible.
Moreover, power dissipation can be classified into Static power dissipation and Dynamic power dissipation.
➢ Ps (Static Power Dissipation): Power consumed when the output or input is not changing or rather
when clock is turned off. Normally static power dissipation is caused by leakage current. (As we
reduce the transistor size, i.e. below 90nm, leakage current could be as high as 40% of total power
dissipation).
➢ Pd (Dynamic Power Dissipation): Power consumed during output and input transitions. So we can
say Pd is the actual power consumed i.e. the power consumed by transistors + leakage current.
70
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Thus:
Total power dissipation = static power dissipation + dynamic power dissipation.
Bipolar families:
◦ Diode logic (DL) [obsolete]
◦ Resistor transistor logic (RTL) [obsolete]
◦ Diode transistor logic (DTL) (obsolete)
◦ Transistor Transistor logic (TTL)
◦ Emitter Coupled Logic (ECL), also known as Current Mode Logic(CML).
◦ Integrated Injection logic (I2L)[obsolete]
MOS families:
◦ PMOS family (using P-channel MOSFETs) [obsolete]
◦ The NMOS family (using N-channel MOSFETs)
◦ The CMOS family (using both N- and P-channel devices).
◦ The Bi-MOS logic family uses both bipolar and MOS devices.
8.2.1 Diode Logic
In DL (diode logic), all the logic is implemented using diodes and resistors. One basic thing about the diode,
is that diode needs to be forward biased to conduct. Below is an example of DL circuit.
When no input is connected or driven, output Z is low, due to resistor R1. When high is applied to either X
or Y, or both X and Y are driven high, the corresponding diode get forward biased and thus conducts. When
any diode conducts, output Z goes high.
Notes on DL:
➢ Diode Logic suffers from voltage degradation from one stage to the next.
➢ Diode Logic only permits OR and AND functions.
➢ Diode Logic is used extensively but not in integrated circuits.
71
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
A basic circuit of an RTL NOR gate consists of two transistors Q1 and Q2, connected as shown in the figure
above. When either input X or Y is driven HIGH, the corresponding transistor goes to saturation and output
Z is pulled to LOW.
A simple two input RTL NOR gate is shown below. The circuit consists of four resistors and one transistor
(T). Here the transistor acts as an inverter. When both the inputs are zero (A=0, B=0), the input to the
transistor is zero. So the output of the transistor is HIGH or Logic 1. Similarly, when one of the inputs is
HIGH (logic1), the input to the transistor is HIGH. So the output Q is LOW or logic 0. On the same lines
when both the inputs are HIGH the input to the transistor is HIGH (logic1), so the output of the transistor is
LOW or logic 0. This is the working of two inputs NOR gate which is also shown in the truth table.
____
A B Q= A+B
0 0 1
1 0 0
0 1 0
1 1 0
Notes on RTL:
➢ The basic advantage of RTL technology is that it uses a minimum number of transistors, which was
an important consideration before integrated circuit technology, as transistors were the most
expensive component to produce. Early IC logic production such as Fairchild's in 1961, used the
same RTL approach briefly, but quickly transitioned to higher-performance circuits such as diode–
transistor logic and then transistor–transistor logic, since diodes and transistors were no more
expensive than resistors.
➢ The obvious disadvantage of RTL is its high current dissipation when the transistor conducts to
overdrive the output biasing resistor.
➢ Also another limitation is its limited Fan-In, 3 inputs being the limit for many circuit designs.
➢ RTL circuits are no more in use. They are obsolete
through the 4.7K resistor. Thus there is no current through the diodes connected in series to transistor base.
Hence the transistor does not conduct, thus remains in cut-off, and output out is High. If all the inputs X, Y,
Z are driven high, the diodes in series conduct, driving the transistor into saturation. Thus output out is Low.
A simple two input DTL NAND gate circuit is also shown below. It consists of two Diodes, four resistors
and one Transistor and a power supply V+. Here the Transistor acts as an inverter. When the inputs A & B
are at logic 0 (LOW) , the current due to V+ flows through the Diodes to ground and the current through the
resistors R3 is Zero i.e. the input to the Transistor T is zero. And, the Transistor is in off state and the out-
put at Q is High (Logic1). Similarly when one of the inputs is HIGH (Logic1), the other will be at LOW. So
the current due to V+ will pass through one diode and the other diode is in reverse bias i.e. the input to the
transistor is zero or the transistor is in cut-off state. So the output at Q is HIGH or at logic1. Suppose both
the inputs are HIGH (logic 1).The current due to V+ do not pass through the diodes. The input of the
Transistor will be at Logic 1 i.e. the transistor is in conducting state. Hence the output of the Transistor is
LOW or at logic 0. This working of NAND gate is shown in the truth table.
A B Q= A.B
0 0 1
1 0 1
0 1 1
1 1 0
Notes on DTL:
➢ One problem that DTL suffers is its low speed, especially when the transistor is being turned off.
Turning off a saturated transistor in a DTL gate requires it to first pass through the active region
before going into cut-off. Cut-off, however, will not be reached until the stored charge in its base
has been removed. The dissipation of the base charge takes time if there is no available path from the
base to ground. This is why in DTL circuits a base resistor is connected to ground so that it provides
a path for discharge as shown in the figure.
➢ Another problem with turning off the DTL output transistor is the fact that the effective capacitance
of the output needs to charge up through R2 before the output voltage rises to the final logic '1' level,
which also consumes a relatively large amount of time.
➢ But, one advantage of DTL over RTL is its better noise margin and greater fan-outs than RTL, but it
suffers from low speed, especially in comparison to TTL.
73
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
In Transistor Transistor logic or just TTL, logic gates are built only around transistors. TTL was developed
in 1965. Through the years basic TTL has been improved to meet performance requirements. There are
many versions or families of TTL.
Here we will discuss only standard TTL. All TTL families have three configurations for outputs.
➢ Totem - Pole output.
➢ Open Collector Output.
➢ Tristate Output.
Before we discuss the output stage let's look at the input stage, which is used with almost all versions of
TTL. This consists of an input transistor and a phase splitter transistor. Input stage consists of a multi emitter
transistor as shown in the figure below. When any input is driven low, the emitter base junction is forward
biased and input transistor conducts. This in turn drives the phase splitter transistor into cut-off.
Input stage and Phase splitter stage have been briefly discussed earlier. Output stage is called Totem-Pole
because transistor Q3 sits upon Q4. Q2 provides complementary voltages for the output transistors Q3 and
Q4, which stack one above the other in such a way that while one of these conducts, the other is in cut-off.
Q4 is called pull-down transistor, as it pulls the output voltage down, when it saturates and the other is in
cut-off (i.e. Q3 is in cut-off). Q3 is called pull-up transistor, as it pulls the output voltage up, when it
saturates and the other is in cut-off (i.e. Q4 is in cut-off). Diodes in input are protection diodes which
conduct when there is large negative voltage at input, shorting it to the ground.
74
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
75
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Emitter coupled logic (ECL) is a non-saturated logic, which means that transistors are prevented from going
into deep saturation, thus eliminating storage delays. Preventing the transistors from
going into saturation is accomplished by using logic levels whose values are so close to each other that a
transistor is not driven into saturation when its input switches from low to high. In other words, the transistor
is switched on, but not completely on. This logic family is faster than TTL. Voltage level for high is -0.9
Volts and for low is -1.7V; thus biggest problem with ECL is a poor noise margin.
The ECL circuits usually operate with negative power supplies (positive end of the supply is connected to
ground) in contrast to other logic families in which negative end of the supply are grounded. This is done
mainly to minimize the influence of the power supply variations on the logic levels as ECL is more sensitive
to noise on the VCC and relatively immune to noise on VEE. Because ground should be the most stable
voltage in a system, ECL is specified with a positive ground
A typical ECL OR gate is shown below. When any input is HIGH (-0.9v), its connected transistor will
conduct, and hence will make Q3 off, which in turn will make Q4 output HIGH. When both inputs are LOW
(-1.7v), their connected transistors will not conduct, making Q3 on, which in turn will make Q4 output
LOW.
The basic circuit configuration consists of a pair of NPN transistors with their emitters connected together
and fed by a current source IE as shown below.
Emitter coupled logic is basically a combination of differential amplifier with Q1 &Q2 and Emitter
followers with Q3 & Q4.This emitter-follower provides low output impedance typically of the order of 6-8
Ω. In the steady state, either Q1 or Q2 is ON but not both, and the output logic state is determined by the
voltage difference between the bases of Q1 and Q2. If Vb1 – Vb2 > 200 mV, Q1 will be turned ON and Q2
turned OFF, and vice versa.
76
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The inputs can be driven either differentially or single-ended. In the single-ended mode, the non-driven base
must be connected to a suitable bias voltage, VBB, which is either supplied internally by the device, or
externally. The voltages developed at the collectors of Q1 and Q2 are connected to a pair of emitter
followers, Q3 and Q4. The outputs are taken at the emitters of Q3 and Q4.The two outputs are complements
of each other. So if one is the OR output, the other will be the NOR output. Note that the output emitters are
open, and, unlike TTL/CMOS circuits, there will be no output until a pull-down resistor is connected to the
open emitter. This pull-down resistor plays a very important role in determining the performance of the ECL
circuit.
Notes on ECL:
➢ The power dissipation is of the order of 50mW and Fan-out is typically around 15 to 20.
➢ Due to the disadvantage of high power dissipation and relatively low noise margins ECL family has
limited applications, except in high frequency applications.
Normally it is difficult to fabricate resistors inside the chips, so the resistor is replaced with an NMOS gate
as shown above. This new NMOS transistor acts as resistor.
77
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
CMOS Sub families include ICs with the following part numbers
➢ 4000A (obsolete)
➢ 4000B, 4000UB,
➢ 54/74C, 54/74HC, 54/74HCT, 54/74AC and 54/74ACT(TTL pin compatible)
78
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
A popular type of IC is illustrated in the Figure above. This particular IC is called a 14-pin DIP integrated
circuit. Note that immediately counter clockwise from the notch on the IC shown is pin number 1. The pins
are numbered counter clockwise from 1 to 14 when viewed from the top of the IC. Manufacturers of ICs
provide pin diagrams similar to the one above for a 7408 IC. Note that this IC contains four 2-input AND
gates; thus it is called a quadruple 2-input AND gate. Figure below shows the IC pins numbered from 1
through 14 in a counter clockwise direction from the notch. The power connections to the IC are the GND
(pin 7) and Vcc (pin 14) pins. All other pins are the inputs and outputs to the four AND gates. The 7408 IC
is part of TTL family of logic devices. It is one of many the most popular logic devices.
79
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Given the logic diagram above, how do we wire a circuit using a 7408 IC? A wiring diagram for the circuit
is shown below. A 5-V power supply is used with all TTL devices. The positive (Vcc) and negative (GND)
power connections are made to pins 14 and 7. Input switches (A and B ) are wired to pins 1 and 2 of the
7408 IC. Note that, if a switch is in the up position, a logical 1 (+5V) is applied to the input of the AND
gate. At the right, a light-emitting diode (LED) and 150-ohm limiting resistor are connected to ground. If the
output at pin 3 is HIGH (+5V), current will flow through the LED. Lighting the LED indicates a HIGH, or a
binary 1, at the output of the AND gate. The LED lights only when both input switches (A and B) are at
+5V.
Manufacturers of integrated circuits also produce other logic functions. Figure below illustrates pin diagrams
for two basic TTL ICs. Figure (a) is the pin diagram for a quadruple 2-input OR gate. In other words, the
7432 IC contains four 2-input OR gates. It could be wired and tested in a manner similar to the testing of the
AND gate shown earlier. The 7404 IC shown in Figure (b) is also a TTL device. The 7404 IC contains six
NOT gates, or inverters. The 7404 is described by the manufacturer as a hex inverter IC. Note that each IC
has its power connections (V,, and GND). A 5-V dc power supply is always used with TTL logic circuits.
80
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Two variations of DIP ICs are illustrated below. The integrated circuit shown in Fig (a) has 16 pins with pin
1 identified by using a dot instead of a notch. The IC shown in Fig (b) is a 24-pin DIP integrated circuit with
pin 1 located immediately counter clockwise (viewed from top) from notch.
The 7408, 7432, and 7404 ICs are all from the TTL logic family. The newer complementary metal oxide
semiconductor (CMOS) family of ICs has been gaining popularity because of its low power requirements.
Logic gates (AND, OR, and NOT) also are available in DIP IC form in the CMOS family. Typical DIP ICs
might be the CMOS 74C08 quad 2-input AND gate, 74C04 hex inverter, or the 74C32 quad 2-input OR
gate. The 74CXX series of CMOS gates is not directly compatible with the TTL 7400 series of integrated
circuits.
Three 3-input NAND gates are housed in the 7410ICwhose pin diagram is shown beside the 7400IC. This
device is described by the manufacturer as a triple 3-input NAND gate IC. NAND gates with more than
three inputs also are available. The 7400 and 7410 ICs were from the common TTL logic family.
81
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
Manufacturers also produce a variety of NAND, NOR, and XOR gates in CMOS-type ICs. Typical NAND
gates might be the CMOS 74COO quad 2-input NAND gate, 74C30 8-input NAND gate, and 4012 dual 4-
input NAND gate DIP ICs. Some CMOS NOR gates in DIP IC form are the 74C02 quad 2-input NOR gate
and the 4002 dual 4-input NOR gate. Several exclusive-OR gates are produced in CMOS; examples are the
74C86 quad 2-input XOR gate and the 4030 quad 2-input XOR gate. Note that CMOS ICs come in both a
74COO series and a 4000 series. It must be remembered that without special interfacing, TTL and CMOS
ICs are not compatible.
An encoder using the CMOS technology also is available. The 74HC147 10-to-4 Line Priority Encoder is
one of many DIP ICs available from National Semiconductor Corporation in its 74HC00 series. A practical
decoder system is shown below. A BCD number is entered at the left into the 7447A decoder. The decoder
activates the proper outputs and allows the correct decimal to appear on the display. The display is a
common seven segment LED display.
82
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
The ICs for the 4-bit parallel full adder and subtracter are shown above. Note that the subtracter is
constructed from the adder by complementing the subrahend and making the carry-in HIGH to produce the
twos complement of the subrahend. This is illustrated in the diagram between the adder and subtracter.
83
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
9.4.1 Counters
The 74192 IC is described by the manufacturers as a TTL synchronous BCD up/down counter. A block
symbol of the 74192 IC decade counter is shown below. Note the use of dual clock (CLK) inputs. If the
count-up clock input is pulsed, the counter will count upward from 0000 to 1001 (0 to 9 in decimal). If the
count-down clock input is pulsed, the counter will count downward from 1001 to 0000 (9 to 0 in decimal).
The counter toggles on the L-to-H transition of the clock pulse.
A second counter in IC form is detailed below. A block diagram of the TTL 7493 4-bit binary counter is
shown in Fig (a). Note the use of four JK flip-flops each in the toggle mode. Inputs D, and p, are clock
inputs. Note that normal output Q of the left-hand flip-flop in Fig (b) is not connected to the clock input of
the second FF. To form a 4-bit mod-16 ripple counter, an external connection must be made from Q0 to CP1
(pin 12 to pin 1), with Q0 serving as the counter clock input. The 7493 IC has two reset inputs (MR1 and
MR2) as shown in Fig (a). Under normal use, the reset inputs of the 7493 IC must not be left disconnected
(floating). The reset pins float HIGH, which places the IC in the reset mode. While in the reset mode, the
7493 IC cannot count. The reset inputs are asynchronous and override both clocks. The CMOS version
(74HC393) is also shown afterwards.
84
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
A wide variety of CMOS shift registers are available from chip manufacturers. The 74HC164 8-bit serial-in,
parallel-out shift-register IC is shown below. Information from the manufacturer's data manual is also
reproduced.
85
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
86
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
B. From Section 9
1. What logic function is performed by the circuit illustrated below? (7432 is a Quad 2-input OR IC from the
TTL family)
2. Construct the truth table for the circuit shown below. (7400 is a Quad 2-input NAND IC from the TTL
family)
87
Computer Engineering (CPE305)- Course notes [Jan-March 2023] CPE FUOYE
3. Write the Boolean expression and construct the truth table for the circuit shown below. (7400 and 7410
are Quad 2-input and triple 3-input NAND ICs respectively from the TTL family).
4. Digital logic gate circuits are manufactured as integrated circuits typically in form of Dual-Inline-
Packages. Discuss the pin configuration of any gate IC in relation to the pin count, logic family, commercial/
military grade, other compatible ICs in the same family and non-compatible ICs from other logic families.
5. The 7483 IC is a 4-bit parallel full adder. Discuss how this can be configured to give a 4-bit parallel full
subtracter circuit showing the schematic diagram.
88