Lab Manual
Lab Manual
(AUTONOMOUS)
THANDALAM, CHENNAI 602 105
Department of Electronics and Communication Engineering
LAB MANUAL
NAME………………………………………………………………………
BRANCH…………………………………………………………………...
REGISTER NUMBER………………………………………………….....
SEMESTER………………………………………………………………..
ACADEMIC YEAR……………………………………………………….
TABLE OF CONTENTS
DIGITAL LOGIC
8051 EXPERIMENTS
INTERFACING EXPERIMENTS
LOGIC GATES
AIM:
To design and construct half adder, full adder, half subtractor and full subtractor
circuits and verify the truth tables using logic gates.
APPARATUS REQUIRED:
THEORY
HALF ADDER:
A half adder is a combinational circuit needs two binary inputs and two binary outputs.
The input variables designate the augend and addend bits, the output variables produce the
sum and carry. The half-adder can be implemented with an exclusive –OR and an AND
gate.
FULL ADDER:
A full adder is a combinational circuit that forms the arithmetic sum of input; it consists of
three inputs and two outputs. A full adder is useful to add three bits at a time. In full adder
sum output will be taken from X-OR Gate, carry output will be taken from OR Gate.
HALF SUBTRACTOR:
The half subtractor is constructed using X-OR and AND Gate. The half subtractor has two
input and two outputs. The outputs are difference and borrow. The difference can be
applied using X-OR Gate, borrow output can be implemented using an AND Gate and an
inverter.
FULL SUBTRACTOR:
It is a combination of 2 half subtractors. The first half subtractor is given inputs A and B
and the difference of this along with C is the input to the second half subtractor. Borrows
of HS are ORed to obtain the borrow of the Full Subtractor
PROCEDURE:
HALF ADDER
TRUTH TABLE:
Inputs Outputs
A B CARRY SUM
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
LOGIC DIAGRAM:
FULL ADDER- FULL ADDER USING TWO HALF ADDER:
TRUTH TABLE:
Inputs Outputs
A B C CARRY SUM
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
LOGIC DIAGRAM:
HALF SUBTRACTOR
TRUTH TABLE:
INPUT OUTPUT
A B Borrow Difference
0 0 0 1
0 1 1 0
1 0 0 0
1 1 0 1
LOGIC DIAGRAM:
FULL SUBTRACTOR
TRUTH TABLE:
Inputs Outputs
A B C BORROW DIFFERENCE
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
AIM:
To design and construct Binary to Gray and Gray to Binary Code convertor using
logic gates.
APPARATUS REQUIRED:
THEORY:
Gray Code, also known as reflected binary code or unit distance code, is a binary
numeral system where two successive values differ by only one bit. Unlike
traditional binary representations, where adjacent numbers can have multiple bits
different, Gray Code ensures that only one bit changes as you move from one value
to the next.
This property makes it particularly useful in various applications where minimizing
errors during transitions is essential.
Gray Code’s primary importance lies in its property of minimizing errors during
binary transitions. In standard binary encoding, multiple bits can change between
consecutive values, potentially leading to errors due to bit propagation delays or
signal glitches.
It minimizes these errors by ensuring that only one bit changes at a time, reducing
the chances of misinterpretation during transitions. This feature is crucial in
applications where accuracy and reliability are paramount.
Application:
● Rotary Encoders
● Digital Communication
● BCD Encoding
● Error Detection and Correction
Logic Diagram
RESULT:
The design of binary to gray and gray to binary code convertor is implemented successfully
using IC7486.
DESIGN AND IMPLEMENTATION OF MULTIPLEXER AND DE-MULTIPLEXER
USING LOGIC GATES
AIM:
REQUIREMENTS:
2 OR GATE IC 7432 1
4 IC TRAINER KIT - 1
5 PATCH CORDS - 32
THEORY:
MULTIPLEXER:
DEMULTIPLEXER:
D1= X S1’ S0
D2= X S1 S0’
D3= X S1 S0
TRUTH TABLE:
S1 S0 Y =OUTPUT
0 0 D0
0 1 D1
1 0 D2
1 1 D3
LOGIC DIAGRAM MULTIPLEXER:
INPUT OUTPUT
S1 S0 I/P D0 D1 D2 D3
0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 0
1 0 0 0 0 0 0
1 0 1 0 0 1 0
1 1 0 0 0 0 0
1 1 1 0 0 0 1
RESULT:
The Multiplexer and Demultiplexer were implemented and verified using logic gates
DESIGN AND IMPLEMENTATION OF 4 BIT SYNCHRONOUS
COUNTER
AIM:
To design and verify 4 Bit Synchronous Counter.
REQUIREMENTS:
THEORY:
LOGIC DIAGRAM: (Up Counter)
TRUTH TABLE:
CLK Q1 Q2 Q3 Q4
0 0 0 0 0
1 1 0 0 0
2 0 1 0 0
3 1 1 0 0
4 0 0 1 0
5 1 0 1 0
6 0 1 1 0
7 1 1 1 0
8 0 0 0 1
9 1 0 0 1
10 0 1 0 1
11 1 1 0 1
12 0 0 1 1
13 1 0 1 1
14 0 1 1 1
15 1 1 1 1
RESULT: Thus, the design of BCD Counter is designed and truth table verified.
IMPLEMENTATION OF SISO, SIPO, PISO AND PIPO SHIFT REGISTERS
USING FLIP-FLOP
AIM:
To design and implement Serial in serial out, Serial in parallel out, Parallel in serial out and
Parallel
in parallel out shift registers using flip-flops
REQUIREMENTS:
2 OR GATE IC 7432 1
3 IC TRAINER KIT - 1
4 PATCH CORDS - 35
THEORY:
PIN DIAGRAM:
LOGIC DIAGRAM:
TRUTH TABLE:
1 1 0
2 0 0
3 0 0
4 1 1
5 X 0
6 X 0
7 X 1
SERIAL IN PARALLEL OUT:
TRUTH TABLE:
OUTPU
T
CLK DATA QA QB QC QD
1 1 1 0 0 0
2 0 0 1 0 0
3 0 0 0 1 1
4 1 1 0 0 1
CLK Q3 Q2 Q1 Q0 O/P
0 1 0 0 1 1
1 0 0 0 0 0
2 0 0 0 0 0
3 0 0 0 0 1
TRUTH TABLE:
CLK DA DB DC DD QA QB QC QD
1 1 0 0 1 1 0 0 1
2 1 0 1 0 1 0 1 0
PROCEDURE:
Result:
The shift registers were implemented and verified using flip-flops.
Kit Procedure:
SD / SP SU
input address input address
Input (enter) (enter)
SD / SP SU
Output output address (enter) output address (enter)
U (enter) U (enter)
View starting address (enter) starting address (enter)
8-BIT ARITHMETIC, LOGICAL AND DECIMAL ARITHMETIC
OPERATIONS USING 8085
AIM:
ALGORITHM:
2. Get the first number from memory and store in accumulator.
3. Get the second number in memory and add it to the accumulator.
8 BIT ADDITION
MVI C,00
LDA
MOV B,A
LDA
ADD B
JNC LOOP
INR C
LOOP STA
MOV A,C
STA
HLT
OBSERVATION:
INPUT OUTPUT
MVI C,00
LDA
MOV B,A
LDA
SUB B
JNC LOOP
INR C
CMA
ADI 01
LOOP STA
MOV A,C
STA
HLT
OBSERVATION:
INPUT OUTPUT
LDA
MOV B,A
LDA
MOV C,A
MVI A,00
MVI D,00
L2 ADD B
JNC L1
INR D
L1 DCR C
JNZ L2
STA
MOV A,D
STA
HLT
OBSERVATION:
INPUT OUTPUT
MVI C,00
LDA
MOV B,A
LDA
L2 CMP B
JC L1
SUB B
INR C
JMP L2
L1 STA
MOV A,C
STA
HLT
OBSERVATION:
INPUT OUTPUT
MVI C,00
LDA
MOV B,A
LDA
ADD B
DAA
JNC LOOP
INR C
LOOP STA
MOV A,C
STA
HLT
OBSERVATION:
INPUT OUTPUT
OR:
EXOR:
NOT:
OBSERVATION:
RESULT:
Thus, an Assembly Language Program to perform arithmetic operations
using 8085 is written and executed successfully.
SEARCHING AN
ARRAY OF NUMBERS
USING 8085
AIM:
EXP NO:
DATE:
ALGORITHM:
MVI B,03
MOV A,M
L2 INX H
CMP M
JNC L1
MOV A,M
L1 DCR B
JNZ L2
STA
HLT
OBSERVATION:
INPUT OUTPUT
LXI H,
MVI B,03
MOV A,M
L2 INX H
CMP M
JC L1
MOV A,M
L1 DCR B
JNZ L2
STA
HLT
OBSERVATION:
INPUT OUTPUT
RESULT:
AIM:
ALGORITHM:
1. Load DPTR with input address.
2. Load first data to accumulator
3. Increment DPTR
4. Load second data to another register.
5. Perform arithmetic and logical operation.
6. Store the result to a memory location
PROGRAMS:
ADDITION SUBTRACTION
MOV B, A MOV B, A
ADD A, B SUBB A, B
JNC L1 JNC L1
INC R0 INC R0
ADDITION
ADDRESS DATA
INPUT 1
INPUT
INPUT 2
SUM
OUTPUT
CARRY
SUBTRACTION
ADDRESS DATA
INPUT 1
INPUT
INPUT 2
DIFFERENCE
OUTPUT
BORROW
MULTIPLICATION
ADDRESS DATA
INPUT 1
INPUT
INPUT 2
PRODUCT(LSB)
OUTPUT
PRODUCT(MSB)
DIVISION
ADDRESS DATA
INPUT 1
INPUT
INPUT 2
QUOTIENT
OUTPUT
REMAINDER
MULTIPLICATION DIVISION
MUL AB DIV AB
AND OR
MOV B, MOV B,
ANL A, B ORL A, B
MOV B, CPL A
OBSERVATION:
OR AND
OUTPUT OUTPUT
XOR NOT
OUTPUT OUTPUT
RESULT:
Thus an ALP to perform arithmetic and logical operations using 8051 was
written and executed successfully.
8255 - PARALLEL INTERFACE
EXP NO: DATE:
AIM:
D7 D6 D5 D4 D3 D2 D1 D0
D7 - NOT TO BE USED
PORT ADDRESS
REGISTER ADDRESS
Control C6
Port A C0
Port B C2
Port C C4
ALGORITHM:
1. Initialize the D7 bit for I/O mode and BSR mode.
2. Transmit an array of data from input port to output port for I/O mode.
3. Set/ Reset a particular bit of an output port for BSR mode.
PROGRAM:
IO MODE
ADDRESS OPCODE MNEMONIC OPERAND COMMENTS
S
4100 MVI A,90
4102 OUT 0C6
4104 IN 0C0
4106 STA 4500
4109 HLT
BSR MODE:
RESULT:
Thus, the Programmable Peripheral Interface (8255) is programmed in I/O mode using 8085.
8253 - TIMER INTERFACE
EXP NO: DATE:
AIM:-
To write and execute an assembly language program to generate a square wave using
8253.
ALGORITHM:
Calculation of Frequency:
RESULT:
Thus a square wave using 8253 is generated and executed successfully.
STEPPER MOTOR CONTROL
EXP NO: DATE:
To write and execute an ALP to rotate a stepper motor in counter clockwise direction.
ALGORITHM:
MOV R0,#04
L1 MOVX A,@DPTR
PUSH DPH
PUSH DPL
MOV DPTR,#FFC0
MOV R2,#04
MOV R1,#0F
L2 MOV R3,#0F
L3 DJNZ R3,L3
DJNZ R1,L2
DJNZ R2,L2
MOVX @DPTR,A
POP DPL
POP DPH
INC DPTR
DJNZ R0,L1
SJMP START
RESULT:
Thus, an ALP to rotate a stepper motor in counter clockwise direction was written and
executed successfully.