This action might not be possible to undo. Are you sure you want to continue?
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.
AT89C2051 ~S PIN DIAGRAM
PROGRAMMING OF AT89C2051
SW_AND EQU SW_OR EQU SW_NOT EQU LED1 EQU LED2 EQU LED3 EQU SW1 EQU SW2 EQU SW3 EQU OP EQU ORG 0000H TOP: SETB SETB SETB SETB
P1.3 P1.2 P1.1 P1.5 P1.6 P1.7 P3.5 P3.7 P1.0 P1.4 LED1 LED2 LED3 OP
; SWITCH FOR AND GATE ; SWITCH FOR OR GATE ; SWITCH FOR NOT GATE ; LED FOR AND GATE ; LED FOR OR GATE ; LED FOR NOT GATE ; FIRST INPUT SWITCH ; SECOND INPUT SWITCH ; THIRD INPUT SWITCH ; LED FOR OUTPUT
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 CLR LED3 SETB SW1 JB SW1,DWN3 CLR OP SJMP UP3
; if unpressed then go to TOP
DWN3: SETB OP SJMP UP3 END