Pasumarthisreekar S2
Pasumarthisreekar S2
Pasumarthisreekar S2
Problem Statement: Design a state machine and corresponding gate level circuit for a vending machine. The
specifications are as follows:
Solution:
Q2.
Problem Statement: A microprocessor is designed to control various appliances and lights in your house. The system
has an output port with the address 01H, and various appliance units are connected to the bits D7 to D0. On a cool
morning you want to turn on the radio, the coffeepot, and space heater. Write appropriate instructions for the
microprocessor. Assume R/W memory in your system begins at 2000H.
Solution:
To turn on the radio, the coffeepot, and the space heater, set D6, D5, and D4 at logic 1, and turn the other bits at
logic 0.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 1 1 0 0 0 0
The output port requires 70H, and it can be sent to the port by loading the accumulator with 70H.
PROGRAM:
Problem Statement: Subtract the 16-bit number in memory locations 4002H and 4003H from the 16-bit number in
memory locations 4000H and 4001H. The most significant eight bits of the two numbers are in memory locations
4001H and 4003H. Store the result in memory locations 4004H and 4005H with the most significant byte in memory
location 4005H.
Solution:
PROGRAM:
10. SHLD 4004H Store 16-bit result in memory locations 4004H and 4005H