Posts

Write an ALP to check whether the given 16-bit number stored at 5000H location is palindrome or not. If number is palindrome then store number at 5100H location otherwise store at 5200H location.

Image
Code:-   org 100h   MOV SI , 5000H MOV DI , 5004H MOV CL , 05H   next_char:     MOV AL , [DI]     MOV BL , [SI]     CMP AL , BL     JNE not_palindrome ; jump not equal to not_palindrome     INC SI     DEC DI LOOP next_char   is_palindrome:     MOV CX,05H     MOV SI , 5000H     MOV DI , 5100H     L1:     MOV AX,[SI]     INC SI      MOV [DI],AX     INC DI LOOP L1       INT 21H                    not_palindrome:         MOV CX,05H       MOV SI , 5000H     MOV DI , 5200H     L2:     MOV AX,[SI] ...

Develop an interfacing circuit and a sketch for intruder alert system that uses PIR sensor and GSM modem. Upon intruder detection send SMS – “Alert : Intruder detected”. Repeat the same at 10 second interval till a reset button is pressed.

Image
Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code:- void setup() {   pinMode(2, INPUT); //Pin 2 as INPUT   pinMode(3, OUTPUT); //PIN 3 as OUTPUT }   void loop() {   if (digitalRead(2) == HIGH)   {   digitalWrite(3, HIGH);   // turn the LED/Buzz ON   delay(100);                       // wait for 100 msecond   digitalWrite(3, LOW);   // turn the LED/Buzz OFF   delay(100);                       // wait for 100 msecond   } } Output:-

Develop an interfacing circuit and a sketch to increment count on 7-Segment based on switch press. Count goes from 00 to 99.

Image
Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code:- void setup() {   for (int i = 0; i <= 13; i++)     pinMode(i, OUTPUT); //Set all pins from 0 to 13 as OUTPUT } //The line below is the array containing all the binary numbers for the digits on a SSD from 0 to 9 const int number[11] = {0b1000000, 0b1111001, 0b0100100, 0b0110000, 0b0011001, 0b0010010, 0b0000010, 0b1111000, 0b0000000, 0b0010000};   void loop() {   for (int tens = 0; tens < 10; tens++)     {     display_tens(tens);   } }   void display_tens(const int tens) {   int pin1, a, ones;        //pin1 is just used to deal with pins of the 1st SSD which desplays the tens digit     for (pin1 = 0, a = 0; pin1 < 7; pin1++, a++)   {     digital...

3 Develop an interfacing circuit and a sketch to display decimal data on 7-Segments. The 3- digit number is sent over serial communication.

Image
  Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code:- unsigned const int A = 13; unsigned const int B = 12; unsigned const int C = 11; unsigned const int D = 10; unsigned const int E = 9; unsigned const int F = 8; unsigned const int G = 7; unsigned const int H = 6;     void setup(void) {   pinMode(A, OUTPUT);   pinMode(B, OUTPUT);   pinMode(C, OUTPUT);   pinMode(D, OUTPUT);   pinMode(E, OUTPUT);   pinMode(F, OUTPUT);   pinMode(G, OUTPUT);   pinMode(H, OUTPUT); }   //My Functions   void zero(void) {   digitalWrite(A, LOW);   digitalWrite(B, HIGH);   digitalWrite(C, HIGH);   digitalWrite(D, HIGH);   digitalWrite(E, HIGH);   digitalWrite(F, HIGH);   digitalWrite(G, HIGH);   digitalWrite(H, LOW); }   void one(void) {   digitalWrite(A, LOW);   digitalWrite(B, ...

Identify bugs and resolve it to fulfill following objective. Interface 3 LEDs and 4 SWICHES with Arduino. Develop a program that by pressing 1st switch it will ON LED1, by pressing 2nd switch it ON LED2 and same for 3rd switch and LED3. By pressing 4th switch it will reset (OFF) all LEDs.

Image
  const int LED1 = 7; const int LED2 = 6; const int LED3 = 5; const int LED4 = 8; const int BUTTON1 = 2; const int BUTTON2 = 3; const int BUTTON3 = 0; const int BUTTON4 = 1; int Buttonmodel = 0; int Buttonmode2 = 0; int Buttonmode3 = 0; int Buttonmode4 = 0; void setup [] { // put your setup code here, to run once: pinMode(LeD1,INPUT); pinMode(LEd2,input); pinMode(LED1,INPUT); pinMode(LED2,input) pinMode(BUT0N1,INPUT_); pinMode(BuT0N2,INPUT_); pinMode(BUTON3,INPUT_); pinMode(BUTON4,INPUT_); } void loop[] ( // put your main code here, to run repeatedly: //First LED interface Buttonmode1 == digitalread(BUTT0Nl); if(Buttonmode1 = high) { digitalwrite(LED1,HIGH); else digitalWrite(LED1,HIGH); } //Second LED interface Butonmode2 = digita1Read(BUTTON2); if(Buttonmode2 = LoW) { digitalWrite(LED2,L0W); } else digitalwrite(LEd2,HIGH); } //Third LED interface Buttonmode3 = digitalread(BUTTON3); if(Buttonmode3 = HIGH); { digitalWrite(LED3,LOW); } else { digitalwrite(LED3,HIGH) } //Fourth LED i...

8086 program Write an ALP to perform sorting of array in descending order.

Image
Code :- org 100h MOV SI, 2000H  MOV DI, 2000H MOV DL , 04H L3:MOV AL,[SI] MOV CL,DL L2 :INC SI MOV BL,[SI] CMP AL,BL JNC L1    JZ L1 XCHG AL,BL MOV [SI] , BL L1:LOOP L2 MOV [DI] ,AL INC DI MOV SI,DI DEC DL JNZ L3 ret Output :-

8086 program Write an ALP to perform sorting of array in ascending order.

Image
Code :- org 100h MOV SI,2000H MOV DI,2000H MOV DL,04H L3: MOV AL,[SI] MOV CL,DL L2: INC SI MOV BL,[SI] CMP AL,BL JC L1 JZ L1 XCHG AL,BL MOV [SI],BL L1: LOOP L2 MOV [DI],AL INC DI MOV SI,DI DEC DL JNZ L3 ret Output :-