Assignment 1 Digital Logical Circuits
Assignment 1 Digital Logical Circuits
Assignment 1 Digital Logical Circuits
Bipolar Unipolar
1. Speed of operation
2. Power dissipation
3. Voltage, Current parameters
4. Cost
5. Noise immunity
6. Availability
7408
2 Input OR Gate
7400
Logic 0 Logic 1
False True
Open Switch Close Switch
Low Voltage High Voltage
No Yes
Off On
2. Gates with Boolean Algebra(equation) and Truth Table.
a. OR Gate
A B X=A+B
0 0 0
0 1 1
1 0 1
1 1 1
= A+B ; X= Output
A,B = Inputs
b. AND Gate
A B X=A.B
0 0 0
0 1 0
1 0 0
1 1 1
A X=Â=A’
0 1
1 0
X= Output , A= Input
d. NOR Gate
A B X=(A+B)
0 0 1
0 1 0
1 0 0
1 1 0
e. NAND Gate
A B X= A+B= (AB)’
0 0 1
0 1 1
1 0 1
1 1 0
0 0 0
0 1 1
1 0 1
1 1 0
A B X=A+B
0 0 1
0 1 0
1 0 0
1 1 1
Assignment 2
Multiplexers
A multiplexers is a combinational circuit that receives binary information from one of 2 nd
input data lines and directs it to a single output line . the selection of a particular input data
line for the output is determined by a set of selection inputs . A 2 nd to 1st multiplexers has
2nd input data lines and n input selection lines whose bit combinations determine which
input data are selected for the output .
A 4 to 1 line multiplexer is shown in fig2 . each of the four inputs I0 through I3 is applied to
one input of an AND gate. The two selection inputs S1 and S0 are decoded to select a
particular AND gate . The outputs of the AND gates are applied to a single OR gate to
provide the single output. To demonstrate
The circuit operation , consider the case when S1 S0 = 10 the AND gate associated with
input I2 has two of its input equal to 1. The Third input of the gate is connected to I2. The
other three AND gates have at least one input equal to 0, which makes their output equal to
0.
The or gate output is now equal to the value of I2, thus providing a path from the selected
input to the output.
The 4 to 1 line multiplexers in figure has six inputs and one output . A truth table describing
the circuits needs 64 rows since six input variables can have 24 binary combinations.
S3
S2 Z
S1
S0
Truth table of 4 to 1 Multiplexer
X Y Z
0 0 S0
0 1 S1
1 0 S2
1 1 S3
A B C Y
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
Assignment 3
Decoders and Encoders
Decoders
The decoders presented in this section are called n-ts-m-line decoders , where
m=<2n . Their purpose is to generate the 2n( or fewer) binary combinations of
the n input variables. A decoder has n inputs and m outputs and is also referred
to as an n*m decoder.
The logical diagram of 3 to 8 line decoder. The three data inputs A0,A1 and
A2 are decoded into eight outputs , each output representing one of the
combinations of the three binary outputs each output representing one of the
combination of the three binary input variables. The three inverters provide the
component of the binary combinations . A particular application of this
decoder is a binary to octal conversion. The input variable represents a binary
number and the outputs represent the eight digits of the octal number system.
1. Decoder
N=2 => 2n = 2^2 = 4 numbers
Truth table
A0 A1 D0 D1 D2 D3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
Diagram:-
A0
A1
DO
D1
D2
D3
Encoders
A0= D1+D2+D3+D4
A1= D2+D3+D6+D7
A2= D4+D5+D6+D7
D2
D3
Output0
Output1
Truth Table:-
D0 D1 D2 D3 A0 A1
1 0 0 0 0 0
0 0 0 0 0 1
0 0 1 0 1 0
0 0 0 1 1 1
A0= D2+D3
A1= D1+D3
Assignment 4
Comparators
A comparator is a combinational circuit that compares the magnitude of two
numbers (A and B) and generates one of the following outputs. A=B, A<B, &
A>B
Application of Comparator:-
Truth Table:-
A B f(A==B)
0 0 1
0 1 0
1 0 0
1 1 1
Truth Table:-
A B f(A>B) f(A<B)
0 0 0 0
0 1 0 1
1 0 1 0
1 1 0 0
F(A==B) = A+B
Also
f(A<B) = f(A= = B)* f(A>B)
An>Bn
A==Bn An-1>Bn-1 A>B
Assignment 5
Adder Subtractor:-
The Addition and Subtraction operations can be comb ined into one common circuit by including an exclusive –
OR gate with each full-adder. A 4 bit The mode input Cin control is the operation. When Cin=0 the circuit is an
adder and when Cin =1 the circuit becomes a subtractor. Each exclusive –OR gate receives input Cin and one of
the inputs of B when Cin=0. We have B X-OR 0 =B. The full adder receive the value of B when Cin=0. The input
carry is 0, and the circuit performs A plus B when Cin=1 we have B X-OR 1=B’ and C0=1. The B inputs are all
complemented and a1 is added through the input carry. The circuit performs the operation A plus the 2’s
complement of B. For unsigned numbers, this given A-B if A>=B or the 2’s complement of (B-A) if A<B for
Signed Numbers, the Result is A-B provided that there is no overflow.
A ( A4 A3 A2 A1 )
B ( B4 B3 B2 B1 )
TRUTH TABLE:-
A B X
0 0 0
0 1 1
1 0 1
1 1 0
From Figure:-
If , B4=1 O/P=1
B3=0 O/P=0
B2=1 O/P=1
B1=1 O/P=1
When:- Cin =0
Then B
B4=1 O/P=0
B3=1 O/P=0
B2=0 O/P=1
B1=1 O/P=1
Circuit Diagram:-
B4
B3
B2
B1
A4
A3
A2
A1
Cin
Cout
sum4
sum3
sum2
sum1
Assignment 6
LOGIC UNIT
Binary Logic deals with binary variables and with operations that assume logical meaning. It is used to
describe, in algebraic or tabular form, the manipulation and processing of binary information. The
manipulation is done by logic circuits called gates. Gates are block of hardware that produce Signals of binary 1
or 0 when input logic requirements are satisfied. The input output relationship of the binary variables for each
gate can be represented in tabular form by a truth table. The basic logic gates are AND and Inclusive –OR
with Multiple inputs and NOT with a Single Input.
All the logic gates can be generated using a logic unit comprising of the basic logic Gates
AND, OR and NOT. There is an inverter for Input x and y to generate its complement x’ and y’ respectively. An
AND Gate is used to get the term xy , x’y, xy’ and x’y’ and OR Gate is used to combine the two terms to get the
output z.
1. AND
Z=X.Y
2. OR
3. NAND
4. NOR
Z=(X+Y)’
5. XOR
7. NOT
Z=X’ or Z=Y’
8. Buffer
Z=X or Z=Y
X
S3
S2 Z
S1
S0
F(x,y)=m3s3+m2s2+m1s1+m0s0 ; where m3=XY, m2= XY’, m1=X’Y, m0=X’Y’
TRUTH TABLE:-
S3 S2 S1 S0 LOGIC
1 0 0 0 AND
1 1 1 0 OR
0 1 1 1 NAND
0 0 0 1 NOR
0 1 1 0 XOR
1 0 0 1 XNOR
Assignment 7
BCD Adder
BCD Adder is a circuit that adds two BCD digits in parallel and produces a sum digit also in
BCD.A BCD adder must include correction logic in its internal construction consider the
arithmetic addition of two decimal digits in BCD, together with a possible carry from a
previous stage since each input digit does not exceed 9, the output sum can not be greater
than 9+9+1=19. The 1 in the sum being an input carry. Suppose that we apply two BCD digits
to a 4 bit binary adder.The adder will form the sum in binary and produce a result that may
range from the sum in binary and produce a result that may range from 0 to 19. These
binary numbers are listed in the table given below.
The second column in the table lists the binary sums as they appear in the outputs of a 4 bit binary
adder. The output sum of two decimal numbers must be represented in BCD and should appear in
the form listed in the third column of the table. The problem is to find a simple rule by which binary
number in second column can be converted to the correct BCD digit representation. When the
binary number is equal to or less than 1001, the corresponding BCD numbers are identical and
therefore no conversion is needed. When the binary numbers are greater than 1001, the addition of
binary 6 (0110) to the binary number converts it to the correct BCD representation and also produce
and output carry.
A2 A1
A4
A3
B4
B3
B2
B1
GND
Cout
S4
S3
S2
S1
Assignment 8
Arithmetic Unit
The basic component of an arithmetic circuit is the parallel adder. By controlling the data inputs to
the adder, it is possible to obtain different types of arithmetic operations. The diagram of a 4 bit
arithmetic circuit is shown in the figure given below.
It has four parallel adder circuits that constitute the 4 bit adder and four multiplexers for choosing
operations. These are two 4 bit inputs A (X 3X2X1X0) and B (Y3Y2Y1Y0) and a 4-bit output K (K 3K2K1K0).
The four inputs from A (X3X2X1X0) go directly to the X inputs of the binary adder. Each of the four
inputs from B (Y3Y2Y1Y0) are connected to the data inputs are also receive the component of B
(Y3Y2Y1Y0). The other two data inputs are connected to logic-0 and logic-1. Logic-0 is a fixed voltage
value and the logic-1 signal can be generated through an inverter whose input is 0. The four
Multiplexers are connected and controlled by two selection inputs S 1 and S0. The input carry Cin goes
to the carry input of FA in the last significant position.
The output of the binary adder is calculated from the following arithmetic sum:
K= A+Y+ Cin
Where A is the 4-bit binary number at the X input and Y is the 4-bit binary number at the Y input of
the binary adder. Cin is the input carry, which can be equal to 0 or 1. Note that the symbol + in the
equation above denotes an arithmetic plus. By controlling the value of Y with the two selection
inputs S1 and S0 and making Cin equal to 0 or 1, it is possible to generate the eight arithmetic
operations listed in the following table:
S1 S2 Cin Y K=A+Y+Cin Operation
0 0 0 B K=A+B Addition
0 0 1 B K=A+B+1 Addition with carry
0 1 0 B’ K=A+B’ Subtraction with carry
0 1 1 B’ K=A+B’+1 Subtraction
1 0 0 1 K=A-1 Decrement
1 0 1 1 K=A Transfer
1 1 0 0 K=A Transfer
1 1 1 0 K=A+1 Increment
Assignment 9
Function Table:
Input
CE’ WR’ Function Output
L L Write Input data complement
L H Read Addressed word complement
H L Input Not Defined
H H Hold Open
Assignment 10
D0
D1
D2
D3 Q0
Q1
Q2
Q3
RAM 1
A0
A1
A2
A3
D0 RAM 2
D1
D2
D3
Q0
Q1
A0 Q2
A1 Q3
A2
A3