CS 202 - Problem Eight: 4-bit shift register

Due: 03/15/2023

Goals

  • Demonstrate your knowledge of sequential circuits
  • Learn an alternative number representation

Objective

For this problem, you will implement a 4-bit shift register. A shift register can be used like a normal register -- values can be loaded in and then they are stored until we change them. The shift register adds one wrinkle, in addition to loading in new values, it can also perform a shift in which the values of all of the bits move over one to their neighbor.

There are left-shift and right-shift registers. While there are a number of reasons we might want to shift the bits in a register, one of the more important reasons is that it is a quick way to multiply by 2 (left shift) or divide by 2 (right shift).

I would like you to implement a right shift register

Requirements

  • your work must be in a file called shift_register.circ
  • your implementation must be in the main circuit (you are welcome to create sub-circuits however)
  • your circuit must have four inputs: D_in, load, shift, shift_in and the clk
  • D_in will be a 4-bit value
  • shift_in is a 1-bit value
  • load and shift are 1-bit inputs.
  • When load is 1 and shift is 0. The register should load D_input into the register on the next clock edge
  • When store is 1 and load is 0, the register should perform a right shift on the next clock edge. The value of shift_in will be shifted into the most significant bit.
  • If both load and shift are 1, the behavior is undefined (i.e., you can ignore this)
  • The circuit has one output D_out
  • At all times, D_out should reflect the value currently stored in the register
  • you are restricted to
    • input pins
    • output pins
    • splitters
    • components in the Gates library (i.e., basic logic gates)
    • components in the Plexers library
    • D flip flops

Submission

Upload your .circ file to Canvas.


Last updated 03/13/2023