Professional Documents
Culture Documents
22bce0161 VL2023240505539 Ast03
22bce0161 VL2023240505539 Ast03
Dr Vishal Gupta
Assistant Professor
School of Electronics Engineering
Vellore Institute of Technology, Vellore, Tamil Nadu, India
1
Lab Notebook
Course Name: Microcontroller and Microprocessor
Course Code: BECE204P
Slot: - L45+L46
2
Lab Record
➢ Aim
➢ Tool Required
➢ Relevant Theory or Diagram if require
➢ Assembly language program (ALP) Code
➢ Output{Screen Shot}(Result)
➢ Conclusion
3
Lab Assessment - 3
Tool Required:
KEIL development tool
8051 Microcontroller development board or simulator
Relevant Theory:
A half adder is a digital circuit that performs addition of two binary numbers. It
4
has two inputs (A and B) and two outputs: Sum (S) and Carry (C). The truth table
for a half adder is as follows:
A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Code: -
ORG 0000H
SETB ACC.0
SETB ACC.1
MOV C,ACC.1
CPL C
ANL C,ACC.0
5
MOV ACC.2, C
MOV ACC.0, C
CPL C
ANL C, ACC.1
ORL C,ACC.2
MOV ACC.3, C
MOV C, ACC.0
ANL C,ACC.1
Output: -
6
7
Conclusion:
The desired output is derived
Tool Required:
• KEIL development tool
8
• 8051 Microcontroller development board or simulator’
Relevant Theory:
(a) XOR Gate using NOR Gate: XOR gate gives a high output (1) when the
number of high inputs is odd.
Code: -
ORG 0000H
SETB ACC.0 ; INPUT X
SETB ACC.1; INPUT Y
MOV C, ACC.0
ORL C,ACC.0
CPL C
MOV ACC.2,C
MOV C,ACC.1
ORL C,ACC.1
9
CPL C
ORL C, ACC.2
CPL C
MOV ACC.3,C
MOV C,ACC.0
ORL C,ACC.1
CPL C
ORL C,ACC.3
CPL C
MOV ACC.3,C ; OUTPUT Q
Output: -
1
(b) XNOR Gate using NAND Gate: XNOR gate gives a high output (1) when
the number of high inputs is even.
1
Code: -
ORG 0000H
SETB ACC.0 ; INPUT X
SETB ACC.1; INPUT Y
MOV C,ACC.0
ANL C,ACC.1
CPL C
MOV ACC.2,C
MOV ACC.3,C
MOV C,ACC.0
ANL C,ACC.2
CPL C
MOV ACC.4,C
MOV C, ACC.1
ANL C,ACC.3
CPL C
1
ANL C, ACC.4
CPL C
MOV ACC.5,C
ANL C,ACC.5
CPL C
MOV ACC.6,C ; OUTPUT Q
Output: -
1
Conclusion:
The desired output is derived
1