You are on page 1of 8

DIGITAL LOGIC CIRCUITS

Learning Objectives

• Understand the different binary codes


• Discuss the variety of digital logic gates and its corresponding truth table
• Identify the different logic family series

Binary Codes

Binary codes are group of bits used in representation, storage and transmission of digital
data. It allows the computer to efficiently process complex calculations easily. Binary
codes can be broadly classified into five groups; Weighted Binary Codes, Non-weighted
Codes, Error-detection Codes, Error-Correcting Codes and Alphanumeric Codes.

Weighted Binary Codes

Each position of the symbol represents a specific weight. Symbols can be presented by
0-9, A-E symbols. Weights are based on the number system it represents. For instance,
decimal number system uses base 10. The symbols 1, 9, 8, and 4 are position in thousand,
hundred, tens and ones place.

Bits are multiplied by their corresponding individual weights and then adds its value to
get the equivalent decimal values. For example:

1 9 8 4
Decimal Number

Positional
Weights 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1

Code 0 0 0 1 1 0 0 1 1 0 0 0 0 1 0 0

Binary-Coded-Decimal (BCD) is also known as 8-4-2-1 code which represents the


positional weights for a four-bit of the BCD code.

Non-Weighted Binary Codes

Positional weights are not assigned in non-weighted binary codes. Each position of the
binary number is not associated with fixed value. Excess-3 Codes and Gray codes are an
example of non-weighted codes.

1
Excess-3 Codes are derived from BCD Codes after adding 310 or 00112 to each code word
to express decimal numbers.

Decimal BCD Code EXCESS-3


NUMBER 8 4 2 1 BCD + 0011

0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100

Gray Code is a cyclic code that changes one bit as it proceeds from one number to the
next as shown in the table below. Gray codes are not useful in arithmetic operation. It is
commonly used in the shaft encoders.

Hexadecimal BCD Code GRAY CODE


NUMBER 8 4 2 1

0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
A 1010 1111
B 1011 1110
C 1100 1010
D 1101 1011
E 1110 1001
F 1111 1000

The most significant bit (MSB) of the BCD is also the MSB of the GRAY code. The next bit
of Gray Code is the XOR of MSB and next bit. Continue the cycle to get the next bit, is
the XOR or the succeeding bits.

2
Error-Detection Codes

To detect an error during data transmission, an extra bit called parity bit, is added to the
message. Parity check is the simplest technique of error-detecting codes. For example in
parity checking for 8-bits word where parity bit is the MSB and the remaining bits are the
message bits.

MSB LSB
P Data6 Data5 Data4 Data3 Data2 Data1 Data0

Parity bit 7 data bits

The 1’s in the given word including the parity bit are even are called Even Parity. Odd
Parity means the 1’s in the given word including the parity bit are odd. Although
depending of the parity requirements, bits can be set to either 0 or 1.

Error-Correction Codes

These code does not only detect errors in data transmission, it can also correct them.
R.W. Hamming developed a code where one or more parity bits are added to a data
character methodically in order to detect and correct errors. The number of bits
changed from one code to another is known as Hamming Distance.

Alphanumeric Codes

An alphanumeric codes is a binary code of a group of elements consisting of ten decimal


digits, 26 letters of the alphabet (both upper case and lowercase), and special symbols.
The common data representation of alphanumeric are as follows:
• American Standard Code for Information Interchange (ASCII)
• Extended Binary Coded Decimal Interchange Code (EBCDIC)
• Hollerit Code

Digital Logic Gates

Gates are used to describe the implementation of most operations within binary system
for digital circuits. Digital logic circuit operates with voltage LOW and HIGH which
represents 0 and 1 respectively and manipulates it using transistors.

3
1. AND Gate
The AND Gate produces HIGH output when all of its inputs are HIGH. The output is
LOW if any of its input is LOW. It is the logical product operation where all inputs
are multiplied together and will have only a 1 result if every input is 1 otherwise it
will result a 0 output.

A B Out
A 0 0 1 1
A 0 0 0
Out B 0 1 0 1
0 1 1
B Out 0 0 0 1
1 0 1
time

1 1 1
Symbol Truth Table Waveform

There are variety of Transistor-Transistor Logic (TTL) AND Gates with 2-input, 3-input
and 4-input packages. It is supplied by 5volts connected to pin 15. The figure
below shows the pin configuration of a 7408, a TTL quad 2-input AND gate. It
contains four sets of 2-input AND Gates.

