Docsity

EECS 373 Midterm Exam - Winter 2007, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
EECS 373 Midterm Exam
Winter 2007
Name: ____________________________________ unique name: _______________
Sign the honor code:
I have neither given nor received aid on this exam nor observed anyone else doing so.
___________________________________
Scores:
Problem # Points
1 /20
2-4 /12
5 /10
6 /12
7
/08
8 /38
Total /100
NOTES:
1. Open White book and EABI only.
2. There are 12 pages including this one.
3. Calculators are allowed, but no PDAs, Portables, Cell phones, etc.
4. Don’t spend too much time on any one problem.
5. You have about 80 minutes for the exam.
6. 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.
7. It is likely you will want to rip apart the exam when doing the last question. That is
fine, but be sure you use our stapler to put it all back when you are done.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download EECS 373 Midterm Exam - Winter 2007 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

EECS 373 Midterm Exam

Winter 2007

Name: ____________________________________ unique name: _______________

Sign the honor code:

I have neither given nor received aid on this exam nor observed anyone else doing so.

___________________________________

Scores:

Problem # Points

Total /

NOTES:

  1. Open White book and EABI only.
  2. There are 12 pages including this one.
  3. Calculators are allowed, but no PDAs, Portables, Cell phones, etc.
  4. Don’t spend too much time on any one problem.
  5. You have about 80 minutes for the exam.
  6. 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.
  7. It is likely you will want to rip apart the exam when doing the last question. That is fine, but be sure you use our stapler to put it all back when you are done.
  1. Fill-in-the-blank or circle the best answer. [20 points, -2 per wrong or blank answer]

a) DRAM / SRAM / ROM is non-volatile.

b) A 4 Mbit square memory with 18 address lines would output 2 / 4 / 8 / 16 / 32 / 64

bits of data in a given read. The row decoder would have _________ inputs while

the MUX selector would have _________ inputs.

c) An ISR should be sure to save all Volatile Registers / Non-Volatile Registers /

Registers that it uses. An ABI-compliant leaf function should be sure to save all

Volatile Registers / Non-Volatile Registers / Registers that it uses.

d) When using a PCI bus with a 32-bit AD bus with a 50ns clock, the fastest data

rate you’d expect to get when doing large numbers of 5 byte writes is

______________________ bytes/sec.

e) The ____________ bit of the ____________ determines if an external interrupt

branches to 0x500 or ______________.

f) Say the PC is currently 0x40000. Using the “bc” instruction with AA=0, you

could branch to any location from 0x_______________ to 0x_______________

g) If you want to do DMA rather than _____________________________, your bus

must support bursts / arbitration / atomic read-modify-write operations / a

method for targets to stall the bus.

h) Long / Short / Read / Write transactions are best suited to use DMA.

i) A ____________________ is when a combinational logic device should stay at

a level (0 or 1) but instead changes to the other level for a short period of time.

j) A load word to memory location 0x999 will result in TS going low _________

times.

  1. Write an ABI-compliant Power-PC assembly function which does the same thing as the following C function. You are required to use the CTR register as the loop- control variable in an appropriate and efficient way. In addition the function itself should be reasonably efficient. Note that this is a leaf function and that you might find it helpful to read the “bc” assembly command in the White Book. [12]

int bob(int in)

int i;

int out=0;

for(i=0;i<in;i++)

out=out+i;

return(out);

  1. Using only D flip-flops (with sync reset and Q and Q_bar outputs), standard gates (AND, NAND, OR, NOR, XOR, XNOR) with any number of inputs, and inverters (bubbles for inverters are fine), design a device that divides an input clock by 6 and gives a 2/3rds duty-cycle. Label the input clock as “input” and the output clock as “output”. Your grade will in part be based on efficiency, flip-flops cost 10, gates cost 1 per input and inverters cost 1 (including all inversion bubbles). [10]

8. Design problem You are to design a bus interface and write the device driver for a smart temperature sensor. The sensor contains an embedded controller that will convert the analog temperature signal into a digital value. The controller has two 8-bit registers that you need to interface to the PPC.

CS (Command and Status Register) This is a read/write register and is used to initiate temperature controller actions and provide status.

Ready Reserved Reserved Reserved Reserved Reserved Reserved Start Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7

Start Bit 0 : Writing a one to this register initiates a measurement. The temperature controller will clear the bit after the measurement starts.

Ready Bit 7 : This bit is set to one when the measurement is complete and data is ready in the data register. This bit is automatically cleared when the Start bit is set to one.

DATA (Data Register) Data Data Data Data Data Data Data Data Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7

The results of the measurement are placed in this register and are current when the Ready bit is high. The MSB is Bit 0 and the LSB is Bit 7.

IO Control Signals The temperature controller registers are written and read with the following control signals.

  • WRITE_CS is an active high write enable for the CS register.
  • CLK is used to latch data into the CS register on the rising edge.
  • READ_CS is active high enabling data from the CS register onto the sensor’s data bus. Otherwise the output is in high Z (tri-state).
  • READ_DATA is active high enabling the DATA register onto the sensor’s data bus DATA. Otherwise the output is in high Z (tri-state).

An IO macro to the temperature sensor is provided. The sensor is connected to the PROC macro, Temperature Controller macro and an IO Controller Macro as follows.

Part 1: Macros:

Part 2: Device Driver [18]

Write a device driver in assembler for the temperature controller. The driver is required to do the following:

  • The function name for your driver is get_temp.
  • The driver is to return a 32-bit signed integer representing the final measurement.
  • The temperature controller is non-linear so you must call a C-function named LIN in your device driver to convert the temperature reading. LIN accepts and returns a 32-bit signed integer.
  • All control of the temperature sensor must be done in the driver.
  • The function should be designed so that when it is linked it can be called by a C function, that is it must be ABI compliant.
  • You should make efficient use of the stack and registers. Points will be deducted for excessive stack or register use.
  • Providing high-level comments identifying the function of each key part of your driver will improve your success (and perhaps partial credit!)

.