Go to  ECE459   Experiment   |    |    2   |    3    |      |   Lab manuals   |   ECE Lab home    

ECE459 Advanced Computer System Design Lab

Chapter 4

EXPERIMENT 4

CPU Design with Support for External Interrupts

4.1   Objective

The objective of this experiment is to design, simulate, and build a microcoded CPU capable of servicing external interrupt requests. Interrupts will be employed to initiate memory-mapped I/O. Firmware in the microcode will implement polling to determine the type of interrupt request.

The CPU implementation should use the Altera UP 1 Education Board. Onboard or additional push buttons should be used to initiate interrupts.

 

4.2   Introduction

The system specifications follow:

 

Table 4.1. CPU instruction set.

Instructions Operations
NOP  none
LOAD $XX  AC  ←  M [$XX]. Set  Z=1  if  AC = 0, else Z=0
STORE $XX  M [$XX]    AC
MOVE DR   ←  AC
SUB AC AC - DR. Set  Z=1  if  AC = 0, else Z=0
AND  AC ←  AC AND DR. Set  Z=1  if AC = 0,  else Z=0
JUMPZ $XX  If  Z = 1  then  PC $XX
RETINT Return from ISR. Restore PC and Z flag.
 Enable interrupts
Optional Instructions Operations
 SWAP
ANDI $X
SUBI $X
LOADI $X
TESTI $X
AC DR.  Set Z=1  if AC = 0, else Z=0
AC AC AND $X.  Set  Z=1  if AC = 0, else Z=0
AC AC - $X.  Set  Z=1 if AC = 0, else Z=0
AC $X. Set Z=1  if AC = 0, else Z=0
Set  Z=1 if AC = $X, else Z=0

 

Table 4.2. Interrupt service routine (ISR) actions.

Interrupt Action
A Output the value of memory location $F4 to the 4-bit LEDs (i.e., OP0)
B Input a 4-bit value from input port IP0 and write that data to location $F5 in memory
C Input the low-order nibble of a memory address from input port IP1 and output the data at that location to output port OP0. Assume that the high-order nibble of the address is $F
Optional Action
D Input an 8-bit memory address from input ports IP2 and IP3 and output the data at that location to output port OP0. If interrupt D is implemented, interrupt C is optional. Both may be implemented for extra credit.

4.4   Experiment

Pre-Lab Assignment

Design the above CPU in block diagram form. Write the microcode. Design the hardware which is external to the CPU.


Lab Assignment

Use  Max+PLUS II to implement and simulate your design for the set of required instructions. For extra credit, your code also should demonstrate the optional features of the CPU.

Demonstrate the simulator and the hardware implementation to the instructor.

  Go to  ECE459   Experiment   |    |    2   |    3    |      |   Lab manuals   |   ECE Lab home