Pre-Lab5 Digital Design
Pre-Lab5 Digital Design
AN ENHANCED PROCESSOR
OBJECTIVES
➢ The purpose of this lab is to learn how to connect simple input (switches) and output devices
(LEDs and 7-segment) to an FPGA chip and implement a circuit that uses these devices.
➢ Design an enhanced processor based on the simple processor in lab 4.
REFERENCE
1. Intel FPGA training
Instruction:
You will add three new types of instructions to the processor, as displayed in Table 1. The ld
(load) instruction loads data into register RX from the external memory address specified in
register RY. The st (store) instruction stores the data contained in register RX into the memory
address found in RY. Finally, the instruction mvnz (move if not zero) allows a mv operation to be
executed only under the condition that the current contents of register G are not equal to 0.
A reference schematic of the enhanced processor is given in Figure 1. In this figure, registers
R0 to R6 are the same as in Figure 1 of Laboratory 5, but register R7 has been changed to a counter.
This counter is used to provide the addresses in the memory from which the processor’s
instructions are read; in the preceding lab exercise, a counter external to the processor was used
for this purpose. We will refer to R7 as the processor’s program counter (PC), because this
terminology is common for real processors available in the industry. When the processor is reset,
PC is set to address 0. At the start of each instruction (in time step 0) the contents of PC are used
as an address to read an instruction from the memory. The instruction is stored in IR and the PC s
automatically incremented to point to the next instruction (in the case of mvi the PC provides the
address of the immediate data and is then incremented again).
The processor’s control unit increments PC by using the incr_PC signal, which is just an enable
on this counter. It is also possible to directly load an address into PC (R7) by having the processor
execute a mv or mvi instruction in which the destination register is specified as R7. In this case