You are on page 1of 5

ECE2042 Test #2 April 21, 2017

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


Show all your work

Name:

33% 1. a. Show the state table for a state machine which is to recognize the input sequences
which end with an even number of 1s (at least 2) followed by an odd number of 0s.
Assume that the current output is included in the recognition. An example of the use of
the table is shown by the following sequence, assuming it starts in state A:

x: 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 . . .
z: 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 . . .

The blank state table with histories of the four states is shown below. Complete the
state table.

x
0 1 History ends with
A even # 1s followed by even # 0s
B even # 1s followed by odd # 0s
C odd # 1s
D odd # 1s followed by 1 or more # 0s

b. A state table is shown below. Assuming it begins in stae A, show all the outputs and
states given the input sequence shown below the state table.

0 1
A A,0 B,0
B C,0 A,1
C A,1 D,0
D C,1 A,1

x: 0 0 1 0 0 0 1 0 1 0 0 …
A
z:
ECE2042 Test #2 April 21, 2017
Closed Book, one sheet of paper, programmer card, no calculators
Show all your work

Name:

33% 2. The circuit for a state machine is shown as follows. Determine the state table in standard
form by using the steps given below. The clock signal is not shown.

J Q y J Q y
1 2
1 2 z
y1' y2'
K Q' K Q'

a. Write the expressions in MSOP form for the excitation variables and the output
variable.

b. Show Karnaugh maps for the five functions.


x x x x x
y1y2 0 1 y1y2 0 1 y1y2 0 1 y1y2 0 1 y1y2 0 1

00 00 00 00 00

01 01 01 01 01

11 11 11 11 11

10 10 10 10 10
J1 K1 J2 K2 z

Problem 2 continued on back.


c. Karnaugh maps for the five functions of a different state machine are shown below.
Write the next-state table. A blank one is given below for you to use.
x x x x x
0 1 0 1 0 1 0 1 0 1
y1y2 y1y2 y1y2 y1y2 y1y2
00 1 1 00 1 0 00 1 1 00 1 1 00 0 0

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

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

10 1 1 10 1 0 10 0 1 10 1 0 10 1 0
J1 K1 J2 K2 z

x
y1y2 0 1
00

01

11

10

d. A next-state table is shown below to the left. Show the state table in standard form.

x
0 1
00 00,1 01,1
01 00,0 10,0
11 01,1 10,1
10 10,0 11,0
ECE2042 Test #2 April 21, 2017
Closed Book, one sheet of paper, no calculators
Show all your work

Name:

33% 3. For this problem, assume the 68000 is a 4-bit computer; i.e., all registers and memory
locations are 4 bits long. Do the following:

a. D0 contains the binary value 1001 and D1 contains the binary value 0011.
i. Convert these value to decimal assuming they represent unsigned integers.

ii. Convert these values into decimal assuming they represent signed integers.

b. The instruction SUB D0,D1 is then executed.


i. In which register is the result stored?

ii. Show the binary calculation actually carried out by the computer.

iii. Convert the result into decimal assuming it represents an unsigned integer, and
explain whether an unsigned arithmetic overflow occurred.

iv. Convert the result into decimal assuming it represents a signed integer, and
explain whether a signed arithmetic overflow occurred.

Problem 3 continued on back.


c. i. The instruction BHS MORE is then executed (where MORE is a label already
defined elsewhere in the program). Will the program branch in this case?
Explain.

ii. The instruction BGE MORE is then executed (where MORE is a label already
defined elsewhere in the program). Will the program branch in this case?
Explain.

You might also like