Skip to main content

Posts

Q. Write a program to load the bit pattern 91H in register B and 87H in register C, mask all the bits except D0 from registers B and C, and if D0 is at logic 1 in both the registers, turn on the light connected to the D0 position of the output port 01H; otherwise, turn off the light. MVI B, 91H MVI C, 87H MOV A, B ANI 01H MOV B, A MOV A, C ANI 01H MOV C, A ANA B JNZ LABEL MVI A, 00H OUT 01H HLT LABEL: MVI A, 01H OUT 01H HLT
Q. Write a program for absolute division of two numbers. Assume that the numbers are in register B and C, and the result is to be displayed at output device 50H. MVI B, 12H MVI C, 03H MVI D, 00H MOV A, B LABEL: INR D SUB C JNZ LABEL MOV A, D OUT 50H HLT
Q. What is the task of the following program? Specify the contents of flags, registers used and output port 30H after the execution of the following instructions. 1200:    MVI A, 55H 1202:    ANI 80H 1204:    JNZ 120DH 1207:    OUT 30H 120A:   JMP 1212H 120D:    MVI A, 01H 120F:   OUT 30H 1212:    HLT The task of the program is to check whether the number in the accumulator is positive or negative. The D7 bit of the number determines the sign. In this case the number 55H has D7 bit ‘0’, i.e. the number is positive so the result at the o/p device 30H is zero (00H), denoting positive. If there is any other number with D7 bit ‘1’, the result at the o/p device 30h will be one (01H) denoting negative. Content of flags: Contents of register A: 00H Content of o/p port 30H: 00H

control matlab practice

https://drive.google.com/open?id=1FWno-_4G-tj4foDw57I5PB16EjBjtSHz 1. There are some built in constants in MATLAB; i, j, pi, eps, inf, NaN. Whether a name is a built in constant or not can be checked by the statement ''which -all <name>''. 2. Type the following vector in the command window: a) 𝐴= 123 b) 𝐵= 01−2−3 c) 𝐶= −120410−2106 i) Use MATLAB to find the value in the second row and the third column of matrix C. ii) Use MATLAB to find the second row of matrix C. iii) Use MATLAB to find the third column of matrix C. iv) Use MATLAB to delete the second column of matrix C. 3. You can also perform Element-wise assignment of the Matrix elements. a) >> A(1,1)=1;  b) >> A_r1=[1 2];                     c) >> e_col1=[1;3.7;8]; >> A(2,1)=3.7;        >> A_r2=[3.7 -0.002];             >> e_col2=[2;2e-3;1.3e5]...
Write a 8086 program to find the factorial of given number.
Write a 8086 program to find the factorial of given number.
Write a 8086 program to add two 8 bit nimbers. soln
Write a program to get input from an input device with address 30H and check the type of the number: odd or even, prime or composite and negative or positive. Assume that the output port 40H has 8 pins with 8 LEDs. Pin D0 for prime, pin D1 for composite, D2 for odd, D3 for even, D4 for positive and D5 for negative. Pins D6 and D7 are left unconnected. Turn on respective three LEDs depending upon the number.
Write a program to sort a series of data in descending order. Assume that the data series is stored at memory locations D000H to D009H. https://www.geeksforgeeks.org/8086-program-to-sort-an-integer-array-in-descending-order/
Clothes are normally hung outside to dry in the sun. There are possibilities of clothes being wet when there is a rainfall. The system as shown below is used to put clothes inside the house when there is a rain. The rain detector sends a high signal to the pin D0 of the input port 30H whenthere is rainfall. The microprocessor then rotates the string on which the clothes are hung. The string is rotated by sending a ‘10’ to pins D0 and D1 of the output port 40H to which a DC motor is connected. The string is rotated until the limit switch1 sends a high signal to pin D7 of the input port 30H. Also if the rainfall stops the cloth is send out by rotating the DC motor in the other direction. ‘01’ is to be send to pins D0 and D1 of output port 40H for this operation. The motor is rotated until the limit switch2 send a high signal to pin D6 of the input port 30H. Write a program for the proper operation of the system. soln 
A seven segment display is connected to output port 30H for an Intel 8086 based system. Write a program to convert the content of memory location C000H to seven segment display. Assume that the memory location contains any number from 0 to 9. If the number is greater than 9 all the LEDs of the display should be off. ( Hint: store the bit pattern for numbers from 0 to 9 in memory locations D000H-D009H and then the program should find the pattern according to the number in C000H and display that to output port 30H) soln
The figure below uses an 8086 based system to track the sun, and position the Solar Photovoltaic module in the direction of the sun. The solar module is attached to a DC motor and the sun is tracked by two light sensors at two sides of the solar photovoltaic module. If both the sensor sends ‘1’ the motor is to be stopped. If only sensor1 sends ‘1’ the motor is to be rotated in one direction and if only sensor2 sends ‘1’ the motor is to be rotated in the other direction. For a DC motor “10” at the supply pins rotates the motor in one direction and “01” rotates the motor in the other direction. As per the connection shown on the right, write a program for the proper operation of the system. soln

MATLAB practice//signal and system

The question is the available in the photo whose solution is available in below link. The solution is available in following link. https://drive.google.com/open?id=1CT_joehFZYBzEzMn8gs2FPDhiztXTHTD