CPR E 381x/382x - Lab 2b

Hardware Converter Design

 

1. Objectives

In this lab you will design a converter that takes a 32-bit input and produces a 32-bit output.  The behavior of this module is described below.  Pay close attention to the module as you are designing it, because you will be asked to describe the higher level behavior that you have implemented.

 

2. Setup

Create the folder in your home directory U:\CPRE381\Lab2b.

                                                                                                                                       

3. Module Design

       Create a module that takes a 32-bit input and produces a 32-bit output.  In addition, the module will require two 1-bit inputs, clock and reset, and will produce a 1-bit output, done. 

 

Design a state machine that performs the following steps (in any step, if reset = 1, return to step 0):

0.      While reset = 1, set done = 0, 32-bit output = 0.

1.      Initialize an eight bit count value to 10001111Binary.  Initialize a 32-bit register to the 32-bit input value.

2.      Shift the 32-bit register left by one bit, shifting in a 0 as the new least significant bit (reg = reg << 1).

3.      Decrement the count value by 1 (count = count-1).

4.      If the bit shifted out in step 2 was a 0, repeat steps 2 and 3.  If the bit shifted out was a 1, continue to step 5.

5.      Assert the done output, and set the 32-bit output as below:

 

32-bit Output:

4. Turning In

      Create a printout of all relevant code, as well as any waveforms used to test your circuit.  In addition, answer the following question about the performance of the circuit you have just designed: 

 

Describe the higher level behavior of this module, specifically, what conversion is taking place?