Lab6: Sequential Logic in VHDL | ||
|
Objective:The objective of this lab is to introduce the student to writing VHDL that describes a sequential system. This lab is worth 100 pts. To Do:The VHDL entity shown below: library ieee; entity updnshift8 is defines a register that has up/down counting, parallel load, and right/left shifting capabilities. The function of the register is as follows: a. sclr is a synchronous clear that has highest precedence b. ld is a load line that will load the register contents from the din bus. The load function has a lower precedence than the synchronous clear function. c. The two bit func input controls the counting/shifting functions. If func="00", then no counting or shifting is done. If func = "01", then count by 1, where the count direction is determined the "down" control line. If func = "10", then shift by 1, where the shift direction is determined by the 'sleft' control line and the shift bit by the 'sin' data bit. If func is "11", then the register value is both counted and shifted (in the same clock, count is first). Implementation GuidelinesYou are to write the architecture that implements the functionality defined above. To do a increment or decrement, you can simply use the '+' addtion, subtraction operator as follows: a <= a + 1; or a <= a - 1; where 'a' is a signal of std_logic_vector types. If you use a variable instead of a signal, then the '<=' operator is replaced by ':='. . It is important that you include the statements: library ieee; at the top of the file; this directs the synthesis tool how to generate an adder for a std_logic type. You should not try to do everything in the first pass --- first get the SCLR, ACLR, LOAD functions working. Then do the up/down counting function, followed by the shifting function, and fnally the combined count + shift function. Look at the test waveform mentioned in the next section and be sure you understand the function of each control line. Testing Your DesignThe CSGOLD.SCF file below is a golden waveform file. Save it as "updnshift8.scf" and then compare your results against the golden results. RIGHT CLICK on each filename to save to disk: CSGOLD.SCF To Turn InA code listing of your VHDL file. Check OffYou must DEMONSTRATE you updnshift8 design to the TA and show that your results matches the expected results.
|
|