EE 306, Fall 2013
Problem Set 3
Due: 7 October, before class
Yale N. Patt, Instructor
TAs: Ben Lin, Mochamad Asri,
Ameya Chaudhari, Nikhil Garg, Lauren Guckert,
Jack Koenig, Saijel Mokashi, Sruti Nuthalapati, Sparsh Singhai, Jiajun Wang
Instructions:
You are encouraged to work on the problem set in groups and turn in one problem
set for the entire group. Remember to put all your names on the solution sheet.
Also, remember to put the name of the TA and the time for the discussion
section you would like the problem set turned back to you. Show your work.
1. Elevator Problem Revisited
Recall the elevator controller problem on Problem Set 2. You were asked to
design the truth table for an elevator controller such that the option to move
up or down by one floor is disabled. If there is a request to move only one
floor or to move zero floors, the elevator should remain on the current floor.
For this problem, you will design the state machine for the sequential logic
circuit for an elevator controller which performs the same operation. You can
assume that the building the elevator is in has 4 floors. The input to the
state machine is the next requested floor. There will be a state for each floor
the elevator could be on. Draw a finite state machine that describes the
behavior of the elevator controller. How many bits are needed for the inputs?
A[
1:0]
and WE
be?3. The figure below is a diagram of a 2^{2}by16bit
memory, similar in implementation to the memory of Figure 3.21 in the textbook.
Note that in this figure, every memory cell represents 4 bits of storage
instead of 1 bit of storage. This can be accomplished by using 4 GatedD
Latches for each memory cell instead of using a single GatedD Latch. The hex
digit inside each memory cell represents what that cell is storing prior to
this problem.
Figure 3: 2^{2}by16 bit memory
WE 
A[1:0] 
Di[15:0] 
D[15:0] 
Read/Write 















4. (3.41)
The IEEE campus society office sells sodas for 35 cents. Suppose they install a
soda controller that only takes the following three inputs: nickel, dime, and
quarter. After you put in each coin, you push a pushbutton to register the
coin. If at least 35 cents has been put in the controller, it will output a
soda and proper change (if applicable). Draw a finite state machine that
describes the behavior of the soda controller. Each state will represent how
much money has been put in (Hint: There will be seven of those states). Once
enough money has been put in it, the controller will go to a final state where
the person will receive a soda and proper change (Hint: There are five such
final states). From the final state, the next coin that is put in will start
the process again, contributing to the next purchase.
5.
(Adapted from 3.30)
A comparator circuit has two 1bit inputs, A and B, and three 1bit outputs, G
(greater), E (equal), and L (less than). Refer to figures 3.40 and 3.41 on page
92 in the book for this problem.
Register 
Value 




















Memory Location 
Value 








For each phase of the new
instruction cycle, specify the values that PC
, IR
,
MAR
, MDR
, R1
, and R2
will have at the
end of the phase in the following table:













Fetch 

Decode 

Evaluate
Address 

Fetch Operands 

Execute 

Store Result 
Hint: Example 4.2 on page 104
illustrates the LDR
instruction of the LC3. Notice that values of memory
locations x3000
, and 3003
can be interpreted as
LDR
instructions.





If there are 255 opcodes and 120 registers, and every register is available
as a source or destination for every opcode,
OPCODE
?DR
)?UNUSED
bits in the
instruction encoding?