Lab4 Digital Design
Lab4 Digital Design
A SIMPLE 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.
➢ Examine a simple processor.
REFERENCE
1. Intel FPGA training
Instruction:
➢ The Registers block and Addsub subsystem is written in Lab 3, Multiplexer block is written
in Lab 1. Modify these subsystems to satisfy the parameters of the processor.
➢ The FSM control unit is prepared in your Pre Lab 5. Write the code for this block.
➢ Use functional simulation to verify that your code is correct. An example of the output
produced by a functional simulation for a correctly-designed circuit is given in Figure 2. It
shows the value (010)8 being loaded into IR from DIN at time 30 ns. This pattern represents
the instruction mvi R0,#D, where the value D = 5 is loaded into R0 on the clock edge at 50
ns. The simulation then shows the instruction mv R1,R0 at 90 ns, add R0,R1 at 110 ns,
Requirement: Extend the circuit from Experiment 1 to the circuit in Figure 3, in which a memory
module and counter are connected to the processor. The counter is used to read the contents of
successive addresses in the memory, and this data is provided to the processor as a stream of
instructions. To simplify the design and testing of this circuit we have used separate clock signals,
PClock and MClock, for the processor and memory.
Instruction:
➢ A diagram of the memory module that we need to create is depicted in Figure 4. The System
Verilog code for this module is prepared in exercise 3, pre lab 4.
➢ A diagram of the counter is shown in Figure 5. Write System Verilog code for the counter
using the hint from the Figure.