0% found this document useful (0 votes)
50 views7 pages

Closed Book, One Sheet of Paper, Programmer Card, No Calculators Show All Your Work

Here is the 68000 assembly code for the LOOP subroutine: LOOP: MOVE.W i,D0 ;load index into D0 CMP.W j,D0 ;compare index to j BGT EXIT ;branch if index > j JSR WHATEVER ;call subroutine SUBQ.W #1,D0 ;decrement index BRA LOOP ;loop back EXIT: RTS ;return

Uploaded by

Micah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views7 pages

Closed Book, One Sheet of Paper, Programmer Card, No Calculators Show All Your Work

Here is the 68000 assembly code for the LOOP subroutine: LOOP: MOVE.W i,D0 ;load index into D0 CMP.W j,D0 ;compare index to j BGT EXIT ;branch if index > j JSR WHATEVER ;call subroutine SUBQ.W #1,D0 ;decrement index BRA LOOP ;loop back EXIT: RTS ;return

Uploaded by

Micah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ECE2042 Final Examination December 17, 2016

Closed Book, one sheet of paper, programmer card, no calculators


Show all your work

Name:

20% 1. A function is shown below in MSOP form. Use the double dual method to find the MPOS
form of the function. For full credit, use the axioms efficiently and simplify at every step.
Show the axiom used at each step.

f = wxy' + wx'z' + w'xyz


ECE2042 Final Examination December 17, 2016
Closed Book, one sheet of paper, programmer card, no calculators
Show all your work

Name:

20% 2. A Karnaugh map is shown below 3 times. There are two MSOP forms for this function;
show them by drawing circles in two of the Karnaugh maps. There is 1 MPOS form for this
function; show it by drawing circles in the remaining Karnaugh map. Show an expression
for one of the MSOP forms and for the MPOS form. Indicate which map corresponds to the
MSOP form.
wx wx wx
00 01 11 10 00 01 11 10 00 01 11 10
yz yz yz
00 0 1 00 0 1 00 0 1

01 1 1 0 0 01 1 1 0 0 01 1 1 0 0

11 0 1 1 1 11 0 1 1 1 11 0 1 1 1

10 0 1 10 0 1 10 0 1

MSOP #1 MSOP #2 MPOS


ECE2042 Final Examination December 17, 2016
Closed Book, one sheet of paper, programmer card, no calculators
Show all your work

Name:

20% 3. a. A function f is given as follows in MSOP form:

f = wx' + x'z' + xyz

i. Draw a truth table for f.


ii. From this, show how f can be generated using a multiplexer with 8 data inputs and
3 control inputs, and at most one inverter. Identify all the inputs to the
multiplexer. Do not design the multiplexer.

wxyz f

0000

0001

0010
I0
0011
I1
0100
I2
0101

0110 I3
MUX O
0111 I4

1000 I5
1001 I6
1010
I7
1011 S2 S1 S0

1100

1101

1110

1111

Problem 3 continued on back.


b. A 5-state counter produces the sequence ABC = 000 001 110 011 101
000 An incomplete decoder is needed to identify the five states of the counter:
ZERO, ONE, THREE, FIVE, and SIX. Your task is to design functions for ZERO,
ONE, THREE, FIVE, and SIX. Ffill in the Karnaugh maps below, draw circles for
minimum functions, and then show the minimized functions for ZERO, ONE, THREE,
FIVE, and SIX in algebraic form. Finally, show the circuit in matrix form (lines and
dota).

AB AB AB
00 01 11 10 00 01 11 10 00 01 11 10
C C C
0 0 0

1 1 1

ZERO = ONE = THREE =

AB AB
00 01 11 10 00 01 11 10
C C
0 0

1 1

FIVE = SIX =
ECE2042 Final Examination December 17, 2016
Closed Book, one sheet of paper, programmer card, no calculators
Show all your work

Name:

20% 4. a. Assume that register D0 contains $7DF1 before each of the following instructions is
executed. Show the contents of D0 in hex (show 4 hex digits) after each of the
following instructions is executed.

i. LSR #3,D0

ii. ASR #3,D0

iii. LSL #1,D0

iv. ASL #1,D0

v. ROR #2,D0

vi. ROL #2,D0

b. Repeat part a. of this problem assuming D0 contains $D3A9.

i. LSR #3,D0

ii. ASR #3,D0

iii. LSL #1,D0

iv. ASL #1,D0

v. ROR #2,D0

vi. ROL #2,D0


ECE2042 Final Examination December 17, 2016
Closed Book, one sheet of paper, programmer card, no calculators
Show all your work

Name:

20% 5. A subroutine LOOP is to be written which starts with the index at value i, counts down to a
value j (j i), and then stops. Each time through, it calls subroutine WHATEVER which
does, well, whatever it does. For example, if i = 8 and j = 6, subroutine WHATEVER should
be called three times, once for index = 8, again for index = 7, and finally for index = 6. Do
not worry about linkage and do not worry about error checking for this problem. Assume the
subroutine WHATEVER has been written by someone else and is available simply by calling
it. Assume also that i and j are signed integers stored in memory and are set by the calling
program. Do not change the values of i and j.

a. Show a flow chart for the subroutine LOOP. Use the proper shapes for the blocks in
the flow chart.

Problem 5 continued on back.


b. A 68000 program is to be written for the subroutine LOOP. You may use all the
registers freely. Your variable, index, should be stored in a register. Clearly state all
the registers you use and what each is used for.

c. Write the 68000 program for the subroutine LOOP. It should match the flowchart on
the front side of this sheet exactly.

You might also like