Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 11

Gates Emulator Using

AT89C2051
This project Digital gated Emulator using
Microcontroller is used to emulate the basic
gates such us NOT, OR, AND.
The system has the selector switch by which
we can select any gate. The system has two
inputs and one output.
We use two SPDT switches for the inputs and
for the output we use an LED.
The gate selection can be done by the selector
switch and it is also indicated on separate
LED's.
There are three LED's provided on the board for
the gates NOT, OR, AND.
The corresponding LED will glow for the
corresponding gate.
The main operation is done by the
Microcontroller through its ports.
The Microcontroller gets the input through the
ports and it will produce the output according to
the gate selected.
CIRCUIT DIAGRAM
AT89C2051 ‘S
PIN DIAGRAM
Programming
of
at89c2051
SW_AND EQU P1.3 ; SWITCH FOR AND GATE
SW_OR EQU P1.2 ; SWITCH FOR OR GATE
SW_NOT EQU P1.1 ; SWITCH FOR NOT GATE
LED1 EQU P1.5 ; LED FOR AND GATE
LED2 EQU P1.6 ; LED FOR OR GATE
LED3 EQU P1.7 ; LED FOR NOT GATE
SW1 EQU P3.5 ; FIRST INPUT SWITCH
SW2 EQU P3.7 ; SECOND INPUT SWITCH
SW3 EQU P1.0 ; THIRD INPUT SWITCH
OP EQU P1.4 ; LED FOR OUTPUT
ORG 0000H
TOP: SETB LED1
SETB LED2
SETB LED3
SETB OP
SETB SW_AND ;here 1 because we need I/P
JNB SW_AND,AND1 ; if pressed then go to AND1
SETB SW_OR
JNB SW_OR,OR1 ; checking weather its pressed
SETB SW_NOT ;
JNB SW_NOT,NOT1
SJMP TOP
AND1:
UP1: SETB SW_AND
JB SW_AND,TOP ; if unpressed then go to TOP
CLR LED1
SETB SW1
SETB SW2
SETB SW3
JNB SW1,DWN1
JNB SW2,DWN1
JNB SW3,DWN1
CLR OP
SJMP UP1
DWN1:
SETB OP
SJMP UP1
OR1:
UP2: SETB SW_OR
JB SW_OR,TOP ; if unpressed then go to TOP
CLR LED2
SETB SW1
SETB SW2
SETB SW3
JB SW1,DWN2
JB SW2,DWN2
JB SW3,DWN2
SETB OP
SJMP UP2
DWN2:
CLR OP
SJMP UP2
NOT1:
UP3:SETB SW_NOT
JB SW_NOT,TOP ; if unpressed then go to TOP
CLR LED3
SETB SW1
JB SW1,DWN3
CLR OP
SJMP UP3
DWN3:
SETB OP
SJMP UP3
END

You might also like