Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to make and gate using 89s51

Status
Not open for further replies.

salinagi

Newbie level 3
Joined
Sep 6, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,321
i am newbie to micro world pls how to make and gate using 89s51
if all input are high output is high
so fren how to start
here is my code
switch1 equ p2.0 ;input switch 1
switch2 equ p2.1 ;input switch 2
switch3 equ p2.2 ;input switch 3
switch4 equ p2.3 ;input switch 4
switch5 equ p2.4 ;input switch 5
switch6 equ p2.5 ;input switch 6
switch7 equ p2.6 ;input switch 7
switch8 equ p2.7 ;input switch 8
switchport equ p2 ;port at which input switches are connected
led1 equ p1.0 ;output led is connected
org ooH
mov led1,00H ;make out put led low
mov sp,#50H ;Stack pointer initialization
clr TOG ;Clear temp bit

after this code what i have to do pls help me i want to learn
 

you want to make the AND gate and its so easy...

you jst check the port value and check it with 0xFF;
if yes then LED should glow else off...
 

may be this might help you salina !
complete code is:
switch1 equ p2.0 ;input switch 1
switch2 equ p2.1 ;input switch 2
switch3 equ p2.2 ;input switch 3
switch4 equ p2.3 ;input switch 4
switch5 equ p2.4 ;input switch 5
switch6 equ p2.5 ;input switch 6
switch7 equ p2.6 ;input switch 7
switch8 equ p2.7 ;input switch 8
switchport equ p2 ;port at which input switches are connected
led1 equ p1.0 ;output led is connected

org ooH
loop1:
clear led1
main:
mov a,#ffh
xrl a,p2
cjne a,#00h,loop1
set led1
ajmp main
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top