Professional Documents
Culture Documents
NAME :
REG.NO :
YEAR/SEMESTER : IV / VII
1
NEHRU INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE & Affiliated to Anna University)
Nehru Gardens, T.M.Palayam, Coimbatore - 641 105.
2
SI. DATE EXPERIMENTS PAGE. SIGNATURE
NO NO.
1 8 BIT DATA ADDITION 04
12 IMPLEMENTATION OF HALF 54
SUBTRACTOR AND FULL
SUBTRACTOR
13 IMPLEMENTATION OF HALF 58
ADDER AND FULL ADDER
14 DESIGN & IMPLEMENTATION OF 62
MULTIPLEXER AND
DE-MULTIPLEXER
15 DESIGN & IMPLEMENTATION OF 67
ENCODER AND DECODER
3
Ex.no: 1
8 BIT DATA ADDITION
AIM:
To add two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
4
FLOW CHART:
START
[C] 00H
[HL] 3500H
[A] [M]
[HL] [HL]+1
[A]YES [A]+[M]
NO
Is there a
Carry ?
YES
[C] [C]+1
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [C]
STOP
5
PROGRAM:
3104 35
3105 7E MOV A, M Transfer first data to
accumulator
6
OBSERVATION:
INPUT OUTPUT
3500 3502
3501 3503
RESULT:
Thus the 8 bit numbers stored at 3500 & 3501 are added and the result is stored at 3502 &
3503.
7
Ex.no: 2
8 BIT DATA SUBTRACTION
AIM:
To subtract two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
8
FLOW CHART:
START
[C] 00H
[HL] 3500H
[A] [M]
[HL] [HL]+1
[A] [A]-[M]
Is there a
Borrow ? NO
YES
Complement [A]
Add 01H to [A]
[C] [C]+1
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [C]
STOP
9
PROGRAM:
10
OBSERVATION:
INPUT OUTPUT
3500 3502
3501 3503
RESULT:
Thus the 8 bit numbers stored at 3500 &3501 are subtracted and the result is stored at 3502 &
3503.
11
Ex.no: 3
16 BIT DATA ADDITION
AIM:
ALGORITHM:
12
FLOW CHART:
START
[L] [3050 H]
[H] [3051 H]
[DE] [HL]
[L] [3052H]
[H] [3053H]
[A] 00H
[HL] [HL]+[DE]
NO
NO
Is there a
Carry?
YES
[A] [A]+1
[3054] [ L]
[3055] [H]
[3056] [A]
STOP
13
PROGRAM:
14
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3050H 3054H
3051H 3055H
3052H 3056H
3053H
RESULT:
Thus an ALP program for 16-bit addition was written and executed in 8085
microprocessor using special instructions.
15
Ex.no: 4
16 BIT DATA SUBTRACTION
AIM:
To subtract two 16-bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
16
FLOW CHART:
START
[L] [3050 H]
[H] [3051 H]
[DE] [HL]
[L] [3052H]
[H] [3053H]
[HL] [HL]-[DE]
NO
Is there a
borrow?
YES
YES
[C] [C]+1
[3054] [ L]
[3055] [H]
[3056] [C]
STOP
17
PROGRAM:
18
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3050H 3054H
3051H 3055H
3052H 3056H
3053H
RESULT:
Thus an ALP program for subtracting two 16-bit numbers was written and executed.
19
Ex.no: 5
SUM OF NUMBERS IN A SERIES WITHOUT CARRY TO IDENTIFY
THE FLAP DATA
AIM:
ALGORITHM:
20
FLOW CHART:
START
[A] 4200H
[C] [A]
[A] [A]-[A]
[HL] 4201H
[A] [A]+[M]
[HL] [HL]+1
[C] [C]-1
NO
Is [C] = 0?
YES
[4301H] [A]
STOP
21
PROGRAM:
22
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3200H 3300H
3201H
3202H
3203H
3204H
RESULT:
Thus an ALP program for sum of numbers in a series without carry is executed in 8085
microprocessor using special instructions.
23
Ex.no: 6
SUM OF NUMBERS IN A SERIES WITH CARRY TO
IDENTIFY THE FLAP DATA
AIM:
ALGORITHM:
24
FLOW CHART
START
[A] 4200H
[C] [A]
[HL] 4201H
[A] [A]-[A]
[B] [A]
[A] [A]+[M]
NO
Is there a
Carry ?
YES
[B] [B]+1
[HL] [HL]+1
[C] [C]-1
25
A
NO
Is [C] = 0?
YES
[4300H] [B]
[4301H] [A]
STOP
26
PROGRAM:
27
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3200H 3300H
3201H 3301H
3202H
3203H
3204H
RESULT:
Thus an ALP program for sum of numbers in a series without carry is executed in 8085
microprocessor using special instructions.
28
Ex.no: 7
SORTING OF NUMBERS IN ASCENDING ORDER
AIM:
To sort the given numbers in the ascending order using 8085 microprocessor.
ALGORITHM:
29
FLOWCHART:
START
[B] 04H
[HL] [3100H]
[C] 04H
[A] [HL]
[HL [HL] + 1
IS
YES [A] < [HL] ?
YES
[D] [HL]
[HL] [A]
[HL] [HL] - 1
[HL] [D]
[HL] [HL] + 1
[C] [C] 01 H
30
A
NO
IS[C] = 0?
YES
YES
[B] [B]-1
IS NO
[B] = 0?
YES
STOP
31
PROGRAM:
32
OBSERVATION:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
3100 3100
3101 3101
3102 3102
3103 3103
3104 3104
RESULT:
Thus the ascending order program was executed and the given numbers are arranged
in ascending order.
33
Ex.no: 8
SORTING OF NUMBERS IN DESCENDING ORDER
AIM:
To sort the given numbers in the descending order using 8085 microprocessor.
ALGORITHM:
34
FLOWCHART:
START
[B] 04H
[HL] [3100H]
[C] 04H
[A] [HL]
[HL [HL] + 1
IS
[A] < [HL] ?
NO YES
[D] [HL]
YES
[HL] [A]
[HL] [HL] - 1
[HL] [D]
[HL] [HL] + 1
[C] [C] 01 H
35
A
NO
IS
[C] = 0?
YES
[B] [B]-1
no
IS
[B] = 0 ?
yes
STOP
36
PROGRAM:
37
OBSERVATION:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
3100 3100
3101 3101
3102 3102
3103 3103
3104 3104
RESULT:
Thus the descending order program was executed and the given numbers are arranged
in descending order.
38
Ex.no: 9 GREATEST ELEMENT IN A GIVEN SERIES
AIM:
To find the greatest element in a given series.
ALGORITHM:
1. Place all the elements of a series in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content
7. If the accumulator content is smaller, then move the memory content to the
accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
39
FLOW CHART:
START
[HL] [3100H]
[B] 04H
[A] [HL]
NO
[HL [HL] + 1
IS YES
[A] < [HL]?
[A] [HL]
[B] [B]-1 NO
YES
IS
[B] = 0?
[3105] [A]
STOP
40
PROGRAM:
300A 0D
300B 30
300C 7E MOV A,M Transfer data from M
to A reg
41
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3100 3105
3101
3102
3103
3104
RESULT:
Thus the program is executed and largest number in the given series was identified.
42
Ex.no: 10 MULTI BYTE ADDITION IN BCD MODE
AIM :
To perform Multi-Byte addition in BCD mode using 8085
microprocessor.
ALGORITHM:
43
PROGRAM:
ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENTS
3000 21 LXJ,H 3100h Incialize HL
3002 31
3003 4E MOV C,M Copies the Counter
of M to C to be
used as Counter.
3004 3E MVI A,00 Clear the
3005 00 accumulator.
44
3011 0D DCR C Decrease the value
of DE
3012 C2 JNZ C If c is not zero go
to loop L1
3013 0C
3014 30
3015 76 HLT
Observation:
3100 03
3500
3501
3502
3600
3601
3602
RESULT:
Thus the multi-byte addition in BCD mode is executed & result is
obtained.
45
Ex.no: 11
STUDY OF LOGIC GATES
AIM:
To verify the truth table of basic digital ICs of AND, OR, NOT, NAND, NOR, EX-OR
gates.
APPARATUS REQUIRED:
THEORY:
a. AND gate:
b. OR gate:
c. NOT gate:
d. NAND gate:
46
A NAND gate is a complemented AND gate. The output of the NAND gate
will be 0 if all the input signals are 1 and will be 1 if any one of the input signal
is 0.
f. NOR gate:
f. EX-OR gate:
A B = (A. B) + (A. B)
PROCEDURE:
47
AND GATE
CIRCUIT DIAGRAM:
Symbol of IC 7408:
PIN DIAGRAM
TRUTH TABLE:
INPUT OUTPUT
S.No
A B Y = A. B
1. 0 0 0
2. 0 1 0
3. 1 0 0
4. 1 1 1
48
OR GATE
CIRCUIT DIAGRAM:
Symbol of IC 7432:
INPUT OUTPUT
S.No
A B Y=A+B
1. 0 0 0
2. 0 1 1
3. 1 0 1
TRUTH TABLE
PIN DIAGRAM
4. 1 1 1
49
NOT GATE
CIRCUIT DIAGRAM:
SYMBOL OF IC 7404:
TRUTH TABLE
INPUT OUTPUT
S.No
A Y = A
1. 0 1
2. 1 0
NAND GATE
CIRCUIT DIAGRAM:
SYMBOL OF IC 7400: PIN DIARAM:
50
TRUTH TABLE:
INPUT OUTPUT
S.No
A B Y = (A. B)
1. 0 0 1
2. 0 1 1
3. 1 0 1
4. 1 1 0
NOR GATE
CIRCUIT DIAGRAM:
SYMBOL OF IC 7402:
PIN DIAGRAM:
TRUTH TABLE:
INPUT OUTPUT
S.No
A B Y = (A + B)
1. 0 0 1
2. 0 1 0
3. 1 0 0
4. 1 1 0
51
EX-OR GATE
CIRCUIT DIAGRAM
SYMBOL OF IC 7486:
PIN DIAGRAM:
TRUTH TABLE:
INPUT OUTPUT
S.No
A B Y=A B
1. 0 0 0
2. 0 1 1
3. 1 0 1
4. 1 1 0
52
RESULT:
Thus the truth table of all the basic digital ICs are verified.
53
Ex.no: 12
IMPLEMENTATION OF HALF SUBTRACTOR AND FULL
SUBTRACTOR
AIM:
To design and verify the truth table of the Half Subtractor & Full Subtractor
circuits.
APPARATUS REQUIRED:
THEORY:
The arithmetic operation, subtraction of two binary digits has four possible
elementary operations, namely,
0-0=0
0 - 1 = 1 with 1 borrow
1-0=1
1-1=0
In all operations, each subtrahend bit is subtracted from the minuend bit. In
case of the second operation the minuend bit is smaller than the subtrahend bit, hence
1 is borrowed.
HALF SUBTRACTOR:
A combinational circuit which performs the subtraction of two bits is called half
subtractor. The input variables designate the minuend and the subtrahend bit, whereas the
output variables produce the difference and borrow bits.
54
FULL SUBTRACTOR:
A combinational circuit which performs the subtraction of three input bits is called
full subtractor. The three input bits include two significant bits and a previous borrow bit. A
full subtractor circuit can be implemented with two half subtractors and one OR gate.
PROCEDURE:
HALF SUBTRACTOR
CIRCUIT DIAGRAM:
B = A.B
TRUTH TABLE:
INPUT OUTPUT
S.No
A B DIFF BORR
1. 0 0 0 0
2. 0 1 1 1
3. 1 0 1 0
4. 1 1 0 0
55
FULL SUBTRACTOR
CIRCUIT DIAGRAM:
DIFFERENCE
BORROW
TRUTH TABLE:
INPUT OUTPUT
S.No
A B C DIFF BORR
1. 0 0 0 0 0
2. 0 0 1 1 1
3. 0 1 0 1 1
4. 0 1 1 0 1
5. 1 0 0 1 0
6. 1 0 1 0 0
7. 1 1 0 0 0
8. 1 1 1 1 1
56
RESULT:
The design of the half subtractor and full subtractor circuits was done and their truth
tables are verified.
57
Ex.no: 13
IMPLEMENTATION
OF HALF ADDER & FULL ADDER
AIM:
To design and verify the truth table of the Half Adder & Full Adder circuits.
APPARATUS REQUIRED:
THEORY:
The most basic arithmetic operation is the addition of two binary digits. There
are four possible elementary operations, namely,
0+0=0
0+1=1
1+0=1
1 + 1 = 102
The first three operations produce a sum of whose length is one digit, but
when the last operation is performed the sum is two digits. The higher significant bit
of this result is called a carry and lower significant bit is called the sum.
HALF ADDER:
A combinational circuit which performs the addition of two bits is called half
adder. The input variables designate the augends and the addend bit, whereas the
output variables produce the sum and carry bits.
58
FULL ADDER:
A combinational circuit which performs the arithmetic sum of three input bits
is called full adder. The three input bits include two significant bits and a previous
carry bit. A full adder circuit can be implemented with two half adders and one OR
gate.
PROCEDURE:
59
HALF ADDER
CIRCUIT DIAGRAM:
TRUTH TABLE:
INPUT OUTPUT
S.No
A B S C
1. 0 0 0 0
2. 0 1 1 0
3. 1 0 1 0
4. 1 1 0 1
60
FULL ADDER
CIRCUIT DIAGRAM:
TRUTH TABLE:
INPUT OUTPUT
S.No
A B C SUM CARRY
1. 0 0 0 0 0
2. 0 0 1 1 0
3. 0 1 0 1 0
4. 0 1 1 0 1
5. 1 0 0 1 0
6. 1 0 1 0 1
7. 1 1 0 0 1
8. 1 1 1 1 1
RESULT:
The design of the half adder and full adder circuits was done and their truth
tables are verified.
61
Ex.no: 14
DESIGN & IMPLEMENTATION OF MULTIPLEXER AND
DE-MULTIPLEXER
AIM:
APPARATUS REQUIRED:
THEORY:
PROCEDURE:
62
4 X 1 MULTIPLEXER
LOGIC SYMBOL:
63
CIRCUIT DIAGRAM:
TRUTH TABLE:
1. 0 0 D0
2. 0 1 D1
3. 1 0 D2
4. 1 1 D3
64
1X4 DEMULTIPLEXER
LOGIC SYMBOL:
CIRCUIT DIAGRAM:
65
TRUTH TABLE:
INPUT OUTPUT
S.No
S1 S2 Din Y0 Y1 Y2 Y3
1. 0 0 0 0 0 0 0
2. 0 0 1 1 0 0 0
3. 0 1 0 0 0 0 0
4. 0 1 1 0 1 0 0
5. 1 0 0 0 0 0 0
6. 1 0 1 0 0 1 0
7. 1 1 0 0 0 0 0
8. 1 1 1 0 0 0 1
RESULT:
The design of the 4x1 Multiplexer and 1x4 Demultiplexer circuits was done and their
truth tables were verified.
66
Ex.no: 15
DESIGN & IMPLEMENTATION OF ENCODER AND DECODER
AIM:
To design and implement encoder and decoder circuits using logic gates.
APPARATUS REQUIRED:
THEORY:
ENCODER:
An encoder is a digital circuit that perform inverse operation of a decoder. An encoder
has 2n input lines and n output lines. In encoder the output lines generates the binary code
corresponding to the input value. In octal to binary encoder it has eight inputs, one for each
octal digit and three output that generate the corresponding binary code. In encoder it is
assumed that only one input has a value of one at any given time otherwise the circuit is
meaningless. It has an ambiguila that when all inputs are zero the outputs are zero. The zero
outputs can also be generated when D0 = 1.
DECODER:
A decoder is a multiple input multiple output logic circuit which converts coded input
into coded output where input and output codes are different. The input code generally has
fewer bits than the output code. Each input code word produces a different output code word
i.e there is one to one mapping can be expressed in truth table. In the block diagram of
decoder circuit the encoded information is present as n input producing 2n possible outputs.
2n output values are from 0 through out 2n 1.
67
PROCEDURE:
(i) Connections are given as per circuit diagram.
(ii) Logical inputs are given as per circuit diagram.
(iii) Observe the output and verify the truth table.
68
TRUTH TABLE:
INPUT OUTPUT
Y1 Y2 Y3 Y4 Y5 Y6 Y7 A B C
1 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 0 1 1
0 0 0 1 0 0 0 1 0 0
0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 1 1 1 1
69
TRUTH TABLE:
INPUT OUTPUT
E A B D0 D1 D2 D3
1 0 0 1 1 1 1
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
RESULT:
Thus the encoder and decoder circuits are implemented and their truth tables are
verified.
70