Lab #11: Register Files Zack Mattis Lab: 3/21/17 Report: 3/26/17 Partner: Brendan Schuster
Purpose In this lab, 4x4 register was designed and fully implemented onto a protoboard that emulates the local memory of a CPU. These registers provide temporary storage of the data that is about to be processed. This implementation has 4 individual registers that can be addressed using 2 separate counters, one for writing and one for reading, respectively. Each address is capable of storing 4 bits or 1 hexadecimal character. The circuit was implemented using 7 segment displays to observe the data input as well as the stored register values. The design can be seen in Figure 1 below. The operation of the design was verified using the LogicPort Logic Analyzer to observe the signals of the circuit. The design was implemented using one 4x4 register (74LS670), two counters (74LS193), two NAND ICs for de-bounced switches (7400), two 7-segment display drivers/decoders (74LS247), two 7-segment displays, one 8-bit DIP SPST switch, 10 resistors, and 5 LEDS. Figure 1
Procedure The design for the 4x4 register was created using the Altera Quartus 9.1 software and can be seen in Figure 2 (see attached). This design uses a 4x4 register, two counters to provide the addressing for read/write, and two decoders for the seven segment displays that convert the hexadecimal input/output into a visual 7 segment output display. This design was then tested using the using the Quartus simulation tool that allows for user selected data for each of the inputs. By manipulating the clocking signal of the counters, the user can select the which of the 4 registers they wish to read/write to for each respective counter. Additionally, by enabling the write signal to 0 (active low), the data input value (0-15) can be stored within the selected register. The waveform from Quartus can be seen in Figure 3 (see attached). This figure shows the value of 8 being written to register 0, output with all low values for the seven segment displays corresponding to each pin (active lows). Additionally, it shows the value of 1 being written to register 1, corresponding to the decoder output lows of segments b (LED_out[1]) and c (LED_out[2]) for the value of 1. The verified design was then implemented onto the protoboard using the previously mentioned IC chips. The DIP switches were used as the data inputs for the register and the counters were used as the addressing for the read/write registers. Both the data inputs and the outputs from the 4x4 register were wired to sevensegment display decoders and then seven segment displays. These displays allowed for easy viewing of the hexadecimal value that was being provided to or stored within the register. For the design, LEDs were added to the output of each counter to be able to view which register was active. De-bounced switches were used to provide the clocking signal for the counters as well as the write enable signal for the register. The read signal was grounded to ensure that it would always be operational (active low). This protoboard implementation was then analyzed using the LogicPort Logic Analzyer. This device converts the analog signal of the circuit into a digital form of 0s and 1s. This tool enables effective observation of the circuit s inputs and outputs. In our testing, we connected the device to our clock as well as 13 inputs. Inputs D0-D12 were: write_register[1-0], read_register[1-0], data_in[3-0], writeenable_l, data_out[30]. The waveform can be seen in Figure 4 (see attached).
Results The use of a counter combined with a de-bounced switch as the clocking signal allows for effective cycling of the register inputs for read/write from 0-3. Utilization of another switch as the input for the write enable allows for a very simple device to write that data from the input into the register. With the read enable signal as a ground, the 4x4 register will always be reading the selected registers value at any time that a new value is not being written. The seven segment displays are very useful parts that allow for the user to easily see the hexadecimal value from the 4 switches for the data input as well as the hexadecimal values that is stored within the registers. The use of LEDs for the output of the counter allow the user to see which register has been selected. Our circuit design can be seen in Figures 5 and 6 below. In Figure 5, you can see that register 2 has been selected for both the read and write counters from the LEDs in the top left corner. Also, the value of 1 is stored in the register while 8 is being provided as the data input. In Figure 6, you can see the write enable switch being selected, going to a low value with the LED off (active low), and writing the data input value of 8 into the selected register. Figure 5
Figure 6 Conclusion The design implementation of the 4x4 register from Figure 2 proved to be a successful design. This protoboard circuit can effectively act as a local storage device for things such as a CPU, using registers to store temporary values. The LogicPort Logic Analyzer output waveform from Figure 4 shows the user correctly utilizing the
register to store hexadecimal values. At time t~= -5s, the hex value of 7 is written to register 2 (out[0-2]) once the write enable is set to low. Additionally, at t~=2s, the hex value of 8 is written into register 0, as you can see from the out_3 waveform. Utilization of the Logic Analyzer to convert the analog inputs/outputs to a digital 0/1 configuration allows the user to test and verify the output of the circuit to ensure that it is functioning properly. The 4x4 register design and implementation was a practical application to understanding how the CPU of a computer utilizes its local memory to write and read values. References 1. ECE 0501 Digital Systems Laboratory Custom Course Materials. Laboratory Notebook. University of Pittsburgh.