ece253f_2005_exam - Print: First Name: . . . . . . . . . ....

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Print: First Name: . . . . . . . . . . . . . . . . . . . . . . . . . . . .. Last Name: . . . . . . . . . . . . . . . . . . . . . . . . . .. Student Number: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . University of Toronto Faculty of Applied Science and Engineering Final Examination — December 12, 2005 ECE253F — Digital and Computer Systems Examiner — Parham Aarabi 1. There are 6 questions and pages. Do all questions. The total number of marks is 100. The duration of the test is 2 hours 30 minutes. 2. ALL WORK IS TO BE DONE ON THESE SHEETS! Use the back of the pages if you need more space. Be sure to indicate clearly if your work continues elsewhere. ' 3. Open book - Exam Type D. Only authorized photocopies of copyrighted material are allowed. A photocopy of Appendix A for Verilog is permitted. 4. All calculators permitted. 5. Please put your final solution in the appropriate spaces. A big space does not necessarily mean a long answer is required. 6. Place your student card on your desk 1 [10] 2 [10] 3 [20] 4 [10] 5 [20] 6 [30] Total [100] l Page 1 of 11 [10 marks] 1. Funwith oscillations. [5 marks] [5 marks] a) Design a ring oscillator with a frequency of 20MHz. Assume you have an unlimited supply of NOR gates that have a propagation delay of 5ns. Draw the circuit diagram of your design. b) Still using your unlimited supply of NOR gates, add an active-high reset signal to the oscillator you designed in part a) (i.e. the oscillator’s output is reset to 0 when the signal Rst is high). Page 2 of 11 [10 marks] 2. Using an 8—bit adder (defined below), write a Verilog module that multiplies a 4-bit number num by 9. If the result is divisible by 4, the 1-bit output flag is 1, otherwise the output is 0. module adder8 (cin, x, y, s, cout); input cin; input [7:0] x, y; output [7:0] 5; output cout; endmodule module mymodule (num, flag); input [3:0] num; output flag; endmodule Page 3 of 11 [20 marks] 3. Youvare to design a finite state machine with two inputs and one output. The inputs :1: and [5 marks] [5 marks] y provide two numbers (of unknown bit length) in a serial fashion (i.e. one bit of the first number arrives at the input at: every clock cycle, and one bit of the second number arrives at the input y every clock cycle). The output 22 should only be set to a 1 if the total number of ‘1’ bits in :1: minus the total number ‘1’ bits in y, modulo 3, is equal to 0. (for example, if six 1’s have been received from x, and three 1’s from y, or if nine 1’s have been received by m, and zero 1’s by y, then the. output 1) should equal 1). a)_ Draw the Moore state diagram using only three states. Include a reset signal. b) Draw the state transition table assuming that you will be using ONLY two DFFs. Page 4 of 11 [10 marks] c) Derive minimized expressions for the FSM’s next state and output. Draw the corre- sponding logic circuit for the entire system. Page 5 of 11 [10 marks] 4. Write a 68k assembly program that computes the factorial of a number, defined as n! = n(n — 1)... 1, WITHOUT using any instruction that has the character ‘u’ in it (i.e. you cannot use mulu, muls, sub, Assume that the number is stored in memory location N, and “store the final result in memory location FINRES. Page 6 of 11 [20 marks] 5. Stranded on a storm-prone and earthquake-prone island, you manage to salvage a 68k proces— [8 marks] sor board, several batteries, and lots of AND, OR, and NOT gates as well as tri—state buffers. After years of research you find a mysterious plant that can predict earthquakes and storms. This plant has two 8-neuron bundles, with each neuron either being ‘on’ (i.e. having a high voltage) or ‘off’ (i.e. low votlage). You find that 7 times the number of ‘on’ neurons in the first bundle will tell you roughly how many days there are before an earthquake. You also find that the number of ‘on’ neurons in the second bundle, squared, tells you roughly how many days there are before a storm. a) Design the interface circuit to connect the plant neurons to your 68k processing bus. Use the address $10000 for the plant. Page 7 of 11 [12 marks] b) Write a 68k assembly program that reads the information from the plant and stores the number of days before an earthquake in D0 and the number of days until a storm in D1. Page 8 of 11 [8 marks] ORG DS.L DS.L ORG MOVEAL MOVE.L MOVE.L MOVE.L BSR BRA THESTK STUCK ORG MOVEL SUBL CMPL BEQ MOVEL MULUL ADDL BSR MOVEL RTS SQUARECURSE ENDCURSE a) After the program gets stuck in the infinite loop at STUCK, what is the value of D0 and [30 marks] 6. Consider the following 68000 assembly program: $10000 99 ; initializing the stack 1 $20000 #THESTK,A7 #6,D0 #0,D1 #6,D2 SQUARECURSE STUCK $20040 D24An #LDO #0D0 ENDCURSE D0D2 DZD2 DzDi SQUARECURSE (AU+JD ;just a simple unsigned multiply D1? Note that the ‘mulu.l’ instruction is a simple unsigned multiply. Page 9 of 11 [6 marks] .. continuation of a). b) Assuming that all branch instructions (i.e. BSR, BEQ) take 1 word (16 bits) of mem— ory, find out the memory addresses of each instruction, including STUCK as well as EN-DCURSE. Page 10 of 11 [8 marks] 0) Show the exact contents of the stack after the BBQ ENDCURSE branch is taken (not in the first iterations when the BBQ ENDCURSE branch is not taken). d) You realize that that this operation could be done much more efficiently by using a single , loop without subroutines. Rewrite the program so that the end result in D0 and D1 is the same, but using only a single loop without subroutines. Page 11 of 11 ...
View Full Document

Page1 / 11

ece253f_2005_exam - Print: First Name: . . . . . . . . . ....

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online