






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Name: ____________________________________ unique name: _______________ Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so.
Scores:
Open White book and EABI, and the branch handout only. There are 10 pages including this one. Calculators are allowed, but no PDAs, Portables, Cell phones, etc. Don’t spend too much time on any one problem. You have about 80 minutes for the exam. Be sure to show work and explain what you’ve done when asked to do so. Getting partial credit without showing work will be rare. Spend your time wisely. In particular, be sure to try all three parts of the design problem.
1. Fill-in-the-blank/multiple choice. [16 points, -2 for each wrong or blank answer] a. A 100kHz clock with a 20% duty cycle has a period of ________________ ns. b. The PowerPC addi instruction can have immediate values that range from _______________ to _________________. c. On our lab kit, the fewest bus cycles that the PowerPC could take (from start to finish) to perform a word read from location 0x10001001 is __________________. A halfword write to the same location would take at least __________ bus cycles. d. If the top 2 bytes of SIPEND were 0x3030 and the top 2 bytes of SIMASK were 0x4455, then the value in SIVEC would be ___________. (answer in decimal). e. Say the top 2 bytes of SIPEND were 0xEF87, and the top 2 bytes of SIEL were 0x7077. If we wrote 0xFF00 to the top 2 bytes of SIPEND, what would be the value in SIPEND after that write? ___________________. (answer in hex) f. An ABI-compliant leaf function should be sure to restore all Volatile Registers / Non-Volatile Registers / Registers that it uses. An ISR should be sure to restore all Volatile Registers / Non-Volatile Registers / Registers that it uses. g. When identifying the minimum / maximum / average period for a sequential circuit, you generally add three values: the clock-to-Q delay of the flip-flops, the worst-case / average-case / best-case delay of the combinational logic (including wire delay), and the hold / set-up / Q-to-clock time of the flip-flops. h. A callee-save register is the same as a volatile / non-volatile / reserved register. i. A synchronous interrupt is synchronous to the bus clock / processor clock / instruction stream.
3. Using only a counter, D flip-flops, and standard gates, design a device that takes an input clock and provides an output clock that is 1/12th^ the frequency of the input and has a 50% duty cycle. Be sure to clearly label your devices and wires. [10]
4. Consider the following C leaf function. int add(int w, int y) // return the sum of the two ints which are pointed to // by the arguments. { return(w+y); } Rewrite the above code in PowerPC assembly while following the ABI. NOTE: as this is a leaf function, you aren’t required to allocate a stack frame or otherwise manipulate the stack! [10]
Design problem: Where there’s smoke… [35 points] You have been asked to implement a simple smoke alarm simple system with your PPC kit. You will be provided a modified base project that will include a port to a smoke sensor. The sensor will provide a 4-bit digital output that is proportional to the amount of smoke detected. It can be treated as a 4-bit unsigned number. Your job is to do the following: Display the sensor value on HEX Display an “A” (for “Alarm”) on HEX3 if the sensor value is 0x9 or above. The other hex digits may have any value (we don’t care). Also, the smoke sensor outputs are such that bit 0 is the LSB and bit 3 is the MSB. The high level organization of the hardware is: We suggest you read all parts before starting. Smoke Sensor PPC Hex Display Control Logic
Part 1: Below is a simplified base project including the connection to the smoke sensor and control modules. Complete all necessary control and data path connections. You can assume: You have access to any reasonable component: gates, buffers (any size) Nets with the same name are connected. All the modules are fully implemented. (This part only, later we’ll ask to you make one of them.) Draw and label clearly. [8]
Part 3: Write the assembly code to implement the smoke alarm. Assume the RD_SENSOR module is implemented and provides its data at the word addressable read at location 0x2800000. Assume, as in part 2, that the device only responds to byte writes. Comments or a high level description will improve your chances for extra credit. You do not have to complete hardware parts of this problem to write this code. [12]