Sunteți pe pagina 1din 3

S.Y. B. Tech.

Electronics Engineering
Semester 2nd
A.Y. 2019-2020
Course: 4EN224 Microcontrollers and Peripherals Interfacing
Faculty: Mr. Sagar Khedkar
Assignment No. 1
Date of assignment: 04/02/2020
Date of submission: 10/02/2020

Q. No. Questions
1 Convert following numbers
1) 163.87510 to binary
2) 37810 to octal
3) 4905610 to hex
4) 756.6038 to hex and binary
5) B9F.AE10 to octal and binary
6) 11011102 to decimal, octal and hex
Note: Show all steps of conversion
2 Subtract 25.5 from 10.6 by using
1) 1’s and 2’s complement method
2) 9’s and 10’s complement method
3) 15’s and 16’s complement method
4) 8421 BCD subtraction
5) XS-3 subtraction
Note: Show all calculations
3 Determine the decimal value in each case, if they are in
i) sign magnitude form ii) 1’s complement form iii) 2’s complement form
1) 01101
2) 010111
3) 10111
4) 1101010
4 Draw and explain in detail
1) Pin configuration of 8051.
2) Port Structure of 8051.
3) Register structure of 8051.
4) Internal structure of 8051.
5 Draw and explain PSW register.
How flag bits get affected when you execute assembly program for following
operations.
1) Addition : 255 + 139
2) Subtraction : 139 – 255
3) Multiplication : 51 * 17
4) Division 254 / 8
Note: In the explanation write assembly program as well as show all calculation. At last
Show the contents of PSW.
6 Write an 8051 Assembly program which should perform exactly equal operation
for respective 8051 C program
1) Flashing LED (Implementing for loop using assembly language
programming)
#include <REG51.H>
sbit LED=P0^0;
void main( )
{
unsigned char i;
while(1)
{
LED = ~LED;
for(i=0;i<255;i++);
}
}
2) Switching LED ON and OFF (Implementing if else block using assembly
language programming)
#include <REG51.H>
sbit LED=P2^0;
sbit SW=P1^0;
void main()
{
SW = 0;
LED = 0;
while(1)
{
if(SW == 1)
{
LED = 1;
}
else
{
LED = 0;
}
}
}
3) Use of for loop inside for loop
#include <REG51.H>
sbit LED=P0^0;
void delay()
{
unsigned char i,j;
for(i=0;i<30;i++)
for(j=0;j<150;j++);
}
void main()
{
unsigned char i;
while(1)
{
LED = ~LED;
delay();
}
}
Note: Don’t copy program from disassembly window. Instead write simple assembly
program and compare results with C program output.
7 List and explain in detail all branch instructions of 8051. Give example for each.
8 Write an 8051 assembly program to implement XOR gate. Use two switches and one
led to demonstrate it using proteus.
9 Write an 8051 assembly program to implement 2:1 MUX. Demonstrate it using
proteus.
10 Download datasheets for following components and draw pin out and internal structure
of the same.
1) µC 89C51RD2
2) Optocoupler MCT2E
3) 16 X 2 LCD module
4) BCD to 7 segment decoder IC

S-ar putea să vă placă și