DSD Lab 9 Handout
DSD Lab 9 Handout
Islamabad
Digital System Design LAB
Name of Student:
Roll No.:
Date of Experiment:
Marks obtained:
Remarks:
Instructor’s Signature:
2. Resources Required
• A Computer
• Xilinx ISE
• Spartan 2 or Spartan 3 board
3. Introduction
A register capable of shifting the binary information held in each cell to its neighboring cell, in a
selected direction is called a shift register. The logical configuration of a shift register consists of
a chain of flip-flops in cascade with the output of one flip-flop connected to the input of the next
flip-flop. All flip-flops receive common clock pulses, which activate the shift of data from one
stage to the next. The simplest possible shift register is one that uses only flip-flops, as shown in
the following figure.
A register capable of shifting in one direction only is a unidirectional shift register. One that can
shift in both directions is a bidirectional shift register. If the register has both shifts and parallel‐
load capabilities, it is referred to as a universal shift register.
Stimulus:
module Stimulus;
wire [3:0] A_out;
reg clk, clear, sleft, sright;
reg [1:0] mux_sel;
reg [3:0] I_in;
//Module Instantiation
universal_register u0(A_out, I_in, clk, clear, mux_sel, sleft, sright);
//Clock Generator (Must for Sequential circuits)
initial
begin
Clk=1'b0;
forever
#1 Clk = ~Clk;
end
5. Lab Task
Implement a 4-bit Universal Shift Register Counter using instantiation (as given in the
figure) that implements the following table. Utilize the Stimulus given in code section.
6. Home Work
Implement a 4-bit Universal Shift Register Counter using Behavioral modeling as given in
the following figure. You can utilize the same Stimulus.
Q.2 What is the difference between Universal and normal Shift registers?
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
Q.4 What is the difference between arithmetic shift and binary shift?
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________