Documente Academic
Documente Profesional
Documente Cultură
Maintain separate tutorial note book of at least 200 pages. Tutorials has to be submitted on every Thursday ,if any holiday on the day very next day students should submit their tutorials.
4. If tutorials are not submitted on the above mentioned day the tutorial marks will be made to Zero automatically. 5. Any absentees will also get zero for that tutorials. 6. 3 Surprise quiz will be conducted in tutorial class each before T1, T2 and T3. Tutorial-1 Number System and Computer Data Format
1) Convert the following decimal numbers in to octal, binary and hexadecimal? a. 57 b. 29.3 c. 2000.45 2) Convert the Hexadecimal that you have got in previous solution into its BCD 3) Convert the following BCD into hexadecimal, 1s complement and 2s complement? a. 0101 1011 b. 1110 1010 0110 c. 1111 1001 0010 1011 4) Convert the following word into ASCII-coded character strings: d. 0111 0101 1111 e. 0101 1001 1000 d. 547.72 e. 121.628
a. JAYPEE b. Institute 5) Convert the following into 8-bit signed binary numbers: a. -53 b. +37
6) What are the ranges of 8-bit signed binary numbers and signed binary words?
3) For the instruction ADD A, B chooses appropriate values of A and B such that after execution of this instruction will set the following flag bits of PSW independently. a. CY b. P and R5 belongs to Bank-3. 5) What is the initialized value of the stack pointer after 8051 is powered up? Above what value the stack pointer has to be initialized to avoid the Bank memory usage. 6) Write program which complements the value of P1 continuously. 7) Explain the addressing modes required to access the RAM and ROM locations 8) Explains the cause of the errors in the following instructions a. MOV R0,R4 b. CPL P1 c. PUSH A d. MOV @R2,#4 e. MOV 2,3 c. OV d. AC
4) Write down the instruction to add two number R0 and R5 such that R0 belongs to Bank-0
9) In Visitor Counter system, Infrared sensors are used, which has transmitter and receiver across an entrance which is typically linked to a small LCD display unit at the side of the doorway or can also be linked to a PC or send data via wireless links and GPRS. Such a beam counts a 'tick' when the beam is broken, when ever visitor enters the hall. Suppose port P1.2 of 8051 is interface to sensor and each tick value is 0, write an assembly language program to count the number of visitor in the hall and output the count on the Port-0.
2) Write an 8051 assemble to read the input from the Port P1 and check weather the input is 00H, FFH or some thing else and then send appropriate message at RAM location 30H as ALL ZEROS if input is 00H, message ALL ONES if input is FFH or message WRONG INPUT if the input is other then 00 or FFH. 3) Write an 8051 program to read 2 digit number 0-FH using Port-1 and the check the number are in sequence or not for example 1-2, 3-4, 7-8, EFH soon and set the bit memory location 21.H to 1 if the number is in sequence else 0. 4) Write an 8051 program to read the string length of 10 from ROM location 200H and convert the text lower to upper and upper to lower and store the converted string into RAM location 30H. 5) In Home Security system, IR sensors are used, which has transmitter and receiver at the secured locations of the home. When there is an interruption in the IR Rays then it should generate an alarm. Suppose port P2.3 of 8051 is interface to sensor at the locker, write an
assembly language program to enable the alarm, thats connected to port P3.3, when the bit P2.3 is cleared (indicating that there is interruption). 6) Design a Temperature control system in which the port 1 gets the temperature as input and controls the Air Conditioner through Port 2.3. If the temperature value at port 0 exceeds 30 degree Celsius, it should reset the Port 2.3 or else should enable it. 7) Design an Automatic traffic signal at a T-Point, such that each sensor is kept at each road to count the number of vehicles on those roads and in turn these sensors are connected to port 1, port 2, and port 3 respectively. The Port 0.2 is used for signaling the road 1 (having sensor connected to port 1), Port 0.3 is used for signaling the road 2 and port 0.4 is used for signaling the road 3. Write an assembly language program to read the ports 1-3 and then enable the corresponding roads signal at Port 0 only if its vehicle count has maximum vehicles.
Develop a 8051 program for the above system. Program should have comments to illustrate the logic. (b) To avoid spurious action and wrong alarms. Switch closure must be checked 5 times after a gap of 1 second each. Consider that 8051 has 12 oscillator clock machine cycle with clock frequency as 20 MHz. Rewrite the above program to incorporate the above modification.
2. Simulate the traffic light operation on a road cross section using ports of 8051 (clock frequency = 20 MHz., 12 clock machine cycle).Develop 8051 program for traffic operation. Consider that making port bit =1 will glow the light connected to port line. Traffic in any direction is allowed only for 1 minute. Lights available for each direction are RED, GREEN FORWARD and GREEN RIGHT. (a) Incorporate AMBER light as well as lights for pedestrian traffic in the above design and program. AMBER light must blink 3 times before RED light.
6. For an 8051 system of 11.0592Mhz, find how long it takes to execute each of the following instructions Instruction MOV R3,#55 DEC R3 DJNZ R2,TARGET LJMP SJMP NOP MUL AB Machine Cycles 1 1 2 2 2 1 4 Time to Execute
7. Mention dual functionality of Input output port pins of 8051. What are the advantages of dual functionality? 8. What is the need of the Bit addressable memory in 8051? What are the instructions used to manipulate it.
DI = SI = BX = IP = BP = SP =
a. If Physical branch address is 5A230 when (CS) =5230, what will it be if the (CS) are changed to 78FD? b. Given that the EA of datum is 2359 and the (DS) = 490B, what is the physical address of the datum? c. Given the sum and the flag setting for AF,SF,ZF,CF,OF and PF after hexadecimally adding 62A0 to each of the following : i. 1234 ii. 4321 iii. CFA0 iv. 9D60 8. What is the purpose of the segment register in protected mode memory addressing? 9. For an 80286 descriptor that contains a base address of A00000H and a limit of 1000H, what starting and ending locations are addressed by this descriptor? 10. For a Pentium descriptor that contains a base address of 00280000H, a limit of 00010H, and G = 1, what starting and ending locations are addressed by this descriptor? 11. If the DS register contains 0020H, in a protected mode system, which global descriptor table entry is accessed?
Tutorial-7
4. In the above question mention the addressing mode for each instruction. 5. What is the difference between Intrasegment and Intersegment JMP? 6. What is displacement range for the Short, Near and Far Jump? And where do you see the applications of these jump types. 7. With an example explain double indirect Jump addressing mode? 8. What is the purpose of the .MODEL TINY/SMALL/COMPACT/MEDIUM/LARGE statement? 9. Explain, what is wrong in the following 8086 instructions when execute with MASM assembler.
a. MOV BL,CX
10. Choose an instruction that requires BYTE PTR, WORD PTR and DWORD PTR. 11. How many bytes are stored on the stack by the PUSH instruction? 12. Explain how the PUSH [DI] instruction functions. 13. What registers are placed on the stack by the PUSHA instruction? In what order are they placed?
14. Explain, why 8086 has downward growing stack? Mention use of BP, SP and SS register to access stack memory. 15. Write an 8086 assembly program to simulate all the addressing mode of 8086. 16. What are the segment memories a programmer can access and modify its address? 17. Write an 8086 assembly program to store data 11H at location 2000H:100H 18. Modify the above program to store 1122H
Tutorial-8
Timer and Counter of 8051
1. What are the various registers shared by timer and counter. If you want to use timer register as a counter, what are the changes to be done for TMOD register. 2. Write an 8051 assembly program to generate a square wave of frequency 33.33 KHz. 3. Assumes that XTAL=11.0592MHz. What values do we need to load into the timers register if we want to have a time delay of 5ms? Show the program for Timer -0 to create a pulse width of 5ms on P2.3 4. Generate a square wave with 66% duty cycle. Assuming XTAL frequency =11.0592MHz. 5. Assumes that XTAL=11.0592MHz, and we are generating a square wave on pin P1.2, find the highest square wave frequency that we can generate using mode 1. 6. Program timer1 to be an event counter. Use mode2 and display the decimal count on P2, P1 and P0 continuously. Set the initial count to 99. 7. Write an 8051 assembly program to count the number of vehicles (Only cars) passing through a road using two IR sensors. The distance between the front and rear wheel is used to categorize it as car, which is assumed to 2 meters in distance approximately. Assume that the speed of the car on this road is 10 kmph, the IR sensor-1 is connected to P1.1 and IR sensor2 is connected to P1.2. Monitor these pins P1.1 and P1.2 to identify a car and count it. Also, Store the count of cars in that road at memory location 300H. 8. Write an assembly program for a microwave oven in which the temperature has to be maintained for specific time period based on the dish being prepared. The heating device in the oven is controlled through P2.2. When P2.2 is enabled, the heating device is switched on or else, itll be switched off. Once the dish is ready, print a message ENJOY THE MEAL
in memory location 300H. Assume the time period for various dishes of your own. (Note: Specify all the assumptions you are going to make).
Tutorial-9
Serial communication of 8051
1. In a given situation we can not accept reception of any serial data. How do you block such a reception with single instruction? 2. How do you calculate the baud rate for given crystal frequency and how do you double it. 3. SERIAL OUTPUT WITH TIME DELAY string has been defined at ROM location 300H. Now write 8051 program to serial output the above string with baud rate of 9600 and time delay of 200ms between each character output. . 4. Write an 8051 serial communication program to read two strings and display their concatenation. Use 9600 baud rate and 8 bit data and 1 stop bit mode. 5. Write a 8051 program that transmits serially hello word after every 10 seconds using baud rate 2400 and frequency 11.0592 MHz.. 6. Write a program for a vehicle speed monitoring system in which a message OVER SPEED has to be sent when the speed of the vehicle is more than 60 kmph through the UART. Assume the speed is inputted through port 1. 7. Write a 8051 serial communication program to read the message Jaypee Institute of Information Technology and output the message in reverse as ygolonhceT noitamrofnI fo etutitsnI eepyaJ. Use 4800 baud rate and 8 bit data, 1 stop bit.
Tutorial 10
6. What is the difference between the Procedure and Macro? 7. Execute the sample program of MACRO from Lecture slides. 8. How do you define LABEL in the Macro?
14. Interface 2KB, and 4KB and 8KB memory chips at Low and High bank thus creating memory space of 32 KB. Draw detailed interfacing diagram and explain decoding strategy.
4. Explain with the neat diagram, the control signals which are exchanged between Data Terminal Equipment (DTE) and Data Carrier Equipment (DTE). 5. Program the 16550 for operation using six data bits, even parity, one stop bit, and a baud rate of 19200 using 18.432MHz clock. 6. Which are the types of error that a 16550 can detect while serially communicating between two microcomputers?