CAO NOTES- Unit 1
CAO NOTES- Unit 1
UNIT 1 NOTES
Binary logic deals with binary variables and with operations that assume a logical meaning. It is used to
describe, in algebraic or tabular form, the manipulation and processing of binary information. The manipulation
of binary information is done by logic circuits called gates. Gates are blocks of hardware that produce signals
of binary 1 or 0 when input logic requirements are satisfied.
Truth table:
A truth table is a breakdown of all the possible truth values returned by a logical expression. A truth value is
typically either true or false, or 1 or 0.
A Boolean expression is a logical statement that evaluates a condition and returns a Boolean value,
which is either true or false.
Combinational Circuits:
A combinational circuit is a connected arrangement of logic gates with a set of inputs and outputs. A
combinational circuit transforms binary information from the given input data to the required output data.
Combinational circuits are employed in digital computers for generating binary control decisions and for
providing digital components required for data processing.
A combinational circuit can be described by a truth table showing the binary relationship between the n input
variables and the m output variables. The truth table lists the corresponding output binary values for each of
the 2n input combinations. A combinational circuit can also be specified with m Boolean functions one for
each output variable. Each output function is expressed in terms of the n input variables.
X Y C S X
0 0 0 0 S
Y
0 1 0 1
1 0 0 1
1 1 1 0
C
(a) Truth table
(b) Logic diagram
The logic diagram is shown in fig(b). It consists of an exclusive -OR gate and an AND gate. A half-adder logic
module of an exclusive OR gate and an AND gate can be used to implement universal logic gates NAND and
NOR.1
Full-Adder
A full-adder is a combinational circuit that forms the arithmetic sum of three input bits. It consists of
three inputs and two outputs. Two of the input variables, denoted by X and Y, represent the two
significant bits to be added. The third input Z, represents the carry from the previous lower significant
position. Two outputs are necessary because the arithmetic sum of three binary digits ranges in value
from 0 to 3, and binary 2 or 3 needs two digits. The two outputs are designated by the symbols S (for
sum) and C (for carry). The binary variable S gives the value of the least significant bit of the sum. The
binary variable C gives the output carry.
The truth table of the full-adder is shown below. The eight rows under the input variables
designate all possible combinations that the binary variables may have. The values of the output
variables are determined from the arithmetic sum of the input bits. When all input bits are 0, the
output is 0. The S output is equal to 1 when only one input is equal to 1 or when all three inputs are
equal to 1. The C output has a carry of 1 if two or three inputs are equal to 1.
S = X ⊕ Y⊕ Z
C = XY + (X ⊕ Y) Z
The logic diagram and block diagram of the full-adder is shown in fig below. The full adder circuit consists of
two half-adders and an OR gate.
Logic diagram of Full Adder
X S
Y Full Adder
Z C
Types of Mux
The Mux can be of different types based on input but in this article we will go through two major
types of mux which are
• 2×1 Mux
• 4×1 Mux
•
2×1 Multiplexer
The 2×1 is a fundamental circuit which is also known 2-to-1 multiplexer that are used to choose
one signal from two inputs and transmits it to the output. The 2×1 mux has two input lines, one
output line, and a single selection line. It has various applications in digital systems such as in
microprocessor it is used to select between two different data sources or between two
different instructions.
Given Below is the Block Diagram and Truth Table of 2:1 Mux. In this Block Diagram where I0
and I1 are the input lines, Y is the output line and S0 is a single select line.
The output of the 2×1 Mux will depend on the selection line S0,
• When S is 0(low), the I0 is selected
• when S0 is 1(High), I1 is selected
Using the Truth Table ,the Logical Expression for Mux can be determined as
Y = S0.I0 + S0.I1
4×1 Multiplexer
The 4×1 Multiplexer which is also known as the 4-to-1 multiplexer. It is a multiplexer
that has 4 inputs and a single output. The Output is selected as one of the 4 inputs
which is based on the selection inputs. The number of the Selection lines will depend
on the number of the input which is determined by the equation log2n , In 4×1 Mux the
selection lines can be determined as log4=2, so two selections are needed.
De-Multiplexer
DEMUX or De-Multiplexer is a data distributor combinational circuit. It works in a
reverse way of the Multiplexer. The DEMUX has 1 input port and 2^n output lines.
Here n signifies the selection line for a DEMUX. As per the selection line value, the
DEMUX input lines will be connected to receive the output. Demultiplexer receives
digital information from a single source and converts it into several sources.
A half subtractor is a digital logic circuit that performs binary subtraction of two single-bit
binary numbers. It has two inputs, A and B, and two outputs, DIFFERENCE and BORROW. The
DIFFERENCE output is the difference between the two input bits, while the BORROW output
indicates whether borrowing was necessary during the subtraction.
The half subtractor can be implemented using basic gates such as XOR and NOT gates. The
DIFFERENCE output is the XOR of the two inputs A and B, while the BORROW output is the
NOT of input A and the AND of inputs A and B.
Half subtractor is a combination circuit with two inputs and two outputs that
are different and borrow. It produces the difference between the two binary bits at the
input and also produces an output (Borrow) to indicate if a 1 has been borrowed. In the
subtraction (A-B), A is called a Minuend bit and B is called a Subtrahend bit.
Truth Table
Full Subtractor
A full-subtractor is a combinational circuit that has three inputs A, B, bin and two
outputs d and b. Where, A is the minuend, B is subtrahend, bin is borrow produced
by the previous stage, d is the difference output and b is the borrow output.
As we know that the half-subtractor can only be used for subtraction of LSB (least
significant bit) of binary numbers. If there is any borrow during the subtraction
of the LSBs of two binary numbers, then it will affect the subtraction of next
stages. Therefore, the subtraction with borrow are performed by a full subtractor.
Therefore, we can realize the full-subtractor using two XOR gates, two NOT
gates, two AND gates, and one OR gate.
Operation of Full Subtractor
Now, let us understand the operation of the full subtractor. Full subtractor performs
its operation to find the difference of two binary numbers according to the rules of
binary subtraction, which are as follows −
In the case of full subtractor, the 1s and 0s for the output variables (difference and
borrow) are determined from the subtraction of A – B – bin.
From the logic circuit diagram of the full subtractor, it is clear that the difference bit
(d) is obtained by the XOR operation of the two inputs A, B, and bin, and the output
borrow bit (b) is obtained by NOT, AND, and OR operations of variable A, B, and bin.
Encoders
Encoders convert 2N lines of input into a code of N bits and Decoders decode the N
bits into 2N lines.
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
Binary Decoder
A binary decoder is a digital circuit that converts a binary code into a set of outputs. The binary
code represents the position of the desired output and is used to select the specific output that is
active. Binary decoders are the inverse of encoders and are commonly used in digital systems to
convert a serial code into a parallel set of outputs.
1. The basic principle of a binary decoder is to assign a unique output to each possible
binary code. For example, a binary decoder with 4 inputs and 2^4 = 16 outputs can
assign a unique output to each of the 16 possible 4-bit binary codes.
2. The inputs of a binary decoder are usually active low, meaning that only one input is
active (low) at any given time, and the remaining inputs are inactive (high). The
active low input is used to select the specific output that is active.
3. There are different types of binary decoders, including priority decoders, which
assign a priority to each output, and error-detecting decoders, which can detect errors
in the binary code and generate an error signal.
In summary, a binary decoder is a digital circuit that converts a binary code into a set of outputs.
Binary decoders are the inverse of encoders and are widely used in digital systems to convert
serial codes into parallel outputs.