Go to  COE498   Experiment   |    |    2  |    3    |      |     Part List    |   Lab manuals   |   ECE Lab home

COE498 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 design should include several Altera programmable logic devices (PLDs).

 

4.2   What You Need

 

4.3   Introduction

This CPU design is basically a major extension of the design in the last experiment of CoE 485. 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

Optional instructions for extra credit are listed in the lower half of Table 4.1. These include 1-word and 2-word instructions. These instructions can be implemented with very little or no additional hardware in the execution unit (EPM7064 or EPM7096).

Hardware to support three or four different interrupts.

The action taken by the ISR depends each time on the type of interrupt. All possible actions are described in Table 4.2.

 

4.4   Experiment

Pre-Lab Assignment

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.

 

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

 

Lab Assignment

Develop Altera Hardware Description Language (AHDL) code for programming the PLDs and SamPlus code for the EPS448 microcode.

Use the simulator in Max+PLUS II to simulate the CPU 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 to the instructor.

  Go to  COE498   Experiment   |    |    2  |    3    |      |     Part List    |   Lab manuals   |   ECE Lab home