2. OR Gate
The output of an OR Gate will always be HIGH if any of its input is HIGH. It is the
logical sum operation because of its similarity of logical disjunction where the
output is 1 if at least one of its input is 1. It will only produces 0 output if all inputs
are LOW.

A B Out A 0 0 1 1
A
Out 0 0 0 B 0 1 0 1

B 0 1 1 Out 0 1 1 1
1 0 1 time

4
1 1 1
Symbol Truth Table Waveform

TTL quad 2-input OR Gate of 7432 is supplied with 5 volts connected in pin 14 as
shown below. There are four sets of 2-input OR Gate in this digital IC.

3. Inverter
The inverter produces the complement of its input. If produces HIGH output if the
input is LOW and vice-versa.

A Out A 0 1
A Out 0 0 Out 1 0
1 1
Symbol Truth Table Waveform

The 7404 hex inverter as shown in the figure below contains 6 set of inverters. Each
set has one input and one output only.

4. Buffer

5
The main purpose of a buffer is to amplify power signal of its input. Similar to
inverter, it only have one input and one output though the value of its output is
the same as its input. The symbol below is used for a buffer.

A Out

5. NAND Gate
NAND Gate is equal to an AND gate followed by an inverter. It has n inputs and
one output, where n is >= 2. All input must be HIGH to produce a LOW output.

A B Out
A 0 0 1 1
A 0 0 1
Out B 0 1 0 1
0 1 1
B Out 1 1 1 0
1 0 1
time

1 1 0
Symbol Truth Table Waveform

In IC 7400 series, the standard NAND Gate with 2-inputs is the 74x00 IC. The figure
below shows the pin configuration of 74x00. NAND Gate is also available in 3-inputs
4-inputs, and 8-inputs namely 74x10, 74x20, and 74x30 IC respectively.

6. NOR Gate
A NOR Gate produces HIGH output if all inputs are LOW. It is equivalent to an OR
gate followed by an inverter. It also has n input and one output where n is >= 2.

6
A B Out
A 0 0 1 1
A 0 0 1
Out B 0 1 0 1
0 1 0
B Out 1 0 0 0
1 0 0
time

1 1 0
Symbol Truth Table Waveform

The 74x02 is the basic quad 2-input NOR Gate as shown in figure below. It has
variety of input in the TTL 74 series; 74x27 triple 3-inputs and 74x25 dual 4-inputs
NOR Gate IC.

7. Exclusive-OR (XOR) Gate


It is a special type of gate which is commonly used in the adders and subtractors.
It is similar to an OR Gate except that XOR gate produces LOW output if all inputs
are the same.

A B Out
A A 0 0 1 1
0 0 0
Out B 0 1 0 1
0 1 1
B Out 0 1 1 0
1 0 1
time

1 1 0
Symbol Truth Table Waveform
8. Exclusive-NOR (XNOR) Gate
The ENOR Gate is the complement of the XOR Gate. The gate produces HIGH
output only if all inputs are the same.

7
A B Out
A 0 0 1 1
A 0 0 1
Out B 0 1 0 1
0 1 0
B Out 1 0 0 1
1 0 0
time

1 1 1
Symbol Truth Table Waveform

Truth Table

It is a mathematical table used to illustrate the possible outcomes of all possible scenario.
Truth table is a combination of input values and the corresponding output for logic
problems in electronic circuits and Boolean algebra. The total number of possible
combination of inputs are computed using n2, where n is the number of inputs in a given
problem.

Digital Logic Families

The vast innovation of technology leads the creation of Integrated Circuits (IC) from early
usage of transistors, diodes and resistors in implementing digital logic gates. It gives us the
capability to develop Small-Scale Integration (SSI), Medium-Scale Integration (MSI),
Large-Scale Integration (LSI) and Very-Large-Scale Integration (VLSI). It aims to improve
the circuit fabrication to a smaller, faster and a minimum supplied power. Here are some
of the logic families available in the market.
• Transistor-Transistor Logic (TTL)
• Emitter-Coupled Logic (ECL)
• Metal Oxide Semiconductors (MOS)
• Complementary Metal Oxide Semiconductors (CMOS)
• Bipolar Complementary Metal Oxide Semiconductors (BICMOS)
• Integrated Injection Logic (IIL)
• Gallium Arsenide (GaAS)

You might also like