A system has two memory-mapped I/O devices. The first device has a 16-bit status register at...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A system has two memory-mapped I/O devices. The first device has a 16-bit status register at address OxA000, immediately followed by a 32-bit data register. The second device has an 8- bit status register at address OxB000, followed by a 32-bit data register. The first device is used to receive data (i.e., input device). The most-significant bit in the status register is a data ready flag, which is set automatically by the device whenever new data is received. For the device to receive more data, the data ready flag must be manually reset by software to indicate that the current data have been processed. The second device is used to send data (i.e., output device). Bit 0 of its status register is a read- only ready to send flag, and bit 7 is a transmit enable command bit that is automatically reset by the device after each transmission. We would like to write software that collects 32-bit words of unsigned values received through the first device, and computes the maximum of received data until the second device becomes ready to send. Once the second device becomes ready to send data, the maximum word is sent using the second device. Once the maximum is sent, the maximum computation is restarted for the next sample of data, ignoring the previously received data samples. a) Construct a C program that implements this behavior using polling only. b) Assuming that each device has its own interrupt handler, develop the handlers for each device in C. The first device generates an interrupt request upon receiving new data. The second device generates an interrupt request upon becoming ready to send new data. A system has two memory-mapped I/O devices. The first device has a 16-bit status register at address OxA000, immediately followed by a 32-bit data register. The second device has an 8- bit status register at address OxB000, followed by a 32-bit data register. The first device is used to receive data (i.e., input device). The most-significant bit in the status register is a data ready flag, which is set automatically by the device whenever new data is received. For the device to receive more data, the data ready flag must be manually reset by software to indicate that the current data have been processed. The second device is used to send data (i.e., output device). Bit 0 of its status register is a read- only ready to send flag, and bit 7 is a transmit enable command bit that is automatically reset by the device after each transmission. We would like to write software that collects 32-bit words of unsigned values received through the first device, and computes the maximum of received data until the second device becomes ready to send. Once the second device becomes ready to send data, the maximum word is sent using the second device. Once the maximum is sent, the maximum computation is restarted for the next sample of data, ignoring the previously received data samples. a) Construct a C program that implements this behavior using polling only. b) Assuming that each device has its own interrupt handler, develop the handlers for each device in C. The first device generates an interrupt request upon receiving new data. The second device generates an interrupt request upon becoming ready to send new data.
Expert Answer:
Answer rating: 100% (QA)
Below are examples of C code for the specified behavior using polling Part a and with interrupt handlers Part b a C program using polling include include Define memorymapped addresses define FIRSTDEVI... View the full answer
Related Book For
Computer organization and architecture designing for performance
ISBN: 978-0136073734
8th edition
Authors: william stallings
Posted Date:
Students also viewed these programming questions
-
How can you calculate the period of the oscillation? Important? What approximation is need? What kind of equation do you need to solve? T = 2 s = so sin(wt + Qo) g How do experimental errors...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
As the Developing market of Southern Africa there is endless growth opportunities and constant ask for high growth pushed by the business, this growth comes normally in a very erratic way but as...
-
Determine the magnifying power of a lens by focusing on the lines of a ruled piece of paper. Count the spaces between the lines that fit into one magnified space, and you have the magnifying power of...
-
The County Clerk in Essex, New Jersey, was accused of cheating by not using randomness in assigning line positions on voting ballots. Among 41 different ballots, Democrats were assigned the top line...
-
Assume HPC, Inc., began December with 60 units of inventory that cost a total of $720. During December, HPC, Inc., purchased and sold goods as follows: HPC, Inc., uses perpetual inventory. Under the...
-
Tyler Pahl recently received the following information related to Pahl Companys December 31, 2014, balance sheet. Inventory ................$ 4,100 Cash .................. 3,900 Equipment...
-
Consider a chamber isolated from the outside by adiabatic ,walls. Inside the chamber is a wall separating half the volume on each side. There is an ideal gas on one side of the partition, vacuum on...
-
Champ Manufacturing produces a variety of high-precision manufacturing equipment. The company is considering purchasing one component part from an outside supplier instead of making it in-house. The...
-
If a firm's explicit costs are $2,000, its implicit costs are $1,000, and its revenue is $5,000, the firm is earning A. positive accounting profit of $2,000 B. negative accounting profit of $2,000 C....
-
Discuss penalty/premium provisions typically related to non-consent operations. Be sure to comment on why some penalties are higher/lower than others.
-
Answer the following true/false questions. Explain your answers as necessary. a. Different action verbs should be used in screen dialogue to describe required keyboard actions in order to add variety...
-
Consider the circuit in Figure P5.4. How does this circuit compare with the circuit in Figure 5.16? Can the circuits be used for the same purposes? If not, what is the key difference between them?...
-
True or false? Explain your answers as needed. A dependency relationship models a two-class association in only two instances. To enforce encapsulation, attributes should generally be declared...
-
Are the following statements true or false? Explain your answer as needed. a. Building and testing any databases that are needed should occur after programming activities are completed. b. Training...
-
If f(x) = 6x-2, then find f(x + 1) and simplify. (6 points) Solve the system of equations by Graphing. (6 points) k(x) = -x-5 3 f(x) = -x-2
-
Air pollution generated by a steel mill is an example of a) a positive production externality. b) a negative production externality. c) a public good. d) the free-rider problem. State and local taxes...
-
Consider the following code fragment in a high-level language: Assume that Q is an array of 32-byte records and the VAL field is in the first 4 bytes of each record. Using x86 code, we can compile...
-
Use the Booth algorithm to multiply 23 (multiplicand) by 29 (multiplier), where each number is represented using 6 bits.
-
Table 12.5 summarizes statistics from [MACD84] concerning branch behavior for various classes of applications. With the exception of type 1 branch behavior, there is no noticeable difference among...
-
Prove: 'Bernoulli's equation is a restrictive form of energy equation'.
-
What are the assumption made for the establishment of Bernoulli's equation?
-
A shell and tube heat exchanger is used to cool lubricating oil by water at the rate of \(120 \mathrm{~kg} / \mathrm{min}\). The oil enters the heat exchanger at \(343 \mathrm{~K}\) and leaves at...
Study smarter with the SolutionInn App