5 Module 3
5 Module 3
Module – 3
Boolean Algebra and Logic Circuits
Course Instructor
Ms. SOBIA NAZ
Assistant Professor
Dept. of ECE
NIE, Mysuru
(Although multivalued systems have been built, two-valued systems are more reliable and thus almost all
Computers and calculators are obvious examples of digital systems, but most electronic systems contain a
The music that we listen to on our CD players or iPods, the individual dots on a computer screen (and on
the smart digital televisions), and most cell phone signals are coded into strings of binary digits, referred to as
bits.
information.
Any set that is restricted to a finite number of elements contains discrete information.
Examples of discrete sets are the 10 decimal digits, the 26 letters of the alphabet, the 52 playing cards, and
A system has three inputs A, B, and C, and one output, Z, such that Z=1 if and
only if* two of the inputs are 1.
Table. A truth table
Integers are normally written using a positional number system, in which each digit represents the
coefficient in a power series.
(101111)2 = 1 * 25 + 0 * 24 + 1 * 23 + 1 * 22 + 1 * 21 + 1*20
= 32 + 8 + 4 + 2 + 1
= (47)10
(4021.2)5 = (__________________) 10
= 4 * 53 + 0 * 52 +2 * 51 + 1 * 50 + 2 * 5-1
= (511.4)10
(B65F)H/16 = (__________________) 10
= 11 * 163 + 6 * 162 + 5 * 161 + 15 * 160
DEPT. OF ECE, NIE MYSURU 07/03/2024 10
Logic Design
Introduction to number systems
Table: Powers of 2 Table: First 32 binary integers
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15
DEPT. OF ECE, NIE MYSURU
1111 17 F 07/03/2024 12
Logic Design
Introduction to number systems
Note:
1. (1010.011)2 = (___________)10
= (10.375)10
2. (630.4)8 = (___________)10
= (408.5)10
3. (41)10 = (___________)2
4. (746)10 = (___________)2
= (1011101010)2
5. (153)10 = (___________)8
= (231)8
(41.6875)10 = (101001.1011)2
(153.513)10 = (231.406517)8
(10110001101011.111100000110)2 = (_________________________)16
10 1100 0110 1011 . 1111 0000 0110
2 C 6 B F 0 6
DEPT. OF ECE, NIE MYSURU 07/03/2024 21
Logic Design
Introduction to number systems
(306.D)16 = (_________________________)2
0011 0000 0110 . 1101
3 0 6 D
Complements are used in digital computers for simplifying the subtraction operation and for logical
manipulation.
There are two types of complements for each base-r system:
i. The RADIX complement – referred to as r’s complement
ii. Diminished RADIX complement – referred to as (r-1)’s complement
If base, r=2 RADIX complement – referred to as 2’s complement for binary
Diminished RADIX complement – referred to as 1’s complement for binary
If base, r=10 RADIX complement – referred to as 10’s complement for decimal numbers
Diminished RADIX complement – referred to as 9’s complement decimal numbers
i) X – Y
Step 1: Take 2’s complement of Y
Given Y= 1000011
2’s complement of Y = 0111100 + 1 = 0111101
X= 1010100
2’s complement of Y = + 0111101
Sum = 10010001
Discard end carry by 27 = -10000000
DEPT. OF ECE, NIE MYSURU
Answer: X – Y = 0010001 07/03/2024 35
Logic Design
PROBLEM 6:
Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction:
i) X - Y ii) Y – X using 2’s complements.
ii) Y – X
Step 1: Take 2’s complement of X
Given X= 1010100
2’s complement of X = 0101011 + 1 = 0101100
Y= 1000011
2’s complement of X = + 0101100 ANSWER: Y - X = - (2’s complement of 1101111)
= - (0010000 + 1)
ANSWER: Y - X = - (0010001)
Sum = 1101111
There is no end carry
DEPT. OF ECE, NIE MYSURU 07/03/2024 36
Logic Design
PROBLEM 7:
Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction:
i) X - Y ii) Y – X using 1’s complements.
i) X – Y
Step 1: Take 1’s complement of Y
Given Y= 1000011
1’s complement of Y = 0111100
X= 1010100
1’s complement of Y = + 0111100
Sum = 10010000
End around carry= + 1
DEPT. OF ECE, NIE MYSURU
Answer: X – Y = 0010001 07/03/2024 37
Logic Design
PROBLEM 7:
Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction:
i) X - Y ii) Y – X using 1’s complements.
ii) Y – X
Step 1: Take 1’s complement of X
Given X= 1010100
1’s complement of X = 0101011
Y= 1000011
1’s complement of X = + 0101011 ANSWER: Y - X = - (1’s complement of 1101110)
ANSWER: Y - X = - (0010001)
Sum = 1101110
There is no end carry
DEPT. OF ECE, NIE MYSURU 07/03/2024 38
Logic Design
SELF LEARNING TOPIC
SIGNED BINARY NUMBERS
BINARY CODES
x y x•y x y x+y x x΄
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
These rules are exactly the same as that of AND, OR and NOT operations
Closure is obvious from the tables since the result of each operation is either 1 or 0 and 1, 0 ⋲ B
From the table it can be seen that: a) 0 + 0 = 0 ; 0 + 1 = 1 + 0 = 1
b) 1 • 1 = 1 ; 1 • 0=0 • 1=0
The commutative laws are obvious from the symmetry of the binary operator table.
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
Theorems
1. x+x=x
2. x•x=x
3. x+1=1
4. x•0=0
5. (x΄)΄ = x
6. x + xy=x
7. x(x+y)=x
To overcome the above limitation faced with Half adders, Full Adders are implemented.
It is an arithmetic combinational logic circuit that performs addition of three single bits.
It contains three inputs (A, B, Cin) and produces two outputs (Sum and Cout).
A multiplexer or MUX, also called a data selector, is a combinational circuit with more than one input line,
one output line and more than one selection line.
There are some multiplexer ICs that provide complementary outputs.
Also, multiplexers in IC form almost invariably have an ENABLE or STROBE input, which needs to be active
for the multiplexer to be able to perform its intended function.
A multiplexer selects binary information present on any one of the input lines, depending upon the logic
status of the selection inputs, and routes it to the output line.
If there are n selection lines, then the number of maximum possible input lines is 2 n and the multiplexer is
referred to as a 2n-to-1 multiplexer or 2n × 1 multiplexer.
In the 8 to 1 multiplexer, there are total eight inputs, i.e., A 0, A1, A2, A3, A4, A5, A6, and A7, 3 selection lines, i.e.,
On the basis of the combination of inputs that are present at the selection lines S 0, S1, and S2, one of these 8
inputs are connected to the output.
The block diagram and the truth table of the 8×1 multiplexer are given below.
A De-multiplexer is a combinational circuit that has only 1 input line and 2 N output lines.
Simply, the multiplexer is a single-input and multi-output combinational circuit.
The information is received from the single input lines and directed to the output line.
On the basis of the values of the selection lines, the input will be connected to one of these outputs.
De-multiplexer is opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2n outputs. So, there is a total of 2n possible
combinations of inputs. De-multiplexer is also treated as De-mux.
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y 0, and Y1, 1 selection lines, i.e., S0, and single
input, i.e., A.
On the basis of the selection value, the input will be connected to one of the outputs.
The block diagram and the truth table of the 1×2 multiplexer are given below.
On the basis of the combination of inputs which are present at the selection lines S 0 and S1, the input be
connected to one of the outputs. T
he block diagram and the truth table of the 1×4 multiplexer are given below.
In 1 to 8 De-multiplexer, there are total of eight outputs, i.e., Y 0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7, 3 selection lines,
On the basis of the combination of inputs which are present at the selection lines S 0, S1 and S2, the input will
be connected to one of these outputs.
The block diagram and the truth table of the 1×8 de-multiplexer are given below.
8 to 3 line Encoder:
The 8 to 3 line Encoder is also known as Octal to Binary Encoder.
In 8 to 3 line encoder, there is a total of eight inputs, i.e., Y 0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three outputs,
i.e., A0, A1, and A2. In 8-input lines, one input-line is set to true at a time to get the respective binary code in
the output side.
Below are the block diagram and the truth table of the 8 to 3 line encoder.
The combinational circuit that change the binary information into 2 N output lines is known as Decoders.
The binary information is passed in the form of N input lines.
The output lines define the 2N-bit code for the binary information. In simple words, the Decoder performs the
reverse operation of the Encoder.
At a time, only one input line is activated for simplicity. The produced 2 N-bit output code is equivalent to the
binary information.
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A 0, and A1 and E and four outputs, i.e., Y0, Y1, Y2,
and Y3.
For each combination of inputs, when the enable 'E' is set to 1, one of these four outputs will be 1.
The block diagram and the truth table of the 2 to 4 line decoder are given below.
A clock signal is considered as the square wave. Sometimes, the signal stays at logic, either high 5V or low 0V,
to an equal amount of time.
It repeats with a certain time period, which will be equal to twice the 'ON time' or 'OFF time'.
Types of Triggering
These are two types of triggering in sequential circuits:
Level triggering
The logic High and logic Low are the two levels in the clock signal.
In level triggering, when the clock pulse is at a particular level, only then the circuit is activated.
There are the following types of level triggering:
Types of Triggering
Positive level triggering
In a positive level triggering, the signal with Logic High occurs.
So, in this triggering, the circuit is operated with such type of clock signal. Below is the diagram of positive
level triggering:
Types of Triggering
Negative level triggering
In negative level triggering, the signal with Logic Low occurs.
So, in this triggering, the circuit is operated with such type of clock signal.
Below is the diagram of Negative level triggering:
Types of Triggering
Edge triggering
In clock signal of edge triggering, two types of transitions occur, i.e., transition either from Logic Low to Logic
High or Logic High to Logic Low.
Based on the transitions of the clock signal, there are the following types of edge triggering
Positive Edge Triggering
Negative Edge Triggering
Types of Triggering
Positive Edge triggering
The transition from Logic Low to Logic High occurs in the clock signal of positive edge triggering.
So, in positive edge triggering, the circuit is operated with such type of clock signal.
The diagram of positive edge triggering is given below.
Types of Triggering
Negative Edge triggering
The transition from Logic High to Logic low occurs in the clock signal of negative edge triggering.
So, in negative edge triggering, the circuit is operated with such type of clock signal.
The diagram of negative edge triggering is given below.
Latches
Latches are basic storage elements that operate with signal levels (rather than signal transitions).
Latches controlled by a clock transition are flip-flops.
Latches are level-sensitive devices.
Latches are useful for the design of the asynchronous sequential circuit.
Latches are sequential circuit with two stable states.
These are sensitive to the input voltage applied and does not depend on the clock pulse.
Flip flops that do not use clock pulse are referred to as latch.
SR Latches
S-R latches i.e., Set-Reset latches are the simplest form of latches and are implemented using two inputs: S
(Set) and R (Reset).
The S input sets the output to 1, while the R input resets the output to 0. When both S and R inputs are at 1,
the latch is said to be in an “undefined” state.
They are also known as preset and clear states. The SR latch forms the basic building blocks of all other types
of flip-flops.
SR Latch is a logic circuit with:
2 cross-coupled NOR gate or 2 cross-coupled NAND gate.
2 input S for SET and R for RESET
2 output Q, Q’.
SR Latches
S R Q Q ̅
0 0 Not used
0 1 1 0
1 0 0 1
Previous
1 1
state
A Counter is a device which stores (and sometimes displays) the number of times a particular event or
process has occurred, often in relationship to a clock signal.
Counters are used in digital electronics for counting purpose, they can count specific event happening in the
circuit. For example, in UP counter a counter increases count for every rising edge of clock.
Not only counting, a counter can follow the certain sequence based on our design like any random sequence
0,1,3,2… .
They can also be designed with the help of flip flops.
They are used as frequency dividers where the frequency of given pulse waveform is divided.
Counters are sequential circuit that count the number of pulses can be either in binary code or BCD form.
The main properties of a counter are timing , sequencing , and counting.
An ‘N’ bit Asynchronous binary up counter consists of ‘N’ T flip-flops. It counts from 0 to 2 𝑁 − 1. The block
diagram of 3-bit Asynchronous binary up counter is shown in the following figure.
The 3-bit Asynchronous binary up counter contains three T flip-flops and the T-input of all the flip-flops
are connected to ‘1’.
All these flip-flops are negative edge triggered but the outputs change asynchronously. The clock signal is
directly applied to the first T flip-flop. So, the output of first T flip-flop toggles for every negative edge of
clock signal.
The output of first T flip-flop is applied as clock signal for second T flip-flop. So, the output of second T flip-
flop toggles for every negative edge of output of first T flip-flop.
Similarly, the output of third T flip-flop toggles for every negative edge of output of second T flip-flop, since
the output of second T flip-flop acts as the clock signal for third T flip-flop.
Assume the initial status of T flip-flops from rightmost to leftmost is 𝑄2𝑄1𝑄0=000
Here, 𝑄2 and𝑄1 are MSB & LSB respectively. We can understand the working of 3-bit asynchronous binary
counter from the following table.
An ‘N’ bit Asynchronous binary down counter consists of ‘N’ T flip-flops. It counts from 2 𝑁 − 1 to 0.
The block diagram of 3-bit Asynchronous binary down counter is shown in the following figure.
The block diagram of 3-bit Asynchronous binary down counter is similar to the block diagram of 3-bit
Asynchronous binary up counter.
But, the only difference is that instead of connecting the normal outputs of one stage flip-flop as clock signal for
next stage flip-flop, connect the complemented outputs of one stage flip-flop as clock signal for next stage flip-
flop.
Complemented output goes from 1 to 0 is same as the normal output goes from 0 to 1.
Assume the initial status of T flip-flops from rightmost to leftmost is Q2Q1Q0=000. Here, Q2 & Q0 are MSB & LSB
respectively.
We can understand the working of 3-bit asynchronous binary down counter from the following table.