Write appropriate c code to implement given state transition

Assignment Help Other Engineering
Reference no: EM131061481

1.  Match the entries in the left column with those ie downn the right Column, E.g. if entry #2 in the left column matches entry #C in the right column, write down C in the shaded box in row 2.

649_Match column A and B.jpg

2. Consider the following state transition diagram for a finite state machine. The circles represent the states, and are labeled A through D. The arrows represent transitions between states. The input is represented by x and the output is y. Assume that the variable "PortA" provides the input value x, and that the output value is written to the variable "PortB".

Write the appropriate C code to implement this state transition diagram. Hint: Use the C construct "Struct" or arrays. Be sure to include comments to describe your code.

2129_State Transition Diagram.jpg

3.

a) What to the terms in the acronym "PID" Controller mean?

b) Suppose the gain k controls the proportional gain in a PID controller. State what happens to the response function when the gain is very low, and the gain is very high.

c) Why do we add the "I" and "D" terms to a controller? How does that change the response function?

4. Consider two wheels joined by an axle as shown in the following figure. This is a top view. The radius of each wheel is 4/pi centimeters (pi = 3.14159). The objective is to start at Position A and end at Position B. This involves traveling North for 8 cm, then turning right, and then traveling East for 4 cm. You can assume a hard turn, ie Wheel 2 is stationary when performing the right turn.

2422_Top view of wheels.jpg

Assume that the wheels are driven by one stepper motor each. The state transition diagram for one stepper motor is shown below. Each transition moves the wheel by 18 degrees, ie each step is 18 degrees.

665_Transition Diagram.jpg

a) Draw a flow chart indicating the commands to be sent to the stepper motor for each wheel.

b) Write the C code in order to implement the movement from Position A to Position B.

5. You have been hired by a company to develop a Virtual Reality headset that will display streaming video. Briefly describe your design by addressing the following requirements:

(1) Latency. What types of latency will you consider?

(2) Bandwidth. Assume 30 frames per second and image size of 100x100 pixels, at 3 bytes per pixel, uncompressed.

(3) What factors will affect the latency of your system? Mention at least two factors.

(4) How will you improve the latency of your system? Suggest at least one possibility.

Your entire answer to this question should not exceed one page.

6. You are given the following list of tasks that need to be run. There is no synchronization between these tasks.

Process

Execution Time

Period

P1

1

4

P2

5

25

P3

5

50

P4

4

40

Determine whether this system is schedulable. (Hint: use the Rate Monotonic theorem).

Also assume that n (2^(1/n) - 1) c= In(2) = 0.69 for your calculation. What is the CPU utilization in this case?

7. A printer needs to be shared between 4 threads. Use semaphores to design a solution to this problem. Use Wait and Signal commands, and describe how your solution works.

8. Three threads, Thread', Thread2 and Thread3 need to be synchronized. Whichever thread gets to a certain point (synchronization point) of the main code will wait for the other threads to finish. Only when all three threads have arrived will the execution of the main code continue beyond the synchronization point. Use semaphores (signal and wait) to design a solution to this problem.

a) Describe the meaning of the semaphores you will use.

b) Create a table showing the states of the different semaphores you have chosen, and the order in which the different threads arrive at the synchronization point.

Reference no: EM131061481

Questions Cloud

Determine the particle distributions allowed : If we have 10 distinguishable particles that must have a total combined energy 0f 10 units, determine the particle distributions allowed (there are 14) and calculate W (the number of micro states for each possible distribution.
Statistical mechanics problem : There is a system with four energy levels (with energies 0,1,2,3 units). If we have 10 distinguishable particles that must have a total combined energy 0f 10 units
Influent concentration of tca : By assuming that the lake is a well mixedsystem, that concentrations are at steady state and the only processes acting onthis chemical in the lake are volatization and biodegredation, howhigh can the influent concentration of TCA be at the point w..
Experiences a change in internal energy : Calculate the work done on or by a system that absorbs 260 kj of heat experiences a change in internal energy of 157 kj. Does the system expand or contract? How do you know?
Write appropriate c code to implement given state transition : Write the appropriate C code to implement this state transition diagram. Hint: Use the C construct "Struct" or arrays. Be sure to include comments to describe your code.
Computing the alpha decay : An atom has 97 protons and 251 nucleons. If it undergoes alpha decay, what are the number of protons and neutrons, respectively, in the daughter nucleus?
Determine the height and diameter of the absorption tower : The unit is to operate 8000 h/year. Determine the height and diameter of the absorption tower at conditions of minimum annual cost.
Vapor pressures of pure : A solution is prepared by mixing 0.0400 mol CH2Cl2 and 0.0800 mol of CH2Br2 at 25 °C. Assuming the solution is ideal, calculate the composition of the vapor (in terms of mole fractions) at 25 °C. At 25 °C, the vapor pressures of pure CH2Cl2 and pu..
Differentiate between diamond and graphite : Differentiate between diamond and graphite. How is combustion different from pyrolysis?

Reviews

Write a Review

Other Engineering Questions & Answers

  Describe the normal single chip operating mode and indicate

a describe the normal single chip operating mode and indicate how this mode can be selected.b describe the normal

  Two-stage cascade refrigeration cycle

Would you recommend a simple refrigeration cycle with refrigerant-134a or a two-stage cascade refrigeration cycle with a different refrigerant at the bottoming cycle? Why?

  Duality property between time domain and frequency domain

Duality Property between Time domain and Frequency domain with Numerical example. Zero Padding and Spectral Density Discussions. Explanation with the help of magnitude and phase plots of numerical example for different Number of frequency samples. Sa..

  Determine the ammonium conversion in bioreactor

If ammonium conversion in bioreactor 1 is 70%, determine the ammonium conversion in bioreactor 2. determine whether the cell concentration in bioreactor I would be less than, equal to, or greater than the cell concentration in bioreactor 2

  Perfectly fitting pot and its lid often stick

A perfectly fitting pot and its lid often stick after cooking, and it becomes very difficult to open the lid when the pot cools down. Explain why this happens and what you would do to open the lid.

  System and the heat transfer to the cylinder

The pin is pulled, releasing the piston, and both rooms come to equilibrium at 30°C and as the water is compressed it becomes two-phase. Considering a control mass of the air and water, determine the work done by the system and the heat transfer t..

  What is the electronic translator

How can an electronic translator used by tourists when they are travelling abroad assist them and what is the electronic translator?

  Doubling the radius of a blood vessel

Doubling the radius of a blood vessel will (increase/decrease)[A] the resistance by a factor of (two/four/eight/sixteen)[B] and (increase/decrease)[C] the flow of blood.

  Mass flow rate of isobutane

(a) The mass flow rate of isobutane in the binary cycle, (b) The net power outputs of both the flashing and the binary sections of the plant, and (c) The thermal efficiencies of the binary cycle and the combined plant.

  Develop the ability to build and present a business plan

Develop the ability to build and present a business plan for a new engineering ventures, including; financial, supply chain, development team, marketing and production.

  Estimate heat transfer performance

Evaluate effectiveness when being applied to industrial steam raising plant - Produce a report of no more than 850 words on your experience during the experiment, highlighting any differences between the theory and practical outcomes.

  Present worth on incremental investment calculations

Show the present worth on incremental investment calculations and identify the best alternative. Show your work at the same level of detail as possible

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd